/* FRUTOS SECOS La Gocha — estilos principales */
:root {
  --cream: #fdf8f0;
  --cream-dark: #f0e8dc;
  --brown: #4b3621;
  --brown-soft: #6b4f3a;
  --green: #2d4a3a;
  --green-light: #3d5a48;
  --beige: #c4a77d;
  --beige-soft: #e8dcc8;
  --white: #ffffff;
  --shadow: 0 8px 32px rgba(75, 54, 33, 0.08);
  --radius: 14px;
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --max: 1120px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--brown);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--green);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  padding: 0.75rem 1rem;
  background: var(--brown);
  color: var(--cream);
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* Carrusel hero (banners IA — FRUTOS SECOS La Gocha) */
.hero-carousel {
  position: relative;
  width: 100%;
  background: #1a2820;
}

.carousel-viewport {
  position: relative;
  max-width: 100%;
  margin: 0 auto;
  aspect-ratio: 21 / 9;
  min-height: 200px;
  max-height: min(52vh, 520px);
}

@media (max-width: 640px) {
  .carousel-viewport {
    aspect-ratio: 16 / 10;
    max-height: min(48vh, 380px);
  }
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.65s ease, visibility 0.65s ease;
  z-index: 0;
}

.carousel-slide.is-active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.carousel-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 1.75rem 1.25rem 2.5rem;
  background: linear-gradient(to top, rgba(30, 24, 18, 0.82) 0%, rgba(30, 24, 18, 0.35) 55%, transparent 100%);
  color: var(--white);
  text-align: center;
}

@media (min-width: 768px) {
  .carousel-caption {
    text-align: left;
    padding: 2rem 4.5rem 2.75rem;
    max-width: 70%;
  }
}

.carousel-title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 2.35rem);
  font-weight: 700;
  line-height: 1.15;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.carousel-sub {
  margin: 0 0 1rem;
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  opacity: 0.95;
  max-width: 36ch;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

@media (min-width: 768px) {
  .carousel-sub {
    margin-inline: 0;
  }
}

.carousel-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.15rem;
  background: var(--white);
  color: var(--green);
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.carousel-cta:hover {
  filter: brightness(1.06);
  text-decoration: none;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--brown);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  transition: background 0.2s ease, transform 0.2s ease;
}

.carousel-btn:hover {
  background: var(--white);
  transform: translateY(-50%) scale(1.05);
}

.carousel-btn:focus-visible {
  outline: 2px solid var(--beige);
  outline-offset: 2px;
}

.carousel-btn--prev {
  left: 0.5rem;
}

.carousel-btn--next {
  right: 0.5rem;
}

@media (max-width: 480px) {
  .carousel-btn {
    width: 38px;
    height: 38px;
  }

  .carousel-btn--prev {
    left: 0.25rem;
  }

  .carousel-btn--next {
    right: 0.25rem;
  }
}

.carousel-dots {
  position: absolute;
  left: 50%;
  bottom: 0.65rem;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 0.45rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.25);
}

.carousel-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.carousel-dot.is-active {
  background: var(--white);
  transform: scale(1.15);
}

.carousel-dot:focus-visible {
  outline: 2px solid var(--beige);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .carousel-slide {
    transition: none;
  }
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(253, 248, 240, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--beige-soft);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: inherit;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 50%;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text small {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brown-soft);
  font-weight: 600;
}

.brand-text span.name {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--brown);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--brown);
  border-radius: 1px;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav a {
  display: block;
  padding: 0.5rem 0.85rem;
  color: var(--brown);
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: 8px;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--beige-soft);
  text-decoration: none;
}

.btn-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.9rem;
  background: var(--green);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  margin-left: 0.35rem;
}

.btn-cart:hover {
  background: var(--green-light);
}

.btn-cart .badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  font-size: 0.7rem;
  line-height: 20px;
  text-align: center;
  background: var(--beige);
  color: var(--brown);
  border-radius: 999px;
  font-weight: 700;
}

.btn-cart .badge:empty,
.btn-cart .badge[data-count="0"] {
  display: none;
}

/* Carrito: barra superior en escritorio, menú móvil dentro del nav */
.btn-cart--nav {
  display: none;
}

@media (min-width: 881px) {
  .btn-cart--nav {
    display: none !important;
  }

  .btn-cart--header {
    display: inline-flex;
  }
}

@media (max-width: 880px) {
  .btn-cart--header {
    display: none !important;
  }

  .btn-cart--nav {
    display: inline-flex;
    width: 100%;
    justify-content: center;
    margin-top: 0.75rem;
  }
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-light) 45%, #1e3328 100%);
  color: var(--cream);
}

.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3.5rem 1.25rem 4rem;
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 768px) {
  .hero-inner {
    grid-template-columns: 1fr 1fr;
    padding: 4.5rem 1.25rem 5rem;
  }
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1.15;
}

.hero .tagline {
  margin: 0 0 1.5rem;
  font-size: 1.05rem;
  opacity: 0.95;
  max-width: 32ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.35rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}

