/* ============================================================
   Manuelina Pasta Fresca — Hoja de estilos
   Marca: azul profundo + dorado de pasta al huevo + crema cálida
   ============================================================ */

:root {
  /* Marca */
  --navy:        #33445f;
  --navy-deep:   #28374d;
  --navy-ink:    #1e2b3d;
  --gold:        #e0a43b;   /* dorado pasta al huevo */
  --gold-deep:   #c98c26;
  --cream:       #faf6ef;
  --paper:       #ffffff;
  --ink:         #253243;
  --muted:       #6d7887;
  --line:        #ece4d7;
  --line-soft:   #f2ece2;

  --ok:          #0f9d6f;
  --danger:      #d24545;

  --radius:      16px;
  --radius-sm:   11px;
  --shadow:      0 10px 30px -12px rgba(31,44,61,.28);
  --shadow-sm:   0 4px 14px -8px rgba(31,44,61,.30);

  --font:  'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --script:'Pacifico', cursive;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

.wordmark {
  font-family: var(--script);
  font-weight: 400;
  letter-spacing: .5px;
  line-height: 1;
}

/* ---------- Contenedores ---------- */
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 18px; }
.wrap-sm { max-width: 620px; margin: 0 auto; padding: 0 18px; }

/* ---------- Botones ---------- */
.btn {
  --b: var(--gold);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-weight: 800; font-size: 1rem;
  padding: 13px 20px; border-radius: 999px; border: none; cursor: pointer;
  background: var(--b); color: #3a2a06; text-decoration: none;
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease;
  box-shadow: 0 6px 16px -8px rgba(224,164,59,.7);
}
.btn:hover { background: var(--gold-deep); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.navy { --b: var(--navy); color: #fff; box-shadow: 0 6px 16px -8px rgba(51,68,95,.7); }
.btn.navy:hover { background: var(--navy-deep); }
.btn.ghost { background: transparent; color: var(--navy); box-shadow: none; border: 1.5px solid var(--line); }
.btn.ghost:hover { background: #fff; border-color: var(--navy); }
.btn.block { width: 100%; }
.btn.lg { padding: 15px 26px; font-size: 1.05rem; }
.btn.sm { padding: 8px 14px; font-size: .9rem; }

/* ---------- Header cliente ---------- */
.site-head {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #fff; position: relative; overflow: hidden;
}
.site-head::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 85% -20%, rgba(224,164,59,.22), transparent 55%);
  pointer-events: none;
}
.site-head .wrap { position: relative; z-index: 1; padding-top: 26px; padding-bottom: 30px; }
.head-top { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; flex-direction: column; }
.brand .wordmark { font-size: 2.5rem; color: #fff; }
.brand .sub {
  font-weight: 700; font-size: .82rem; letter-spacing: 2px;
  color: rgba(255,255,255,.72); text-transform: uppercase; margin-top: -2px;
}
.head-link { color: rgba(255,255,255,.85); text-decoration: none; font-weight: 700; font-size: .9rem; }
.head-link:hover { color: #fff; }

.hero-copy { margin-top: 22px; max-width: 560px; }
.hero-copy .pill {
  display: inline-block; background: rgba(255,255,255,.14); color: #fff;
  padding: 5px 13px; border-radius: 999px; font-weight: 800; font-size: .82rem;
  margin-bottom: 12px;
}
.hero-copy p { color: rgba(255,255,255,.9); font-size: 1.05rem; margin: 0; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 16px; }
.hero-meta span { color: rgba(255,255,255,.85); font-size: .9rem; font-weight: 700; }
.hero-meta strong { color: var(--gold); }

/* ---------- Layout de la tienda ---------- */
.shop { display: grid; grid-template-columns: 1fr 340px; gap: 26px; margin: 30px auto; align-items: start; }
@media (max-width: 900px) { .shop { grid-template-columns: 1fr; } }

.section-title { font-size: 1.4rem; font-weight: 800; color: var(--navy-ink); margin: 0 0 4px; }
.section-note { color: var(--muted); font-size: .95rem; margin: 0 0 18px; }

.cat-title {
  font-weight: 800; font-size: 1.05rem; color: var(--navy);
  margin: 26px 0 12px; display: flex; align-items: center; gap: 10px;
}
.cat-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Tarjetas de platos ---------- */
.dishes { display: grid; gap: 12px; }
.dish {
  display: grid; grid-template-columns: 60px 1fr auto; gap: 14px; align-items: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; transition: border-color .15s, box-shadow .15s;
}
.dish:hover { border-color: #dcd2c1; box-shadow: var(--shadow-sm); }
.dish .emoji {
  width: 56px; height: 56px; border-radius: 13px; display: grid; place-items: center;
  font-size: 1.7rem; background: linear-gradient(160deg,#fff6e6,#fdeccb);
}
.dish h4 { margin: 0 0 3px; font-size: 1.02rem; color: var(--navy-ink); font-weight: 800; }
.dish p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.35; }
.dish .right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.dish .price { font-weight: 800; color: var(--navy); font-size: 1.02rem; white-space: nowrap; }

.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.qty button {
  width: 32px; height: 32px; border: none; background: #fff; cursor: pointer;
  font-size: 1.2rem; font-weight: 800; color: var(--navy); line-height: 1;
}
.qty button:hover { background: var(--cream); }
.qty span { min-width: 26px; text-align: center; font-weight: 800; }
.add-btn {
  border: none; background: var(--navy); color: #fff; font-weight: 800; font-family: var(--font);
  padding: 8px 15px; border-radius: 999px; cursor: pointer; font-size: .9rem;
  transition: background .15s;
}
.add-btn:hover { background: var(--gold); color: #3a2a06; }

.empty-menu {
  background: var(--paper); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 40px 24px; text-align: center; color: var(--muted);
}
.empty-menu .big { font-size: 2.4rem; margin-bottom: 8px; }

/* ---------- Carrito ---------- */
.cart {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); position: sticky; top: 18px; overflow: hidden;
}
.cart-head { background: var(--navy); color: #fff; padding: 16px 18px; }
.cart-head h3 { margin: 0; font-size: 1.1rem; font-weight: 800; }
.cart-head small { color: rgba(255,255,255,.7); font-weight: 700; }
.cart-body { padding: 8px 18px; max-height: 340px; overflow-y: auto; }
.cart-item { display: flex; gap: 10px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.cart-item:last-child { border-bottom: none; }
.cart-item .ci-name { flex: 1; font-weight: 700; font-size: .92rem; color: var(--navy-ink); }
.cart-item .ci-name small { display: block; color: var(--muted); font-weight: 700; }
.cart-item .ci-remove { border: none; background: none; color: var(--danger); cursor: pointer; font-size: 1.1rem; padding: 0 4px; }
.cart-empty { text-align: center; color: var(--muted); padding: 30px 10px; font-weight: 700; }
.cart-empty .big { font-size: 2rem; margin-bottom: 6px; }
.cart-foot { padding: 16px 18px; border-top: 1px solid var(--line); }
.cart-line { display: flex; justify-content: space-between; font-weight: 700; color: var(--muted); margin-bottom: 6px; font-size: .95rem; }
.cart-total { display: flex; justify-content: space-between; font-weight: 800; color: var(--navy-ink); font-size: 1.2rem; margin: 10px 0 14px; }

/* ---------- Formularios ---------- */
.field { margin-bottom: 15px; }
.field label { display: block; font-weight: 800; font-size: .88rem; color: var(--navy-ink); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 1rem; color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(51,68,95,.12);
}
.field textarea { resize: vertical; min-height: 70px; }
.field .hint { color: var(--muted); font-size: .82rem; margin-top: 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } }

/* Selector segmentado */
.segment { display: grid; grid-auto-flow: column; gap: 8px; background: #f1ece3; padding: 5px; border-radius: 13px; }
.segment label { position: relative; cursor: pointer; margin: 0; }
.segment input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segment .seg-box {
  display: block; text-align: center; padding: 11px 8px; border-radius: 9px;
  font-weight: 800; font-size: .92rem; color: var(--muted); transition: all .15s;
}
.segment .seg-box small { display: block; font-weight: 700; font-size: .74rem; opacity: .8; }
.segment input:checked + .seg-box { background: #fff; color: var(--navy); box-shadow: var(--shadow-sm); }
.segment input:focus-visible + .seg-box { box-shadow: 0 0 0 3px rgba(51,68,95,.2); }

/* ---------- Cinta / avisos ---------- */
.notice {
  border-radius: var(--radius-sm); padding: 12px 15px; font-weight: 700; font-size: .92rem; margin-bottom: 14px;
}
.notice.info { background: #eef4ff; color: #274690; }
.notice.warn { background: #fff5e0; color: #915c00; }
.notice.ok   { background: #e6f7ee; color: #0b7a52; }
.notice.err  { background: #fdeaea; color: #b02a2a; }

.badge { display: inline-block; padding: 4px 11px; border-radius: 999px; font-weight: 800; font-size: .78rem; }

/* ---------- Pie ---------- */
.site-foot { background: var(--navy-deep); color: rgba(255,255,255,.75); margin-top: 40px; }
.site-foot .wrap { padding: 26px 18px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; }
.site-foot .wordmark { color: #fff; font-size: 1.5rem; }
.site-foot a { color: var(--gold); text-decoration: none; font-weight: 700; }

/* ---------- Modal ---------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(30,43,61,.55); display: none;
  align-items: center; justify-content: center; padding: 18px; z-index: 60;
}
.modal-bg.open { display: flex; }
.modal {
  background: #fff; border-radius: 20px; max-width: 480px; width: 100%; padding: 30px 26px;
  text-align: center; box-shadow: var(--shadow); animation: pop .25s ease;
}
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal .check { width: 68px; height: 68px; border-radius: 50%; background: #e6f7ee; color: var(--ok); display: grid; place-items: center; margin: 0 auto 14px; font-size: 2rem; }
.modal h3 { margin: 0 0 6px; font-size: 1.4rem; color: var(--navy-ink); }
.modal .code { font-weight: 800; font-size: 1.5rem; color: var(--navy); letter-spacing: 1px; margin: 10px 0; }
.modal p { color: var(--muted); margin: 6px 0; }

/* ---------- Toast ---------- */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--navy-ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 700;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 80; box-shadow: var(--shadow); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Barra flotante del carrito en móvil */
.cart-fab {
  display: none; position: fixed; left: 14px; right: 14px; bottom: 14px; z-index: 50;
  background: var(--navy); color: #fff; border: none; border-radius: 14px; padding: 14px 18px;
  font-family: var(--font); font-weight: 800; font-size: 1rem; align-items: center; justify-content: space-between;
  box-shadow: var(--shadow); cursor: pointer;
}
.cart-fab .fab-count { background: var(--gold); color: #3a2a06; border-radius: 999px; padding: 2px 10px; }
@media (max-width: 900px) {
  .cart-fab.show { display: flex; }
  .cart.mobile-hidden { display: none; }
}

/* ============================================================
   Adicionales (extras en el checkout)
   ============================================================ */
.addon-list { display: grid; gap: 8px; margin-top: 4px; }
.addon {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 9px 12px; background: #fff;
  transition: border-color .15s, background .15s;
}
.addon.on { border-color: var(--gold); background: #fffdf6; }
.addon-info { display: flex; flex-direction: column; line-height: 1.2; }
.addon-info span { font-weight: 800; color: var(--navy-ink); font-size: .95rem; }
.addon-info small { color: var(--muted); font-weight: 700; font-size: .82rem; }
.qty.small button { width: 34px; height: 34px; font-size: 1.15rem; }
.qty.small span { min-width: 24px; }

/* ============================================================
   Optimización móvil
   ============================================================ */
/* El modal siempre cabe y hace scroll en pantallas pequeñas */
.modal { max-height: 92vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* La barra flotante respeta el área segura de iPhone */
.cart-fab { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }

@media (max-width: 640px) {
  .wrap { padding: 0 14px; }
  .site-head .wrap { padding-top: 14px; padding-bottom: 18px; }
  .brand .wordmark { font-size: 2rem; }
  .hero-copy p { font-size: 1rem; }
  .hero-meta { flex-direction: column; gap: 4px; }
  .head-top { flex-wrap: wrap; gap: 8px; }

  .section-title { font-size: 1.25rem; }

  /* Tarjeta de plato más compacta y con botón cómodo para el dedo */
  .dish { grid-template-columns: 48px 1fr; gap: 12px; padding: 12px; }
  .dish .emoji { width: 46px; height: 46px; font-size: 1.4rem; }
  .dish .right { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
  .add-btn { padding: 10px 18px; font-size: .95rem; }

  /* Botones grandes = objetivos táctiles cómodos */
  .qty button { width: 40px; height: 40px; }
  .btn { padding: 13px 20px; }
  .btn.lg { padding: 15px 22px; }

  /* Modal a pantalla casi completa, alineado abajo */
  .modal-bg { padding: 0; align-items: flex-end; }
  .modal { border-radius: 20px 20px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); max-width: 100%; }

  .grid-2 { grid-template-columns: 1fr; }
  .site-foot .wrap { flex-direction: column; }
  .site-foot .wrap > div:last-child { text-align: left !important; }
}

/* Evita el zoom automático de iOS al enfocar campos (ya en 16px, reforzado) */
@media (max-width: 640px) {
  input, select, textarea { font-size: 16px; }
}
