/* =========================================================
   LA GRANJA DE ALEJO — hoja de estilos
   Paleta sacada directo del logo y de las listas de precio:
     --dark    #3D231D  texto / líneas del logo
     --cream   #FBF7EB  fondo sección Pollo
     --salmon  #F8ACA4  fondo sección Cerdo
     --maroon  #8B3534  fondo sección Res
     --olive   #70723A  acento hojas
     --gold    #F5BC64  acento trigo / nido
     --forest  #2E462E  techo del granero
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;700;800&family=Quicksand:wght@400;500;600;700&display=swap');

:root {
  --dark: #3D231D;
  --cream: #FBF7EB;
  --salmon: #F8ACA4;
  --maroon: #8B3534;
  --olive: #70723A;
  --gold: #F5BC64;
  --forest: #2E462E;

  --font-display: 'Baloo 2', sans-serif;
  --font-body: 'Quicksand', sans-serif;

  --radius: 18px;
  --shadow: 0 6px 20px rgba(61, 35, 29, 0.12);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--dark);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--cream);
  border-bottom: 2px solid rgba(61, 35, 29, 0.1);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  max-width: 1120px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand img {
  height: 52px;
  width: auto;
}

.brand-fallback {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--dark);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
}

.main-nav a {
  text-decoration: none;
  color: var(--dark);
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease;
}

.main-nav a:hover { border-color: var(--maroon); }

.main-nav .nav-huellitas {
  background: var(--forest);
  color: #fff;
  padding: 8px 16px;
  border-radius: 999px;
}
.main-nav .nav-huellitas:hover { border-color: transparent; opacity: 0.9; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--dark);
  cursor: pointer;
}

/* ---------- Hero ---------- */

.hero {
  padding: 56px 24px;
  background:
    radial-gradient(circle at 15% 20%, rgba(112,114,58,0.08), transparent 40%),
    radial-gradient(circle at 85% 15%, rgba(245,188,100,0.15), transparent 40%),
    var(--cream);
}

.hero__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero__content { text-align: left; }

.hero__logo-small {
  height: 64px;
  width: auto;
  margin-bottom: 22px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  margin: 0 0 14px;
  color: var(--dark);
}

.hero p.tagline,
.huellitas-hero p.tagline {
  font-size: 1.05rem;
  max-width: 460px;
  margin: 0 0 28px;
  color: rgba(61,35,29,0.85);
}

.hero .cta-row,
.huellitas-hero .cta-row {
  display: flex;
  justify-content: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}

.hero .cat-pills {
  justify-content: flex-start;
  margin-top: 24px;
}

.hero__photo {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--gold);
}

.hero__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero__photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: rgba(61,35,29,0.5);
  font-size: 0.9rem;
  text-align: center;
  padding: 24px;
  border: 2px dashed rgba(61,35,29,0.3);
  border-radius: 24px;
  background: var(--cream);
}
.hero__photo-placeholder svg { width: 44px; height: 44px; opacity: 0.6; }

