/* ═══════════════════════════════════════════════════════════
   TRATTORIA DE SEMA — Estilos
   Para cambiar colores, tipografías o espaciados, edita
   únicamente la sección :root de abajo.
   ═══════════════════════════════════════════════════════════ */

/* ── TOKENS DE DISEÑO (editar aquí para cambiar colores) ─── */
:root {
  --rojo:     #C0392B;
  --rojo-dk:  #922B21;
  --rojo-lt:  #E74C3C;
  --crema:    #FBF7F0;
  --crema-dk: #F0E8D8;
  --carbon:   #1A1612;
  --sepia:    #5C4A32;
  --gold:     #A0760A;
  --verde:    #2E7D32;
  --r:        10px;
  --sh:       0 2px 16px rgba(26,22,18,.08);
  --sh-h:     0 8px 32px rgba(192,57,43,.16);
}

/* ── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { scroll-behavior: smooth; }
body  { font-family: 'DM Sans', sans-serif; background: var(--crema); color: var(--carbon); overflow-x: hidden; }
img   { max-width: 100%; display: block; }
a     { text-decoration: none; color: inherit; }

/* ── HEADER ─────────────────────────────────────────────────── */
.hdr { background: var(--rojo); color: #fff; position: relative; overflow: hidden; }
.hdr::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23fff' fill-opacity='0.05'%3E%3Cpath d='M20 20.5V18H0v5h20v-2.5zM15 0H0v5h15V0zm5 0h20v5H20V0zm20 18H20v5h20v-5z'/%3E%3C/g%3E%3C/svg%3E");
}
.hdr-in {
  max-width: 1100px; margin: 0 auto; padding: 1.8rem 1.5rem;
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 1.5rem; position: relative; z-index: 1;
}
.hdr-logo {
  width: 84px; height: 84px; border-radius: 50%;
  background: #fff; border: 4px solid rgba(255,255,255,.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; flex-shrink: 0;
}
.hdr-txt h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 700; line-height: 1.05;
}
.hdr-txt p {
  font-size: .82rem; opacity: .85; margin-top: .3rem;
  text-transform: uppercase; letter-spacing: .1em; font-weight: 500;
}
.hdr-info {
  text-align: right;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--r); padding: .85rem 1.1rem;
  font-size: .8rem; line-height: 1.75; flex-shrink: 0;
}
.hdr-info strong { display: block; font-size: .95rem; margin-bottom: .1rem; }

/* ── NAV CATEGORÍAS ─────────────────────────────────────────── */
.cat-nav {
  position: sticky; top: 0; z-index: 80; background: #fff;
  border-bottom: 2px solid var(--crema-dk);
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.cat-nav-in {
  max-width: 1100px; margin: 0 auto;
  display: flex; overflow-x: auto; scrollbar-width: none;
}
.cat-nav-in::-webkit-scrollbar { display: none; }
.cat-a {
  display: flex; flex-direction: column; align-items: center; gap: .18rem;
  padding: .72rem 1.3rem;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--sepia); white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: color .2s, border-color .2s; cursor: pointer;
}
.cat-a .ico { font-size: 1.2rem; }
.cat-a:hover,
.cat-a.on   { color: var(--rojo); border-bottom-color: var(--rojo); }

/* ── MAIN ───────────────────────────────────────────────────── */
main { max-width: 1100px; margin: 0 auto; padding: 0 1.2rem 6rem; }

/* ── SECCIÓN ────────────────────────────────────────────────── */
.sec { padding-top: 3rem; }
.sec-hdr {
  display: flex; align-items: center; gap: .9rem;
  margin-bottom: 1.8rem; padding-bottom: .9rem;
  border-bottom: 2px solid var(--crema-dk);
  position: relative;
}
.sec-hdr::after {
  content: ''; position: absolute; bottom: -2px; left: 0;
  width: 60px; height: 2px; background: var(--rojo);
}
.sec-ico { font-size: 1.55rem; }
.sec-hdr h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.5rem, 3.5vw, 2rem); font-weight: 700;
}

