/* ============================================================
   cuadro.kitchen — tienda pública de Cuadro Bites
   Dirección "Boutique": chocolate oscuro, dorado como acento,
   Bodoni Moda para títulos y Jost para el cuerpo. Mobile-first.
   ============================================================ */

:root {
  --bg: #2B1A12;
  --bg-deep: #22140E;
  --panel: #3A2418;
  --panel-high: #4A2F21;

  --ink: #F3EADA;
  --ink-80: rgba(243, 234, 218, 0.8);
  --ink-70: rgba(243, 234, 218, 0.7);
  --ink-55: rgba(243, 234, 218, 0.55);
  --ink-45: rgba(243, 234, 218, 0.45);
  --ink-30: rgba(243, 234, 218, 0.3);

  --gold: #C5A059;
  --gold-hover: #E0C27A;
  --gold-line: rgba(197, 160, 89, 0.22);
  --gold-line-strong: rgba(197, 160, 89, 0.55);

  --danger: #E08A7A;

  --font-serif: 'Bodoni Moda', 'Didot', 'Bodoni 72', Georgia, serif;
  --font-sans: 'Jost', 'Futura', 'Avenir Next', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius: 4px;
  --shadow-sheet: 0 -8px 40px rgba(0, 0, 0, 0.5);

  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --gutter: 22px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* El JS muestra/oculta con el atributo hidden: debe ganarle a cualquier display */
[hidden] { display: none !important; }

body {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--bg);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(100px + var(--safe-bottom)); /* espacio para la barra de pedido */
}

img { max-width: 100%; display: block; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hover); }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ---------- Tipografías de sistema ---------- */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow__line { height: 1px; width: 28px; background: var(--gold); flex-shrink: 0; }

.serif { font-family: var(--font-serif); font-weight: 400; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, var(--bg) 70%, rgba(43, 26, 18, 0));
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}

.brand { display: flex; flex-direction: column; line-height: 1; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand__name {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.brand__sub {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
}

.header-cart {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--gold-line-strong);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s;
}
.header-cart:hover { border-color: var(--gold); color: var(--gold-hover); }

.cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--gold);
  color: var(--bg);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Layout (móvil: columna; escritorio: hero fijo a la izquierda) ---------- */
.layout { display: flex; flex-direction: column; }

@media (min-width: 960px) {
  .layout {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 64px;
    align-items: start;
  }
  .hero {
    position: sticky;
    top: 92px;
  }
}

/* ---------- Hero: pieza de la semana ---------- */
.hero {
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero__figure {
  position: relative;
  height: 380px;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(180deg, var(--panel-high) 0%, var(--panel) 60%, var(--bg) 100%);
  box-shadow: inset 0 0 0 1px rgba(197, 160, 89, 0.25);
}

@media (min-width: 960px) {
  /* El hero queda fijo: la figura se acorta para que los botones no queden bajo la barra de pedido */
  .hero__figure { height: clamp(340px, calc(100vh - 400px), 520px); }
}

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

/* Velo inferior para que el nombre y el precio se lean sobre la foto */
.hero__figure::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(43, 26, 18, 0) 40%, rgba(43, 26, 18, 0.88) 100%);
  pointer-events: none;
}
.hero__figure--placeholder::after { display: none; }

.placeholder-mark {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink-45);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero__caption {
  position: absolute;
  z-index: 1;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.hero__name {
  font-family: var(--font-serif);
  font-size: 34px;
  line-height: 1;
  font-weight: 400;
  color: var(--ink);
  text-wrap: balance;
}

.hero__meta {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--ink-70);
}

.hero__price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
  flex-shrink: 0;
}
.hero__price strong {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 400;
  color: var(--gold);
}
.hero__price small { font-size: 11px; color: var(--ink-55); }

.hero__actions { display: flex; gap: 10px; }

.hero__intro {
  font-size: 14px;
  line-height: 1.7;
  font-weight: 300;
  color: rgba(243, 234, 218, 0.78);
  text-wrap: pretty;
}