.btn-primary {
  background: var(--beige);
  color: var(--brown);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  color: var(--cream);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.2);
}

.hero-card {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-card h2 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.hero-card dl {
  margin: 0;
  display: grid;
  gap: 0.65rem;
}

.hero-card dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.85;
}

.hero-card dd {
  margin: 0;
  font-size: 1rem;
}

.hero-card a {
  color: var(--cream);
  text-decoration: underline;
}

/* Sections */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3.5rem 1.25rem;
}

.section-header {
  margin-bottom: 2rem;
  text-align: center;
}

.section-header h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3vw, 2.35rem);
  color: var(--brown);
}

.section-header p {
  margin: 0;
  color: var(--brown-soft);
  max-width: 42ch;
  margin-inline: auto;
}

/* Products toolbar */
.products-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  align-items: center;
  justify-content: space-between;
}

.products-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.btn-pdf {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1rem;
  background: var(--brown);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  white-space: nowrap;
}

.btn-pdf:hover {
  filter: brightness(1.07);
}

.btn-pdf:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.btn-pdf:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
}

.search-wrap {
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}

.search-wrap label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.search-wrap input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  border: 1px solid var(--beige-soft);
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  background: var(--white);
  color: var(--brown);
}

.search-wrap {
  position: relative;
}

.search-wrap::before {
  content: "";
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  opacity: 0.45;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234b3621'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'/%3E%3C/svg%3E")
    center/contain no-repeat;
  pointer-events: none;
}

.product-count {
  font-size: 0.9rem;
  color: var(--brown-soft);
}

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.35rem;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--beige-soft);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(75, 54, 33, 0.12);
}

.product-card .thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--cream-dark);
}

.product-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card .body {
  padding: 1.1rem 1.15rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--brown);
  line-height: 1.3;
}

.product-meta {
  font-size: 0.85rem;
  color: var(--brown-soft);
  margin-bottom: 0.75rem;
}

.product-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 1rem;
  margin-top: auto;
}

.btn-add {
  width: 100%;
  padding: 0.65rem 1rem;
  background: var(--brown);
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-add:hover {
  background: var(--brown-soft);
}

/* Nosotros / Contacto */
.two-col {
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) {
  .two-col {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.info-card {
  background: var(--white);
  padding: 1.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--beige-soft);
  box-shadow: var(--shadow);
}

.info-card h3 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.45rem;
}

.info-card p {
  margin: 0 0 1rem;
  color: var(--brown-soft);
}

.info-card p:last-child {
  margin-bottom: 0;
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.contact-list li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.contact-list li:last-child {
  margin-bottom: 0;
}

.contact-list .icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--cream-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
}

.contact-list svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Footer */
.site-footer {
  background: var(--brown);
  color: var(--cream);
  padding: 2rem 1.25rem;
  margin-top: 2rem;
}

.site-footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--beige);
}

/* Cart drawer */
.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(45, 36, 28, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 200;
}

.cart-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(100%, 420px);
  height: 100%;
  background: var(--cream);
  z-index: 201;
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  display: flex;
  flex-direction: column;
}

.cart-drawer.is-open {
  transform: translateX(0);
}

.cart-drawer-header {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--beige-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cart-drawer-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--beige-soft);
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--brown);
}

.cart-lines {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

.cart-empty {
  text-align: center;
  color: var(--brown-soft);
  padding: 2rem 1rem;
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--beige-soft);
  align-items: center;
}

.cart-line-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.cart-line-meta {
  font-size: 0.8rem;
  color: var(--brown-soft);
}

.cart-line-price {
  font-weight: 600;
  color: var(--green);
  font-size: 0.95rem;
  text-align: right;
}

.qty-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.qty-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--beige-soft);
  background: var(--white);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--brown);
}

.qty-btn:hover {
  background: var(--cream-dark);
}

.qty-val {
  min-width: 2ch;
  text-align: center;
  font-weight: 600;
}

.btn-remove {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--brown-soft);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
}

.cart-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--beige-soft);
  background: var(--white);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
  font-size: 1.15rem;
}

.cart-total-row strong {
  font-size: 1.35rem;
  color: var(--green);
}

.btn-checkout {
  width: 100%;
  padding: 0.9rem 1rem;
  background: #25d366;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-checkout:hover {
  filter: brightness(1.05);
}

.btn-checkout:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: none;
}

/* Mobile nav */
@media (max-width: 880px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: min(100%, 300px);
    height: 100vh;
    background: var(--cream);
    z-index: 150;
    padding: 5rem 1.25rem 2rem;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.28s ease;
  }

  .site-nav.is-open {
    transform: translateX(0);
  }

  .site-nav ul {
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav .btn-cart {
    margin-left: 0;
    margin-top: 0.5rem;
    justify-content: center;
  }

  body.nav-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(45, 36, 28, 0.4);
    z-index: 140;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
