/* ========================================
   Reset y base
   ======================================== */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  line-height: var(--lh-body);
  font-size: var(--text-body);
  background: #efeae0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-body);
  font-weight: var(--weight-bold);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-tight);
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--marigold-70);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ========================================
   Utilidades
   ======================================== */

.display-wordmark {
  font-family: var(--font-display);
  line-height: var(--lh-display);
  text-transform: uppercase;
}

.tagline-caps {
  font-family: var(--font-caps);
  font-weight: var(--weight-medium);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
}

/* ========================================
   Layout principal
   ======================================== */

.site-wrapper {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  background: #fdfbf6;
  font-family: var(--font-body);
  color: var(--ink);
}

/* ========================================
   Header
   ======================================== */

.site-top {
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header {
  background: #efeae0;
  border-bottom: 1px solid rgba(94, 103, 51, 0.14);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 28px 56px;
  gap: 32px;
}

.header-nav {
  display: flex;
  gap: 52px;
  font-size: 19px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--verde-bosque);
}

.header-nav--start {
  justify-self: start;
}

.header-nav--end {
  justify-self: end;
}

.header-nav a {
  transition: color var(--duration-base) var(--ease-standard);
}

.header-logo {
  justify-self: center;
  display: block;
}

.header-logo-text {
  font-family: var(--font-display);
  font-size: 68px;
  color: var(--verde-bosque);
  letter-spacing: 0.02em;
  line-height: 1;
  display: block;
  text-align: center;
}

/* Header mobile: carrito y hamburguesa */
.header-cart {
  display: none;
  color: var(--verde-bosque);
  padding: 4px;
  transition: color var(--duration-base) var(--ease-standard);
}

.header-cart:hover {
  color: var(--marigold-70);
}

.header-cart svg {
  display: block;
}

.header-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--verde-bosque);
}

.header-hamburger svg {
  display: block;
}

.mobile-nav {
  display: none;
}

/* ========================================
   Barra de secciones (sub-nav)
   ======================================== */

.secciones-nav {
  background: #fdfbf6;
  border-bottom: 1px solid rgba(94, 103, 51, 0.12);
}

.secciones-nav-inner {
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: 12px 24px;
}

.secciones-nav a {
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  color: #7c864a;
  padding: 8px 18px;
  border-radius: 3px;
  transition: color var(--duration-base) var(--ease-standard),
              background-color var(--duration-base) var(--ease-standard);
}

.secciones-nav a:hover {
  color: #1e3a2b;
}

.secciones-nav a.is-active[data-seccion="alimentos"] {
  background: #1e402c;
  color: #f7f3e7;
}

.secciones-nav a.is-active[data-seccion="capacitaciones"] {
  background: #fab43c;
  color: #c1592e;
}

.secciones-nav a.is-active[data-seccion="universo-salvaje"] {
  background: #6b3a24;
  color: #f1e8e1;
}

/* ========================================
   Secciones hero
   ======================================== */

.hero-section {
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 640px;
}

.hero-content {
  padding: 96px 72px 96px 96px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 132px;
  line-height: 0.92;
  letter-spacing: 0.005em;
  margin: 0 0 32px 0;
  font-weight: 400;
}

.hero-description {
  font-family: var(--font-body);
  font-size: 22px;
  line-height: 1.4;
  max-width: 460px;
  margin: 0 0 44px 0;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  border-bottom: 1px solid currentColor;
  padding-bottom: 10px;
  transition: opacity var(--duration-base) var(--ease-standard);
}

.hero-link:hover {
  color: inherit;
  opacity: 0.7;
}

.hero-link-arrow {
  font-family: serif;
  font-size: 20px;
  line-height: 1;
}

