/* =========================================================
   YRUBIO CONSULTANTS · estilos
   Fondos: se intenta primero la imagen local (statics/img/yrubio)
   y, si no existe, se muestra la de northdeltasl.es por debajo.
   Ajusta --local si tu carpeta está en otra ruta.
   ========================================================= */

:root {
  --green-950: #0b2419;
  --green-900: #12372a;
  --green-700: #1f6b4a;
  --green-500: #3a9d6b;
  --green-300: #8fd1ad;
  --green-100: #e4f3ea;
  --sand: #f6f3ec;
  --earth: #b8893f;
  --earth-dark: #96702f;
  --ink: #1d2a24;
  --muted: #4a5a52;
  --white: #ffffff;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(18, 55, 42, .10);
  --shadow-lg: 0 18px 44px rgba(18, 55, 42, .20);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --font-title: "Poppins", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;

  /* Fondos: [local, remoto] */
  --bg-campo-local:  url("../../statics/img/yrubio/campo.webp");
  --bg-campo-remote: url("https://northdeltasl.es/static/media/img/campo.webp");
  --bg-riego-local:  url("../../statics/img/yrubio/riego.webp");
  --bg-riego-remote: url("https://northdeltasl.es/static/media/img/riego.webp");
  --bg-ndvi-local:   url("../../statics/img/yrubio/ndvi.webp");
  --bg-ndvi-remote:  url("https://northdeltasl.es/static/media/img/ndvi.webp");
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--green-700); }
h1, h2, h3 { font-family: var(--font-title); line-height: 1.18; margin: 0 0 .6em; color: var(--green-900); letter-spacing: -.01em; }
h1 { font-size: clamp(2.2rem, 5.5vw, 3.9rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }
p { margin: 0 0 1em; }
::selection { background: var(--green-500); color: var(--white); }

.container { width: min(1140px, 92%); margin-inline: auto; }
.narrow { width: min(780px, 92%); }
.center { text-align: center; }

/* Subrayado decorativo bajo los títulos de sección */
.section h2::after {
  content: "";
  display: block;
  width: 56px; height: 4px; margin-top: .55em;
  background: linear-gradient(90deg, var(--earth), var(--green-500));
  border-radius: 4px;
}
.center h2::after { margin-inline: auto; }

/* ===== Botones ===== */
.btn {
  display: inline-block;
  padding: .85em 1.7em;
  background: linear-gradient(135deg, #1a5c3e, #247a52);
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: .01em;
  border-radius: 999px;
  border: 2px solid transparent;
  box-shadow: 0 8px 20px rgba(31, 107, 74, .30);
  transition: transform .2s, box-shadow .2s, background .2s, color .2s;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(31, 107, 74, .38); }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 3px solid var(--earth); outline-offset: 3px; }
.btn-outline {
  background: rgba(255, 255, 255, .08);
  color: var(--white);
  border-color: rgba(255, 255, 255, .85);
  box-shadow: none;
  backdrop-filter: blur(4px);
}
.btn-outline:hover { background: var(--white); color: var(--green-900); box-shadow: 0 10px 24px rgba(0, 0, 0, .25); }
.btn-small { padding: .5em 1.2em; font-size: .93rem; box-shadow: none; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid rgba(18, 55, 42, .08);
  transition: box-shadow .3s, background .3s;
}
.site-header.scrolled { background: rgba(255, 255, 255, .97); box-shadow: 0 6px 24px rgba(18, 55, 42, .12); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 70px; }
.brand { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--green-900); }
.brand-mark {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--green-900), var(--green-500));
  color: var(--white);
  border-radius: 12px; font-family: var(--font-title); font-weight: 800;
  box-shadow: 0 4px 12px rgba(31, 107, 74, .35);
}
.brand-text { letter-spacing: .08em; font-size: .95rem; font-weight: 500; }
.brand-text strong { color: var(--green-700); font-weight: 700; }

.nav { display: flex; align-items: center; gap: 1.7rem; }
.nav a:not(.btn) { position: relative; text-decoration: none; color: var(--ink); font-weight: 500; padding: .2em 0; }
.nav a:not(.btn)::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px;
  background: var(--earth); transition: width .25s;
}
.nav a:not(.btn):hover { color: var(--green-700); }
.nav a:not(.btn):hover::after { width: 100%; }
.nav .btn { color: var(--white); }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.7rem; cursor: pointer; color: var(--green-900); }