@media (max-width: 860px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .hero__photo { order: -1; aspect-ratio: 4 / 3; }
  .hero__content { text-align: center; }
  .hero__logo-small { margin-left: auto; margin-right: auto; }
  .hero p.tagline,
  .huellitas-hero p.tagline { margin-left: auto; margin-right: auto; }
  .hero .cta-row, .hero .cat-pills,
  .huellitas-hero .cta-row { justify-content: center; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: 999px;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn--whatsapp {
  background: #25D366;
  color: #fff;
}
.btn--whatsapp:hover { box-shadow: 0 8px 18px rgba(37,211,102,0.35); }

.btn--outline {
  background: transparent;
  border-color: var(--dark);
  color: var(--dark);
}

/* ---------- Category quick nav (pills) ---------- */

.cat-pills {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.cat-pills a {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 999px;
  border: 2px solid var(--dark);
  color: var(--dark);
}
.cat-pills a:hover { background: var(--dark); color: var(--cream); }

/* ---------- Category sections ---------- */

.category {
  padding: 64px 24px;
}

.category--pollo  { background: var(--cream); }
.category--cerdo  { background: var(--salmon); }
.category--res    { background: var(--maroon); color: #fff; }

.category__header {
  max-width: 1120px;
  margin: 0 auto 32px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.category__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  margin: 0;
  letter-spacing: 0.5px;
}

.category--res .category__title { color: #fff; }

.category__legend {
  font-size: 0.85rem;
  opacity: 0.8;
}

/* ---------- Product grid & hang-tag cards ---------- */

.product-grid {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}

.tag-card {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--dark);
}

.tag-card__hole {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  background: inherit;
  border-radius: 50%;
  box-shadow: var(--shadow);
}
.tag-card__hole::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--cream);
}

.tag-card__image {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tag-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tag-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: rgba(61,35,29,0.45);
  font-size: 0.75rem;
  text-align: center;
  padding: 8px;
  border: 2px dashed rgba(61,35,29,0.25);
  border-radius: 12px;
}
.tag-card__placeholder svg { width: 28px; height: 28px; opacity: 0.6; }

.tag-card__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0;
  line-height: 1.25;
}

.tag-card__detail {
  font-size: 0.8rem;
  color: rgba(61,35,29,0.6);
  margin-top: -6px;
}

.tag-card__price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: auto;
}

.tag-card__price {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--maroon);
}

.tag-card__unit {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(61,35,29,0.55);
}

.tag-card__flag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--olive);
}

.tag-card__package-label {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  color: var(--brown, #4a2d24);
  font-size: 0.78rem;
  font-weight: 700;
}

.tag-card__package-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d8c8b7;
  border-radius: 999px;
  background: #fffaf3;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.tag-card__package-select:focus-visible {
  outline: 3px solid rgba(46, 83, 57, 0.22);
  outline-offset: 2px;
  border-color: #2e5339;
}

.tag-card__availability {
  width: 100%;
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.tag-card__availability--low {
  color: #7a3608;
  background: #fff0d6;
  border: 1px solid #efb25f;
}

.tag-card__availability--sold-out {
  color: #6d312e;
  background: #f7e5e2;
  border: 1px solid #d9a29a;
}

.qty-btn--add:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.tag-card__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #25D366;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 10px;
  border-radius: 999px;
  margin-top: 4px;
}
.tag-card__cta:hover { opacity: 0.92; }

.category__footnotes {
  max-width: 1120px;
  margin: 28px auto 0;
  font-size: 0.8rem;
  opacity: 0.75;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

/* ---------- Huellitas teaser band (on home page) ---------- */

.huellitas-teaser {
  background: var(--forest);
  color: #fff;
  padding: 56px 24px;
  text-align: center;
}
.huellitas-teaser h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  margin: 0 0 10px;
}
.huellitas-teaser p {
  max-width: 520px;
  margin: 0 auto 22px;
  opacity: 0.9;
}
.huellitas-teaser .btn--outline {
  border-color: #fff;
  color: #fff;
}
.huellitas-teaser .btn--outline:hover { background: #fff; color: var(--forest); }

/* ---------- Huellitas page hero ---------- */

.huellitas-hero {
  background: linear-gradient(180deg, var(--gold) 0%, var(--cream) 100%);
  padding: 56px 24px;
}
.huellitas-hero .eyebrow {
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--forest);
  margin-bottom: 8px;
}
.huellitas-hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  margin: 0 0 14px;
  color: var(--dark);
}
.huellitas-hero .cta-row { margin-top: 4px; }