/* ---------- Botones ---------- */
.btn {
  height: 50px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: wait; }

.btn--outline { flex: 1 1 0; border: 1px solid var(--gold); color: var(--gold); }
.btn--outline:hover { border-color: var(--gold-hover); color: var(--gold-hover); }

.btn--gold { flex: 1 1 0; background: var(--gold); color: var(--bg); font-weight: 600; }
.btn--gold:hover { background: var(--gold-hover); }

.btn--block { width: 100%; }

.icon-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-70);
}
.icon-btn:hover { color: var(--ink); }

/* ---------- La colección ---------- */
.content { display: flex; flex-direction: column; }

.collection { padding-top: 36px; }

.collection__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.collection__title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 400;
  font-style: italic;
}

.rate-badge {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-55);
  white-space: nowrap;
}

.catalog-status {
  padding: 40px 0;
  text-align: center;
  color: var(--ink-55);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.catalog-status .loader { margin: 0 auto 12px; }

.loader {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--gold-line);
  border-top-color: var(--gold);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.product-list { display: flex; flex-direction: column; gap: 22px; }

.product {
  display: flex;
  gap: 16px;
  align-items: center;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--gold-line);
}

.product__thumb {
  width: 96px;
  height: 120px;
  flex-shrink: 0;
  border-radius: 3px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--panel-high) 0%, var(--panel) 100%);
  box-shadow: inset 0 0 0 1px rgba(197, 160, 89, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(243, 234, 218, 0.4);
}
.product__thumb img { width: 100%; height: 100%; object-fit: cover; }

.product__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product__name {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.1;
}

.product__desc {
  font-size: 12px;
  font-weight: 300;
  line-height: 1.5;
  color: var(--ink-70);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.product__price { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.product__price strong { font-size: 17px; font-weight: 400; color: var(--gold); }
.product__price small { font-size: 10px; letter-spacing: 0.06em; color: var(--ink-55); }

.add-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid var(--gold);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.15s, color 0.15s, transform 0.1s;
}
.add-btn:hover { background: rgba(197, 160, 89, 0.12); }
.add-btn:active { transform: scale(0.96); }
.add-btn.is-in-cart { background: var(--gold); color: var(--bg); }

.list-empty {
  padding: 30px 0;
  color: var(--ink-55);
  font-size: 14px;
  text-align: center;
}

/* ---------- Por encargo ---------- */
.steps {
  padding: 40px 0 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.steps__list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.steps__list li { display: flex; flex-direction: column; gap: 6px; }

.steps__num {
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1;
  color: var(--gold);
}

.steps__list p {
  font-size: 12px;
  font-weight: 300;
  line-height: 1.4;
  color: var(--ink-80);
}

.site-footer__line {
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-45);
}
.site-footer__line a { color: var(--ink-45); }
.site-footer__line a:hover { color: var(--gold); }

.site-footer__tiny { font-size: 11px; color: var(--ink-30); letter-spacing: 0.04em; }

/* ---------- Barra de pedido ---------- */
.cart-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 14px var(--gutter) calc(22px + var(--safe-bottom));
  background: linear-gradient(180deg, rgba(43, 26, 18, 0) 0%, var(--bg) 45%);
  pointer-events: none;
}

.cart-bar__btn {
  pointer-events: auto;
  width: 100%;
  max-width: 1036px;
  margin: 0 auto;
  height: 56px;
  padding: 0 20px;
  background: var(--gold);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color 0.15s;
}
.cart-bar__btn:hover { background: var(--gold-hover); }

.cart-bar__label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.cart-bar__amounts {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
}
.cart-bar__amounts strong { font-family: var(--font-serif); font-size: 18px; font-weight: 400; }
.cart-bar__amounts small { font-size: 10px; letter-spacing: 0.06em; font-weight: 500; }