/* ===== Hero con imagen de fondo ===== */
.hero {
  position: relative;
  color: var(--white);
  padding: clamp(5rem, 13vw, 10rem) 0 clamp(5rem, 12vw, 9rem);
  background:
    linear-gradient(115deg, rgba(11, 36, 25, .94) 0%, rgba(11, 36, 25, .86) 55%, rgba(18, 55, 42, .68) 100%),
    url("../../statics/img/yrubio/campo.webp"),
    url("https://northdeltasl.es/static/media/img/campo.webp"),
    linear-gradient(135deg, var(--green-900), var(--green-700));
  background-size: cover, cover, cover, cover;
  background-position: center;
  background-attachment: scroll, fixed, fixed, scroll;
  isolation: isolate;
  overflow: hidden;
  background-color: #12372a;
}
/* Curva inferior */
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 60px; z-index: -1;
  background: var(--green-100);
  clip-path: ellipse(60% 100% at 50% 100%);
}
.hero h1 { color: var(--white); max-width: 17ch; text-shadow: 0 2px 20px rgba(0, 0, 0, .35); }
.hero .lead { max-width: 58ch; font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: #f1f8f4; text-shadow: 0 1px 10px rgba(0, 0, 0, .45); }
.eyebrow {
  display: inline-flex; align-items: center; gap: .6rem;
  text-transform: uppercase; letter-spacing: .16em;
  font-size: .78rem; font-weight: 700;
  color: var(--green-300); margin-bottom: 1.1rem;
}
.eyebrow::before { content: ""; width: 34px; height: 2px; background: var(--earth); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }
.hero .btn:not(.btn-outline) { color: var(--green-950); background: linear-gradient(135deg, #d4a455, #e9c27b); box-shadow: 0 10px 26px rgba(184, 137, 63, .45); }
.hero .btn:not(.btn-outline):hover { background: linear-gradient(135deg, #c9973f, #d4a455); }

/* ===== Anuncio ===== */
.announce { background: var(--green-100); border-bottom: 1px solid #cfe6d9; }
.announce-inner { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 1.1rem 0; text-align: left; }
.announce p { margin: 0; }
.badge {
  flex: none;
  background: #7a5a1f; color: var(--white);
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; padding: .35em .9em; border-radius: 999px;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(184, 137, 63, .5); } 50% { box-shadow: 0 0 0 8px rgba(184, 137, 63, 0); } }

/* ===== Franja de pilares ===== */
.pillars { background: var(--white); border-bottom: 1px solid #edf1ee; }
.pillars-inner { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; padding: 1.6rem 0; }
.pillar { display: flex; align-items: center; gap: .8rem; font-weight: 600; color: var(--green-900); }
.pillar span { font-size: 1.5rem; }

/* ===== Secciones ===== */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-alt {
  background:
    linear-gradient(180deg, rgba(246, 243, 236, .96), rgba(246, 243, 236, .96)),
    url("../../statics/img/yrubio/riego.webp"), url("https://northdeltasl.es/static/media/img/riego.webp");
  background-size: cover; background-position: center;
  background-color: #f6f3ec;
}
.section-intro { color: var(--muted); max-width: 60ch; margin-bottom: 2.6rem; font-size: 1.05rem; }

.grid { display: grid; gap: 1.6rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  position: relative;
  background: var(--white);
  border: 1px solid #e3e8e5;
  border-radius: var(--radius);
  padding: 2rem 1.8rem;
  box-shadow: var(--shadow);
  transition: transform .3s, box-shadow .3s, border-color .3s;
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 4px;
  background: linear-gradient(90deg, var(--green-700), var(--earth));
  transform: scaleX(0); transform-origin: left; transition: transform .35s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--green-300); }
.card:hover::before { transform: scaleX(1); }
.card p { color: var(--muted); margin: 0; }
/* ===== Comercio ===== */
.split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3.2rem; align-items: start; }
.checklist { list-style: none; padding: 0; margin: 1.5rem 0 2.2rem; }
.checklist li { position: relative; padding-left: 2.2rem; margin-bottom: .9rem; }
.checklist li::before {
  content: "✓";
  position: absolute; left: 0; top: .2em;
  width: 1.5rem; height: 1.5rem; display: grid; place-items: center;
  background: var(--green-700); color: var(--white);
  border-radius: 50%; font-size: .8rem; font-weight: 700;
}
.yr-process {
  position: relative;
  background:
    linear-gradient(160deg, rgba(11, 36, 25, .97), rgba(18, 55, 42, .95)),
    url("../../statics/img/yrubio/ndvi.webp"), url("https://northdeltasl.es/static/media/img/ndvi.webp");
  background-size: cover; background-position: center;
  color: var(--white);
  border-radius: var(--radius); padding: 2.2rem; box-shadow: var(--shadow-lg);
  background-color: #12372a;
}
.yr-process h3 { color: var(--white); font-size: 1.35rem; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 1.2rem 0 0; }
.steps li { counter-increment: step; position: relative; padding-left: 3rem; margin-bottom: 1.3rem; color: #dcebe3; }
.steps li strong { color: var(--white); }
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 2.1rem; height: 2.1rem; display: grid; place-items: center;
  background: linear-gradient(135deg, #d4a455, #e9c27b); color: var(--green-950); border-radius: 50%; font-weight: 700;
}

/* ===== Banda de colaboración con fondo ===== */
.band {
  color: var(--white);
  background:
    linear-gradient(120deg, rgba(11, 36, 25, .94), rgba(18, 55, 42, .90)),
    url("../../statics/img/yrubio/riego.webp"), url("https://northdeltasl.es/static/media/img/riego.webp"),
    var(--green-900);
  background-size: cover; background-position: center;
  background-attachment: scroll, fixed, fixed, scroll;
  background-color: #12372a;
}
.band h2 { color: var(--white); }
.band p { color: #e3f0e9; font-size: 1.08rem; }

/* ===== Galería ===== */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.gallery figure { margin: 0; position: relative; overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--green-900); }
.gallery img { width: 100%; height: 100%; min-height: 230px; object-fit: cover; transition: transform .5s; }
.gallery figure:hover img { transform: scale(1.06); }
.gallery figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 2rem 1rem .9rem; color: var(--white); font-size: .92rem; font-weight: 600;
  background: linear-gradient(transparent, rgba(11, 36, 25, .94) 70%);
  text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
}
.gallery-main { grid-column: 1 / -1; }
.gallery-main img { min-height: 380px; }

/* ===== CTA / Contacto ===== */
.cta {
  background:
    linear-gradient(180deg, rgba(228, 243, 234, .96), rgba(255, 255, 255, .94)),
    url("../../statics/img/yrubio/ndvi.webp"), url("https://northdeltasl.es/static/media/img/ndvi.webp");
  background-size: cover; background-position: center;
  background-color: #e4f3ea;
}
.contact-card {
  font-style: normal;
  background: var(--white); border: 1px solid #d5e6dc;
  border-radius: 20px; box-shadow: var(--shadow-lg);
  padding: 2.4rem; margin-top: 1.8rem;
}
.contact-card p { margin: 0 0 .4em; color: var(--muted); }
.contact-name { font-family: var(--font-title); font-size: 1.4rem; font-weight: 700; color: var(--green-900) !important; }
.phone {
  display: inline-block; margin-top: .6rem;
  font-size: 1.5rem; font-weight: 700; text-decoration: none; color: var(--white);
  background: linear-gradient(135deg, #1a5c3e, #247a52);
  padding: .45em 1.3em; border-radius: 999px;
  box-shadow: 0 8px 20px rgba(31, 107, 74, .3);
  transition: transform .2s;
}
.phone:hover { transform: translateY(-3px); }

/* ===== Footer ===== */
.site-footer { background: var(--green-950); color: #b9cfc3; padding: 2rem 0; font-size: .92rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; }
.footer-inner p { margin: 0; }

/* ===== Animación de entrada (scroll) ===== */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.visible { opacity: 1; transform: none; }
.js .reveal.d1 { transition-delay: .08s; }
.js .reveal.d2 { transition-delay: .16s; }
.js .reveal.d3 { transition-delay: .24s; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; gap: 2.2rem; }
  .pillars-inner { grid-template-columns: repeat(2, 1fr); }
  /* background-attachment: fixed va mal en móviles/tablets */
  .hero, .band { background-attachment: scroll; }
}
@media (max-width: 680px) {
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute; top: 70px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 1.1rem;
    background: var(--white); padding: 1.3rem 4%;
    border-bottom: 1px solid #e3e8e5; box-shadow: 0 14px 24px rgba(18, 55, 42, .10);
  }
  .nav.open { display: flex; }
  .grid-3 { grid-template-columns: 1fr; }
  .announce-inner { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .gallery { grid-template-columns: 1fr; }
  .gallery-main { grid-column: auto; grid-row: auto; }
  .gallery-main img { min-height: 260px; }
  .contact-card { padding: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ===== Animación hero: red de conexiones ===== */
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.hero-inner { position: relative; z-index: 1; }
.rot {
  display: inline-block;
  color: #e9c27b;
  border-bottom: 3px solid var(--earth);
  transition: opacity .35s ease, transform .35s ease;
}
.rot.out { opacity: 0; transform: translateY(.35em); }
.hero-inner > * { animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
.hero-inner > *:nth-child(2) { animation-delay: .12s; }
.hero-inner > *:nth-child(3) { animation-delay: .24s; }
.hero-inner > *:nth-child(4) { animation-delay: .36s; }
@keyframes rise { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }

/* ===== Imagen en tarjetas ===== */
.card-media {
  position: relative;
  margin: -2rem -1.8rem 1.3rem;
  height: 180px;
  overflow: hidden;
  background: var(--green-900);
}
.card-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(11, 36, 25, .35));
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.card:hover .card-media img { transform: scale(1.08); }

/* ===== Texto claro garantizado sobre fondos oscuros ===== */
.yr-process, .yr-process p, .yr-process li { color: #eaf4ee; }
.yr-process h3, .yr-process li strong { color: #ffffff; }
.band, .band p { color: #eaf4ee; }
.band h2 { color: #ffffff; }
.hero h1 { color: #ffffff; }
.hero .rot { color: #e9c27b; }

/* Especificidad alta para que ningún otro CSS del proyecto lo pise */
#comercio .yr-process { background-color: #12372a !important; color: #eaf4ee !important; }
#comercio .yr-process h3, #comercio .yr-process strong { color: #ffffff !important; }
#comercio .yr-process li, #comercio .yr-process p { color: #eaf4ee !important; }