.coming-soon {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 24px;
  text-align: center;
}
.coming-soon .placeholder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  margin: 28px 0;
}
.coming-soon .placeholder-box {
  aspect-ratio: 1;
  border: 2px dashed rgba(61,35,29,0.25);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(61,35,29,0.4);
  font-size: 0.75rem;
  background: rgba(112,114,58,0.06);
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--dark);
  color: var(--cream);
  padding: 44px 24px 28px;
  text-align: center;
}
.site-footer .footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 8px;
}
.site-footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin: 14px 0 20px;
  font-size: 0.9rem;
}
.site-footer .footer-links a { text-decoration: none; opacity: 0.85; }
.site-footer .footer-links a:hover { opacity: 1; }
.site-footer .footer-note {
  font-size: 0.78rem;
  opacity: 0.6;
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--cream);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 24px 24px;
    border-bottom: 2px solid rgba(61,35,29,0.1);
    display: none;
    gap: 14px;
  }
  .main-nav.is-open { display: flex; }
  .nav-toggle { display: block; }
  .site-header__inner { position: relative; }
}

/* ---------- Accessibility ---------- */

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--forest);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .tag-card__cta { transition: none; }
}

/* =========================================================
   CARRITO DE PEDIDOS
   ========================================================= */

[hidden] { display: none !important; }

/* ---------- Contador de cantidad dentro de cada tarjeta ---------- */

.tag-card__qty { margin-top: 4px; }

.qty-btn--add {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--forest);
  color: #fff;
  border: none;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.qty-btn--add:hover { opacity: 0.9; }

.qty-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--cream);
  border: 2px solid var(--forest);
  border-radius: 999px;
  padding: 4px;
}

.qty-stepper__btn {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  border: none;
  background: var(--forest);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qty-stepper__btn:hover { opacity: 0.88; }

.qty-stepper__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  min-width: 78px;
  text-align: center;
  color: var(--dark);
  white-space: nowrap;
}

/* ---------- Barra flotante ---------- */

.cart-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 18px;
  display: flex;
  justify-content: center;
  z-index: 80;
  padding: 0 16px;
  pointer-events: none;
}

.cart-bar__summary {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--dark);
  color: #fff;
  border: none;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 14px 26px;
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(61,35,29,0.35);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.cart-bar__summary:hover { transform: translateY(-2px); }

body.has-cart-bar { padding-bottom: 84px; }

@media (max-width: 720px) {
  .cart-bar {
    left: auto;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    padding: 0;
    justify-content: flex-end;
  }
  .cart-bar__summary {
    min-height: 50px;
    gap: 7px;
    padding: 11px 16px;
    font-size: 0.88rem;
    box-shadow: 0 8px 22px rgba(61,35,29,0.32);
  }
  #cart-bar-label { display: none; }
  .cart-bar__action { font-size: 0; }
  .cart-bar__action::after { content: "Ver pedido"; font-size: 0.88rem; }
  body.has-cart-bar { padding-bottom: 76px; }
}

/* ---------- Panel / resumen del pedido ---------- */

.cart-panel {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.cart-panel__overlay {
  position: absolute;
  inset: 0;
  background: rgba(61,35,29,0.45);
}

.cart-panel__sheet {
  position: relative;
  background: #fff;
  width: 100%;
  max-width: 480px;
  max-height: 86vh;
  border-radius: 24px 24px 0 0;
  padding: 20px 20px 24px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 -10px 30px rgba(61,35,29,0.25);
}

@media (min-width: 640px) {
  .cart-panel { align-items: center; }
  .cart-panel__sheet { border-radius: 24px; max-height: 80vh; }
}

.cart-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cart-panel__header h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  margin: 0;
  color: var(--dark);
}
.cart-panel__close {
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--dark);
  cursor: pointer;
  padding: 4px 8px;
}

.cart-panel__items {
  overflow: visible;
  flex: 0 0 auto;
  min-height: min-content;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 2px;
}

.cart-panel__empty {
  color: rgba(61,35,29,0.6);
  font-size: 0.9rem;
  text-align: center;
  padding: 24px 8px;
}

.cart-panel__item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(61,35,29,0.1);
}