.hero-image {
  position: relative;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* -- Alimentos -- */

.section-alimentos {
  background: var(--verde-bosque);
  color: var(--hueso);
}

.section-alimentos .hero-title {
  color: var(--hueso);
}

.section-alimentos .hero-description {
  color: var(--hueso);
  opacity: 0.92;
}

.section-alimentos .hero-link {
  color: var(--hueso);
}

.section-alimentos .hero-image {
  background: var(--hueso);
}

/* -- Capacitaciones -- */

.section-capacitaciones {
  background-color: var(--marigold);
  background-image: url("../img/capacitaciones-bg.jpg");
  background-position: right center;
  background-size: contain;
  background-repeat: no-repeat;
  color: var(--verde-bosque);
  min-height: 640px;
}

.capacitaciones-content {
  position: relative;
  z-index: 2;
  padding: 96px 72px 96px 96px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 56%;
  min-height: 640px;
}

.section-capacitaciones .hero-title {
  color: var(--verde-bosque);
}

.section-capacitaciones .hero-description {
  color: var(--verde-bosque);
  max-width: 480px;
}

.section-capacitaciones .hero-link {
  color: var(--verde-bosque);
}

.capacitaciones-image-mobile {
  display: none;
}

/* -- Universo Salvaje -- */

.section-universo {
  background: #294122;
  color: #efeae0;
}

.section-universo .hero-title {
  color: #efeae0;
}

.section-universo .hero-title-accent {
  display: block;
  color: #f5c518;
  font-style: italic;
}

.section-universo .hero-description {
  color: #efeae0;
  opacity: 0.92;
}

.section-universo .hero-link {
  color: #efeae0;
}

.section-universo .hero-image {
  background: var(--espresso);
}

/* ========================================
   Footer
   ======================================== */

.site-footer {
  background: #efeae0;
  padding: 44px 72px 32px;
  border-top: 1px solid rgba(94, 103, 51, 0.14);
}

.footer-main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 48px;
}

.footer-logo {
  height: 100px;
  width: auto;
}

.footer-center {
  text-align: center;
  line-height: 1.5;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--verde-bosque);
  letter-spacing: 0.02em;
}

.footer-location {
  font-size: 13px;
  color: var(--olive-70);
  margin-top: 2px;
}

.footer-instagram {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--verde-bosque);
  font-weight: 500;
}

.footer-instagram-icon {
  display: none;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(94, 103, 51, 0.14);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--olive-70);
}

/* ========================================
   Quiénes somos
   ======================================== */

.about-section {
  background: #efeae0;
  min-height: calc(100vh - 90px);
  display: flex;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
}

.about-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 72px 72px 72px 96px;
  max-width: 600px;
  margin: 0 auto 0 0;
}

.about-title {
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: 400;
  color: var(--verde-bosque);
  margin-bottom: 36px;
  line-height: 1;
}

.about-text {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
}

