/* ══════════════════════════════════════════════
   CATÁLOGO DE MENÚ — estilos propios de esta página.
   Usa las variables y fuentes de assets/styles.css
   (cargado antes que este archivo).
   ══════════════════════════════════════════════ */

/* Espacio inicial para que el contenido no arranque debajo del nav fijo
   (el nav es transparente hasta que se hace scroll). No es sticky: solo
   ocupa sitio en la carga y luego se desplaza fuera de vista con normalidad. */
.catalog-nav-spacer {
  background: var(--navy-dark);
  height: clamp(5.5rem, 12vw, 7rem);
}

/* Aviso + filtros como una sola cabecera fija: se mantienen visibles
   mientras se hace scroll por el catálogo, igual que el aviso rojo en
   /menu/. (El aviso y la barra de filtros comparten este único contenedor
   sticky para no pisarse entre sí al quedar pegados al mismo tiempo.) */
.catalog-sticky-header {
  position: sticky;
  top: 68px;
  z-index: 40;
}
.catalog-sticky-header .order-banner {
  position: static;
  margin-bottom: 0;
}

.order-banner-row {
  background: var(--navy-dark);
  text-align: center;
  padding: 0.75rem clamp(1.5rem, 6vw, 6rem);
}

.catalog-toolbar {
  background: var(--cream-light);
  padding: 1.25rem clamp(1.5rem, 6vw, 6rem) 1rem;
  border-bottom: 1px solid rgba(17, 28, 51, 0.08);
}

.pill-row {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 0.25rem;
}
.pill-row::-webkit-scrollbar { display: none; }

.pill {
  flex: 0 0 auto;
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-mid);
  background: var(--white);
  border: 1px solid rgba(17, 28, 51, 0.12);
  padding: 0.55rem 1.25rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.pill:hover { border-color: rgba(17, 28, 51, 0.3); }
.pill.active {
  background: var(--navy-dark);
  border-color: var(--navy-dark);
  color: var(--white);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.tag-chip {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-mid);
  background: transparent;
  border: 1px solid rgba(17, 28, 51, 0.15);
  padding: 0.35rem 0.85rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s;
}
.tag-chip:hover { border-color: var(--red); color: var(--red); }
.tag-chip.active {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

.menu-catalog {
  background: var(--cream-light);
  padding: 2.5rem clamp(1.5rem, 6vw, 6rem) clamp(5rem, 10vw, 9rem);
}

.menu-catalog-section { margin-bottom: clamp(3rem, 6vw, 5rem); }
.menu-catalog-section:last-child { margin-bottom: 0; }

.menu-section-title {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--navy-dark);
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

.product-card {
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.6s ease, transform 0.6s ease;
  opacity: 0;
  transform: translateY(24px);
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(17, 28, 51, 0.12);
}

/* Fotos de producto: contenedor siempre 1:1, imagen recortada centrada.
   Especificación para las fotos que se suben a Airtable (campo Foto):
     - Formato: WebP
     - Relación de aspecto: cuadrada (1:1)
     - Resolución: 1000x1000 px
     - Peso objetivo: 80-150 KB por imagen (calidad ~75-80%)
   El script de sincronización no valida ni redimensiona nada — el CSS de
   abajo recorta al centro cualquier foto que no venga ya cuadrada. */
.product-card-photo {
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, var(--navy) 0%, #2A3F6A 100%);
  position: relative;
  overflow: hidden;
}
.product-card-photo::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent, transparent 15px,
    rgba(255, 255, 255, 0.02) 15px, rgba(255, 255, 255, 0.02) 16px
  );
}
.product-card-photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 1;
}
.photo-placeholder-icon {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
}
.photo-placeholder-icon svg {
  width: 32px; height: 32px;
  stroke: rgba(255, 255, 255, 0.35);
}
.product-modal-photo .photo-placeholder-icon svg { width: 44px; height: 44px; }

.product-card-body {
  padding: 1rem 1.1rem 1.15rem;
}
.product-card-name {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy-dark);
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
  line-height: 1.25;
}
.product-card-price {
  font-family: var(--font-head);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--red);
  letter-spacing: -0.01em;
}

.catalog-empty, .catalog-status {
  text-align: center;
  color: var(--text-mid);
  padding: 3rem 1rem;
  font-size: 1rem;
  grid-column: 1 / -1;
}

/* ─── MODAL ─── */
.product-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(17, 28, 51, 0.6);
  z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.product-modal-backdrop.open { opacity: 1; pointer-events: auto; }

.product-modal {
  background: var(--white);
  border-radius: 14px;
  max-width: 560px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(16px);
  transition: transform 0.25s ease;
}
.product-modal-backdrop.open .product-modal { transform: translateY(0); }

.product-modal-close {
  position: absolute; top: 1rem; right: 1rem; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(17, 28, 51, 0.55);
  color: var(--white);
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: background 0.2s;
}
.product-modal-close:hover { background: var(--navy-dark); }

.product-modal-photo {
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, var(--navy) 0%, #2A3F6A 100%);
  position: relative;
  overflow: hidden;
  border-radius: 14px 14px 0 0;
}
.product-modal-photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
}

.product-modal-body { padding: 1.75rem clamp(1.5rem, 4vw, 2.25rem) 2.25rem; }

.product-modal-eyebrow {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.6rem;
}
.product-modal-name {
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--navy-dark);
  letter-spacing: -0.02em;
  margin-bottom: 0.9rem;
  line-height: 1.1;
}
.product-modal-desc {
  font-size: 0.98rem;
  color: var(--text-mid);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}
.product-modal-ingredients {
  font-size: 0.9rem;
  color: var(--text-mid);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}
.product-modal-ingredients strong {
  color: var(--navy-dark);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.35rem;
}
.product-modal-tags {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.product-modal-tags .tag-chip { cursor: default; }
.product-modal-tags .tag-chip:hover { border-color: rgba(17, 28, 51, 0.15); color: var(--text-mid); }
.product-modal-price {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  color: var(--red);
  padding-top: 1.25rem;
  border-top: 1px solid rgba(17, 28, 51, 0.08);
}
/* Desglose de precios por tamaño: mismo peso visual que el precio único,
   una línea por tamaño (Pequeño → Mediano → Grande). */
.product-modal-price-line {
  display: block;
}
.product-modal-price-line + .product-modal-price-line {
  margin-top: 0.35rem;
}

body.modal-open { overflow: hidden; }

@media (max-width: 768px) {
  .catalog-toolbar { padding: 1rem 1.25rem 0.85rem; }
  .menu-catalog { padding-top: 2rem; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
  .product-card-name { font-size: 0.95rem; }
  .product-card-price { font-size: 1.15rem; }
}