.cart-panel__item-image {
  width: 64px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 13px;
  border: 1px solid rgba(61,35,29,0.1);
  background: #f1e7d8;
}

.cart-panel__item-image--empty {
  background: linear-gradient(135deg, #f5ecdf, #e8d7c3);
}

.cart-panel__item-info { min-width: 0; }

.cart-panel__item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.cart-panel__item-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--dark);
}
.cart-panel__item-sub {
  font-size: 0.78rem;
  color: rgba(61,35,29,0.55);
}

.cart-panel__footer {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 2px solid rgba(61,35,29,0.1);
}

.cart-panel__note {
  font-size: 0.8rem;
  color: rgba(61,35,29,0.65);
  margin: 0 0 14px;
}

.cart-panel__name-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--dark);
}
.cart-panel__name-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 2px solid rgba(61,35,29,0.15);
  font-family: var(--font-body);
  font-size: 0.9rem;
  margin-bottom: 14px;
  box-sizing: border-box;
}
.cart-panel__name-input:focus-visible {
  outline: 3px solid var(--forest);
  outline-offset: 1px;
}

.cart-panel__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.cart-panel__actions .btn { flex: 1; justify-content: center; text-align: center; }
#cart-panel-send[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
}

.cart-panel__estimate{display:grid;gap:4px;margin:0 20px;padding:14px 16px;border:1px solid #d8c9b6;border-radius:14px;background:#f5efe4;color:#472b24}.cart-panel__estimate strong{font-size:1.05rem}.cart-panel__estimate span,.cart-panel__estimate small{color:#796a61}.cart-panel__form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.cart-panel__form-grid label{display:grid;gap:6px;color:#5f5148;font-size:.84rem;font-weight:700}.cart-panel__form-wide{grid-column:1/-1}.cart-panel__name-input{width:100%}.cart-panel__name-input[type="date"]{min-height:46px}.cart-panel__name-input textarea,textarea.cart-panel__name-input{resize:vertical}.order-success{position:fixed;inset:0;z-index:180;display:grid;place-items:center;padding:20px}.order-success[hidden]{display:none}.order-success__overlay{position:absolute;inset:0;background:rgba(36,25,21,.68)}.order-success__card{position:relative;width:min(470px,100%);padding:34px;border-radius:24px;background:#fffaf2;box-shadow:0 24px 80px rgba(0,0,0,.28);text-align:center}.order-success__check{display:grid;place-items:center;width:58px;height:58px;margin:0 auto 16px;border-radius:50%;background:#294d2f;color:#fff;font-size:2rem;font-weight:900}.order-success__card h2{margin:0 0 10px;color:#472b24}.order-success__card p{color:#6f625a;line-height:1.55}.order-success__card .btn{display:flex;justify-content:center;margin-top:12px;width:100%}

@media(max-width:600px){.cart-panel__form-grid{grid-template-columns:1fr}.cart-panel__form-wide{grid-column:auto}.cart-panel__estimate{margin-inline:14px}}
@media(max-width:600px){
  .cart-panel__sheet{max-height:calc(100dvh - 72px);padding:18px 18px 28px}
  .cart-panel__header{position:sticky;top:-18px;z-index:3;margin-inline:-18px;padding:18px;background:#fff;border-bottom:1px solid rgba(61,35,29,.09)}
  .cart-panel__items{gap:0;margin-top:4px}
  .cart-panel__item{grid-template-columns:58px minmax(0,1fr);gap:10px 12px;padding:15px 0}
  .cart-panel__item-image{width:58px;border-radius:12px;grid-row:1 / span 2;align-self:start}
  .qty-stepper--panel{grid-column:2;width:100%;max-width:270px}
  .qty-stepper--panel .qty-stepper__value{flex:1}
  .cart-panel__estimate{order:initial;margin:8px 0 0}
  .cart-panel__footer{margin-top:16px}
}