.about-text p {
  margin-bottom: 20px;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-image {
  position: relative;
  overflow: hidden;
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0 0 0 32px;
}

/* ========================================
   Responsive: Tablet (max 1024px)
   ======================================== */

@media (max-width: 1024px) {
  .header-inner {
    padding: 20px 32px;
    gap: 24px;
  }

  .header-nav {
    gap: 32px;
    font-size: 16px;
  }

  .header-logo-text {
    font-size: 52px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-content {
    padding: 64px 48px;
  }

  .hero-title {
    font-size: 80px;
  }

  .hero-image {
    min-height: 360px;
  }

  .section-capacitaciones {
    background-size: cover;
    background-position: center;
    min-height: auto;
  }

  .capacitaciones-content {
    max-width: 100%;
    padding: 64px 48px;
    min-height: auto;
    background: rgba(250, 180, 60, 0.88);
  }

  /* Barra secciones tablet */
  .secciones-nav-inner {
    gap: 16px;
  }

  .site-footer {
    padding: 32px 32px 24px;
  }

  .footer-main {
    gap: 24px;
  }

  /* Quiénes somos tablet */
  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-content {
    padding: 48px 48px;
    max-width: none;
  }

  .about-title {
    font-size: 56px;
  }

  .about-image {
    min-height: 400px;
  }

  .about-image img {
    border-radius: 0;
  }
}

/* ========================================
   Responsive: Mobile (max 768px)
   ======================================== */

@media (max-width: 768px) {
  /* Header mobile: logo + carrito + hamburguesa */
  .header-inner {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    gap: 0;
  }

  .header-logo {
    flex: 1;
    justify-self: auto;
  }

  .header-nav {
    display: none;
  }

  .header-cart {
    display: block;
    margin-right: 8px;
  }

  .header-hamburger {
    display: block;
  }

  .header-logo-text {
    font-size: 32px;
    text-align: left;
  }

  /* Menu mobile abierto */
  .mobile-nav.is-open {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: #efeae0;
    border-bottom: 1px solid rgba(94, 103, 51, 0.14);
  }

  .mobile-nav a {
    display: block;
    padding: 16px 20px;
    font-size: 18px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--verde-bosque);
    border-top: 1px solid rgba(94, 103, 51, 0.08);
  }

  /* Barra secciones mobile */
  .secciones-nav-inner {
    justify-content: flex-start;
    gap: 6px;
    padding: 10px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .secciones-nav-inner::-webkit-scrollbar {
    display: none;
  }

  .secciones-nav a {
    font-size: 12px;
    padding: 8px 14px;
    white-space: nowrap;
  }

  

  

  /* Hero sections mobile */
  .hero-content {
    padding: 48px 20px;
  }

  .hero-title {
    font-size: clamp(48px, 14vw, 80px);
    margin-bottom: 20px;
  }

  .hero-description {
    font-size: 18px;
    margin-bottom: 32px;
  }

  .hero-image {
    min-height: 280px;
  }

  /* Capacitaciones mobile: texto arriba, imagen abajo, todo en amarillo */
  .section-capacitaciones {
    background-image: none;
    min-height: auto;
  }

  .capacitaciones-content {
    max-width: 100%;
    padding: 48px 20px 32px;
    min-height: auto;
  }

  .capacitaciones-image-mobile {
    display: block;
    text-align: center;
    padding: 0 24px 24px;
  }

  .capacitaciones-image-mobile img {
    max-width: 280px;
    margin: 0 auto;
    opacity: 0.55;
  }

  /* Footer mobile */
  .site-footer {
    padding: 32px 20px 20px;
  }

  .footer-main {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 12px;
  }

  .footer-logo {
    margin: 0 auto;
    height: 220px;
  }

  .footer-center {
    display: none;
  }

  .footer-instagram {
    justify-self: center;
    font-size: 15px;
  }

  .footer-instagram-icon {
    display: inline-block;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 0;
    text-align: center;
    margin-top: 16px;
    padding-top: 12px;
  }

  .footer-url {
    display: none;
  }

  /* Quiénes somos mobile */
  .about-section {
    min-height: auto;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-image {
    order: -1;
    min-height: 320px;
  }

  .about-image img {
    border-radius: 0;
  }

  .about-content {
    padding: 40px 24px 48px;
    max-width: 100%;
  }

  .about-title {
    font-size: 44px;
    margin-bottom: 24px;
  }

  .about-text {
    font-size: 16px;
  }
}

/* ========================================
   Transiciones suaves entre páginas (View Transitions)
   Solo con movimiento permitido; sin soporte, se navega como siempre.
   ======================================== */

@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }

  /* Cabecera y pie con nombre propio: se mantienen fijos, sin fundido */
  .site-header {
    view-transition-name: cabecera;
  }

  .site-footer {
    view-transition-name: pie;
  }

  ::view-transition-old(cabecera),
  ::view-transition-new(cabecera),
  ::view-transition-old(pie),
  ::view-transition-new(pie) {
    animation: none;
    mix-blend-mode: normal;
  }

  ::view-transition-old(root) {
    animation: 140ms ease-out both transicion-salida;
  }

  ::view-transition-new(root) {
    animation: 200ms ease-in both transicion-entrada;
  }

  @keyframes transicion-salida {
    to { opacity: 0; }
  }

  @keyframes transicion-entrada {
    from { opacity: 0; }
  }
}