/* ---------- Overlay, drawer y sheet ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(20, 10, 6, 0.7);
  backdrop-filter: blur(2px);
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  width: min(420px, 100%);
  background: var(--bg-deep);
  border-left: 1px solid var(--gold-line);
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
  animation: slide-in 0.22s ease-out;
}
@keyframes slide-in { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

.cart-drawer__head,
.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px 18px 22px;
  border-bottom: 1px solid var(--gold-line);
}

.cart-drawer__head h3,
.sheet__head h3 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 400;
  font-style: italic;
}

.cart-drawer__items {
  flex: 1;
  overflow-y: auto;
  padding: 8px 22px;
}

.cart-empty {
  padding: 40px 0;
  text-align: center;
  color: var(--ink-55);
  font-size: 14px;
  line-height: 1.6;
}

.cart-item {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--gold-line);
}

.cart-item__photo {
  width: 56px;
  height: 70px;
  flex-shrink: 0;
  border-radius: 3px;
  object-fit: cover;
  background: linear-gradient(180deg, var(--panel-high), var(--panel));
  box-shadow: inset 0 0 0 1px rgba(197, 160, 89, 0.2);
}

.cart-item__info { flex: 1; min-width: 0; }
.cart-item__name { font-family: var(--font-serif); font-size: 18px; line-height: 1.15; }
.cart-item__mode { font-size: 11px; letter-spacing: 0.06em; color: var(--ink-55); margin-top: 3px; }
.cart-item__price { font-size: 15px; color: var(--gold); margin-top: 6px; }

.cart-item__controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.cart-item__qty {
  display: flex;
  align-items: center;
  border: 1px solid var(--gold-line-strong);
}
.cart-item__qty button {
  width: 34px;
  height: 34px;
  color: var(--gold);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cart-item__qty span { min-width: 28px; text-align: center; font-size: 14px; font-weight: 500; }

.cart-item__remove {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-45);
}
.cart-item__remove:hover { color: var(--danger); }

.cart-drawer__foot {
  padding: 16px 22px calc(20px + var(--safe-bottom));
  border-top: 1px solid var(--gold-line);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-55);
}
.cart-total-amounts { text-align: right; display: flex; flex-direction: column; line-height: 1.1; }
.cart-total-amounts strong { font-family: var(--font-serif); font-size: 28px; font-weight: 400; color: var(--gold); letter-spacing: 0; }
.cart-total-amounts small { font-size: 11px; letter-spacing: 0.06em; text-transform: none; }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  max-height: 92vh;
  background: var(--bg-deep);
  border-top: 1px solid var(--gold-line);
  box-shadow: var(--shadow-sheet);
  display: flex;
  flex-direction: column;
  animation: rise 0.22s ease-out;
}
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (min-width: 640px) {
  .sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    width: 480px;
    max-height: 90vh;
    transform: translate(-50%, -50%);
    animation: none;
  }
}

.sheet__body {
  overflow-y: auto;
  padding: 18px 22px calc(22px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field span {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.field input,
.field textarea {
  font-family: inherit;
  font-size: 16px;
  font-weight: 300;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--gold-line-strong);
  padding: 8px 0;
  outline: none;
  border-radius: 0;
  transition: border-color 0.15s;
  color-scheme: dark;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--ink-30); }
.field input:focus,
.field textarea:focus { border-bottom-color: var(--gold); }
.field textarea { resize: vertical; min-height: 56px; }

.checkout-summary {
  border: 1px solid var(--gold-line);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}
.checkout-summary .sum-row { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-80); }
.checkout-summary .sum-row small { color: var(--ink-55); }
.checkout-summary .sum-row--total {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--gold-line);
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--gold);
}
.checkout-summary .sum-row--bs { font-size: 11px; letter-spacing: 0.06em; color: var(--ink-55); }

.checkout-hint {
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-55);
  text-wrap: pretty;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 70;
  max-width: calc(100% - 44px);
  padding: 12px 18px;
  background: var(--ink);
  color: var(--bg);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  animation: rise 0.2s ease-out;
}