/* ── GRID DE PLATOS ─────────────────────────────────────────── */
.grid     { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.3rem; }
.grid.beb { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* ── TARJETA ────────────────────────────────────────────────── */
.card {
  background: #fff; border-radius: var(--r); overflow: hidden;
  box-shadow: var(--sh); transition: transform .25s, box-shadow .25s;
  display: flex; flex-direction: column; position: relative;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--sh-h); }

.card-img {
  position: relative; aspect-ratio: 4/3; overflow: hidden;
  background: var(--crema-dk);
  display: flex; align-items: center; justify-content: center;
  font-size: 3.8rem;
}
.card-img img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; transition: transform .4s;
}
.card:hover .card-img img { transform: scale(1.04); }

/* Emoji que aparece cuando el plato aún no tiene foto real */
.emoji-ph {
  font-size: 3.8rem;
  user-select: none;
  transition: transform .3s;
}
.card:hover .emoji-ph { transform: scale(1.08); }

/* Badges (estado del plato) */
.badge {
  position: absolute; top: .7rem; right: .7rem;
  font-size: .62rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; padding: .22rem .75rem;
  border-radius: 20px; color: #fff; z-index: 2;
}
.b-clas { background: var(--rojo-dk); }   /* Clásica */
.b-pop  { background: #D35400; }          /* Popular */
.b-new  { background: var(--verde); }     /* Nueva   */
.b-esp  { background: #7D3C98; }          /* Especial*/

/* Etiquetas dietéticas */
.dtags { position: absolute; bottom: .6rem; left: .6rem; display: flex; gap: .3rem; flex-wrap: wrap; z-index: 2; }
.dt    { font-size: .68rem; padding: .15rem .5rem; border-radius: 20px; font-weight: 600; backdrop-filter: blur(6px); }
.dt-v  { background: rgba(46,125,50,.88);  color: #fff; }   /* 🌱 Vegetariano */
.dt-p  { background: rgba(192,57,43,.88); color: #fff; }   /* 🌶 Picante     */

/* Cuerpo de la tarjeta */
.cbody  { padding: 1rem 1.1rem 1.2rem; flex: 1; display: flex; flex-direction: column; }
.ctop   { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; margin-bottom: .4rem; }
.cnom   { font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 700; line-height: 1.2; flex: 1; }
.cpx    { font-family: 'Cormorant Garamond', serif; font-size: 1.2rem; font-weight: 700; color: var(--gold); white-space: nowrap; }
.cdesc  { font-size: .82rem; color: var(--sepia); line-height: 1.65; flex: 1; margin-bottom: .9rem; }

.btn-add {
  width: 100%; padding: .62rem;
  border: 2px solid var(--rojo); border-radius: 6px;
  background: transparent; color: var(--rojo);
  font-size: .82rem; font-weight: 700; cursor: pointer;
  transition: background .18s, color .18s, transform .15s;
  display: flex; align-items: center; justify-content: center; gap: .4rem;
}
.btn-add:hover,
.btn-add.done { background: var(--rojo); color: #fff; }

/* Tarjeta de bebida (layout horizontal) */
.card.bev               { flex-direction: row; align-items: stretch; }
.card.bev .card-img     { width: 90px; min-height: 90px; aspect-ratio: unset; flex-shrink: 0; border-radius: var(--r) 0 0 var(--r); font-size: 2.8rem; }
.card.bev .cbody        { padding: .8rem 1rem; }
.card.bev .btn-add      { padding: .45rem; }

/* ── CARRITO FLOTANTE ───────────────────────────────────────── */
.cfloat     { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 200; display: none; }
.cfloat.vis { display: block; }
.cbtn {
  width: 62px; height: 62px; border-radius: 50%;
  background: #25D366; color: #fff; border: none; cursor: pointer;
  font-size: 1.5rem; box-shadow: 0 4px 20px rgba(0,0,0,.25);
  position: relative; display: flex; align-items: center; justify-content: center;
  transition: transform .2s;
}
.cbtn:hover { transform: scale(1.07); }
.cnt {
  position: absolute; top: -4px; right: -4px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--rojo); color: #fff;
  font-size: .68rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ── PANEL CARRITO ──────────────────────────────────────────── */
.cpanel      { position: fixed; inset: 0; z-index: 300; display: none; }
.cpanel.open { display: flex; }
.cov  { position: absolute; inset: 0; background: rgba(26,22,18,.55); }
.cdrw {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: min(400px, 100%); background: #fff;
  display: flex; flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,.2);
}
.cdrw-hdr {
  background: var(--rojo); color: #fff; padding: 1.2rem 1.4rem;
  display: flex; align-items: center; justify-content: space-between;
}
.cdrw-hdr h3 { font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; }
.cclose { background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; line-height: 1; }

.citems { flex: 1; overflow-y: auto; padding: 1rem 1.2rem; }
.cempty { text-align: center; padding: 3rem 1rem; color: var(--sepia); font-size: .9rem; }
.cempty span { font-size: 2.5rem; display: block; margin-bottom: .7rem; }

.ci       { display: flex; align-items: flex-start; gap: .9rem; padding: .85rem 0; border-bottom: 1px solid var(--crema-dk); }
.ci-nom   { font-size: .88rem; font-weight: 600; flex: 1; }
.ci-px    { font-family: 'Cormorant Garamond', serif; font-size: 1rem; color: var(--gold); font-weight: 700; white-space: nowrap; }
.ci-qty   { display: flex; align-items: center; gap: .5rem; margin-top: .35rem; }
.qb {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.5px solid var(--crema-dk); background: var(--crema);
  cursor: pointer; font-size: .9rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.qb:hover { background: var(--crema-dk); }
.qn { font-weight: 700; font-size: .9rem; min-width: 18px; text-align: center; }

.cfoot { padding: 1.2rem 1.4rem; border-top: 2px solid var(--crema-dk); }
.ctrow { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1rem; }
.ctlbl { font-size: .82rem; color: var(--sepia); text-transform: uppercase; letter-spacing: .05em; }
.ctval { font-family: 'Cormorant Garamond', serif; font-size: 1.75rem; font-weight: 700; color: var(--gold); }

.btn-wa {
  display: block; width: 100%; padding: 1rem; border-radius: var(--r);
  background: #25D366; color: #fff; font-size: 1rem; font-weight: 700;
  border: none; cursor: pointer; text-align: center;
  transition: background .2s, transform .15s;
}
.btn-wa:hover { background: #1ebe5a; transform: translateY(-1px); }

/* ── FOOTER ─────────────────────────────────────────────────── */
footer        { background: var(--carbon); color: rgba(255,255,255,.75); padding: 2.2rem 1.5rem; text-align: center; }
footer strong { font-family: 'Cormorant Garamond', serif; font-size: 1.3rem; color: #fff; display: block; margin-bottom: .4rem; }
footer p      { font-size: .84rem; line-height: 1.75; }
footer a      { color: var(--rojo-lt); }

/* ── TOAST ──────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 5.5rem; right: 1.5rem; z-index: 250;
  background: var(--carbon); color: #fff;
  padding: .7rem 1.2rem; border-radius: var(--r);
  font-size: .84rem; font-weight: 600;
  opacity: 0; transform: translateY(10px);
  transition: opacity .3s, transform .3s;
  pointer-events: none; border-left: 4px solid #25D366;
}
.toast.on { opacity: 1; transform: translateY(0); }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 740px) {
  .hdr-in               { grid-template-columns: auto 1fr; }
  .hdr-info             { grid-column: 1 / -1; text-align: left; }
  .hdr-logo             { width: 66px; height: 66px; }
  .grid                 { grid-template-columns: repeat(2, 1fr); }
  .grid.beb             { grid-template-columns: 1fr; }
}
@media (max-width: 500px) {
  .grid                 { grid-template-columns: 1fr; }
  .hdr-txt h1           { font-size: 1.7rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
