/* MEME — Concept Coffee Store.
   Branding: monocromo, gris claro del logo, tipografía Didone + Montserrat liviana. */
:root {
  --bg: #e4e4e4;        /* gris del avatar de IG */
  --paper: #f5f5f3;
  --white: #ffffff;
  --ink: #111111;
  --muted: #6b6b6b;
  --line: #11111126;
  --matcha: #9bb17a;
  --serif: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --sans: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --pad: clamp(16px, 5vw, 72px);
  --radius: 2px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(64px + env(safe-area-inset-top, 0px)); overflow-x: clip; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 300 16px/1.65 var(--sans);
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
ul { list-style: none; }

.eyebrow { font-size: 11px; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); font-weight: 400; }
.h2 { font: 400 clamp(28px, 4vw, 44px)/1.1 var(--sans); text-transform: uppercase; letter-spacing: .12em; margin-bottom: 20px; }
.h3 { font: 500 13px/1.3 var(--sans); text-transform: uppercase; letter-spacing: .2em; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.link { font-size: 13px; letter-spacing: .08em; text-decoration: none; border-bottom: 1px solid var(--ink); padding-bottom: 2px; }

.btn {
  display: inline-block; padding: 14px 26px; border: 1px solid var(--ink);
  background: var(--ink); color: var(--white); text-decoration: none;
  font: 500 11px/1 var(--sans); letter-spacing: .24em; text-transform: uppercase;
  transition: background .25s, color .25s;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--white); }
.btn--sm { padding: 10px 18px; }

/* ---------- Nav ---------- */
/* Barra fija con altura constante: no cambia de tamaño al scrollear (evita el salto en mobile) */
:root { --nav-h: 60px; --safe-top: env(safe-area-inset-top, 0px); }
html { background: var(--bg); }
body { padding-top: calc(var(--nav-h) + var(--safe-top)); }
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: calc(var(--nav-h) + var(--safe-top));
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--safe-top) var(--pad) 0;
  background: var(--bg);
  border-bottom: 1px solid transparent; transition: border-color .3s;
}
.nav.is-scrolled { border-color: var(--line); }
/* Relleno por encima de la barra: tapa el hueco que deja Safari (iOS) al achicar la barra de direcciones o al "rebotar" */
.nav::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 100vh; background: var(--bg); pointer-events: none; }
.nav__logo img { height: 22px; width: auto; }
.nav__links { display: flex; gap: 32px; align-items: center; }
.nav__links a { text-decoration: none; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; font-weight: 400; position: relative; }
.nav__links a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -4px; height: 1px; background: var(--ink); transition: right .3s; }
.nav__links a:hover::after { right: 0; }
.nav__ig { text-transform: none !important; letter-spacing: .08em !important; }
.nav__toggle { display: none; background: none; border: 0; width: 32px; height: 32px; cursor: pointer; position: relative; }
.nav__toggle span { position: absolute; left: 4px; right: 4px; height: 1px; background: var(--ink); transition: transform .3s; }
.nav__toggle span:first-child { top: 12px; } .nav__toggle span:last-child { top: 20px; }
.nav__toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  min-height: min(calc(100svh - var(--nav-h)), 820px);
  display: grid; grid-template-columns: 1fr 1.1fr; align-items: center; gap: 40px;
  padding: 40px var(--pad) 60px;
}
.hero__logo img { width: min(520px, 100%); height: auto; margin: 22px 0 18px; }
.hero__tag { font: 400 clamp(20px, 2.4vw, 28px)/1.2 var(--serif); font-style: italic; }
.hero__bio { margin-top: 6px; font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.hero__cta { display: flex; gap: 12px; margin-top: 36px; flex-wrap: wrap; }
.hero__art { position: relative; }
.hero__art img { width: 100%; height: auto; }
.hero__art figcaption { position: absolute; right: 0; bottom: -28px; font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }

/* ---------- Marquee ---------- */
.marquee { border-block: 1px solid var(--ink); overflow: hidden; background: var(--ink); color: var(--bg); }
.marquee__track { display: flex; width: max-content; padding: 14px 0; animation: scroll var(--marquee-dur, 40s) linear infinite; will-change: transform; }
/* Cada grupo termina con el mismo espacio que hay entre palabras: así el empalme entre copias es invisible */
.marquee__group { display: flex; flex-shrink: 0; gap: 32px; padding-right: 32px; }
.marquee span { font: 400 13px/1 var(--sans); letter-spacing: .3em; text-transform: uppercase; white-space: nowrap; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 10vw, 128px) var(--pad); }
.section__head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; margin-bottom: 36px; }
.section__head .h2 { margin: 0; }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Nuestro café ---------- */
.coffee { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); align-items: center; background: var(--paper); }
.coffee__img img { width: 100%; aspect-ratio: 4/5; object-fit: cover; filter: grayscale(.25) contrast(1.05); }
.coffee__body p { margin-bottom: 14px; max-width: 52ch; }
.sheet { margin-top: 32px; border-top: 1px solid var(--ink); }
.sheet div { display: flex; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.sheet dt { font-weight: 500; }
.sheet dd { text-align: right; color: var(--muted); }

/* ---------- Menú ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 36px; padding-bottom: 4px; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; background: transparent; border: 1px solid var(--line); color: var(--ink);
  padding: 11px 18px; cursor: pointer; font: 400 11px/1 var(--sans); letter-spacing: .2em; text-transform: uppercase;
  transition: all .2s;
}
.tab:hover { border-color: var(--ink); }
.tab[aria-selected="true"] { background: var(--ink); color: var(--white); border-color: var(--ink); }
.menu__panel { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(28px, 5vw, 72px); align-items: start; min-height: 460px; }
.menu__panel.is-in { animation: fadeIn .45s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } }
.menu__img { position: relative; overflow: hidden; background: var(--paper); }
.menu__img img { width: 100%; aspect-ratio: 1; object-fit: cover; filter: saturate(.85); }
.badge { position: absolute; top: 16px; left: 16px; background: var(--white); padding: 7px 12px; font-size: 10px; letter-spacing: .24em; text-transform: uppercase; font-weight: 500; }
.menu__list { background: var(--white); padding: clamp(24px, 4vw, 48px); }
.menu__list .h3 { font-size: 15px; padding-bottom: 14px; border-bottom: 1px solid var(--ink); margin-bottom: 8px; }
.item { display: flex; align-items: baseline; gap: 10px; padding: 12px 0; }
.item__name { font-size: 15px; font-weight: 400; }
.item__name small { display: block; font-size: 12px; color: var(--muted); font-weight: 300; margin-top: 2px; }
.item__dots { flex: 1; border-bottom: 1px dotted #11111155; transform: translateY(-4px); min-width: 20px; }
.item__price { font-variant-numeric: tabular-nums; font-weight: 400; white-space: nowrap; }
.extras { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--line); }
.extras .item__name { font-size: 13px; color: var(--muted); }
.extras .item__price { font-size: 13px; color: var(--muted); }
.note { margin-top: 20px; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.menu__pdf { margin-top: 28px; text-align: right; }
.menu__pdf a { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; border-bottom: 1px solid var(--ink); }

/* ---------- Tienda ---------- */
.shop { background: var(--paper); }
.shop__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 1200px) { .shop__grid { grid-template-columns: repeat(2, 1fr); } }
.product { background: var(--white); display: flex; flex-direction: column; border: 1px solid transparent; transition: border-color .3s, transform .3s; }
.product:hover { border-color: var(--ink); transform: translateY(-4px); }
.product__art { background: var(--bg); aspect-ratio: 1; display: grid; place-items: center; padding: 24px; }
.product__art svg { width: 70%; height: auto; transition: transform .5s; }
.product:hover .product__art svg { transform: rotate(-3deg) scale(1.04); }
.product__body { padding: 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.product__body .h3 { margin: 0; font-size: 14px; }
.product__body > p:not(.eyebrow) { font-size: 14px; color: #333; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tags li { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; border: 1px solid var(--line); padding: 5px 9px; }
.product__foot { margin-top: auto; padding-top: 14px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); }
.product__price { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; font-weight: 500; }

/* ---------- Galería ---------- */
.gallery { display: grid; grid-template-columns: repeat(7, 1fr); }
.gallery a { aspect-ratio: 1; overflow: hidden; display: block; }
.gallery img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); transition: filter .5s, transform .6s; }
.gallery a:hover img { filter: grayscale(0); transform: scale(1.05); }
.gallery__cta { background: var(--ink); color: var(--bg); display: flex !important; flex-direction: column; justify-content: center; align-items: center; text-decoration: none; gap: 6px; text-align: center; padding: 8px; }
.gallery__cta span { font-size: 10px; letter-spacing: .3em; text-transform: uppercase; }
.gallery__cta strong { font: 400 italic clamp(14px, 1.6vw, 20px)/1.2 var(--serif); }

/* ---------- Visitanos ---------- */
.visit { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(32px, 6vw, 80px); align-items: stretch; }
.visit__block { padding: 24px 0; border-top: 1px solid var(--ink); }
.visit__block p { margin-bottom: 10px; }
.hours li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.hours li.is-today { font-weight: 500; }
.hours li.is-today span:first-child::after { content: "· hoy"; margin-left: 8px; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); font-weight: 400; }
.hours li.is-closed { color: var(--muted); }
.hours-note, #hours-note { margin-top: 12px; }
.status { font-size: 10px; letter-spacing: .18em; padding: 5px 9px; border-radius: 20px; font-weight: 500; }
.status:empty { display: none; }
.status.is-on { background: var(--ink); color: var(--white); }
.status.is-off { border: 1px solid var(--muted); color: var(--muted); }
.contact li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.contact a { text-decoration: none; border-bottom: 1px solid transparent; }
.contact a:hover { border-color: var(--ink); }
.visit__map { min-height: 460px; background: var(--paper); }
.visit__map iframe { width: 100%; height: 100%; min-height: 460px; border: 0; filter: grayscale(1) contrast(1.05); transition: filter .4s; }
.visit__map:hover iframe { filter: grayscale(0); }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: var(--bg); text-align: center; padding: 64px var(--pad) 40px; display: grid; gap: 12px; justify-items: center; font-size: 13px; letter-spacing: .06em; }
.footer__logo { height: 36px; width: auto; filter: invert(1); margin-bottom: 10px; opacity: .92; }
.footer a { text-decoration: none; border-bottom: 1px solid #ffffff44; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero { min-height: auto; padding-top: 24px; }
  .hero__art { order: -1; }
  .hero, .coffee, .menu__panel, .visit { grid-template-columns: minmax(0, 1fr); }
  .menu__img img { aspect-ratio: 16/10; }
  .coffee__img img { aspect-ratio: 16/11; }
  .shop__grid { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; }
  .gallery { grid-template-columns: repeat(4, 1fr); }
  .gallery a:nth-child(n+4):not(.gallery__cta) { display: none; }
  .gallery a:nth-child(1), .gallery a:nth-child(2), .gallery a:nth-child(3) { display: block; }
}
@media (max-width: 760px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; align-items: stretch;
    background: var(--bg); border-bottom: 1px solid var(--ink);
    max-height: 0; overflow: hidden; transition: max-height .35s ease;
  }
  .nav__links.is-open { max-height: 360px; }
  .nav__links a { padding: 16px var(--pad); border-top: 1px solid var(--line); }
  .nav__links a::after { display: none; }
  .section__head { flex-direction: column; align-items: start; }
  .menu__pdf { text-align: left; }
  .sheet div { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Fotos por producto ---------- */
.item.has-photo { cursor: pointer; }
.item__thumb { width: 44px; height: 44px; object-fit: cover; flex: 0 0 44px; align-self: center; filter: grayscale(.2); transition: filter .2s, outline-color .2s; outline: 1px solid transparent; outline-offset: 2px; }
.item.has-photo:hover .item__thumb, .item.is-active .item__thumb { filter: none; outline-color: var(--ink); }
.item.is-active .item__name { font-weight: 500; }
.menu__img img { transition: opacity .25s; }
.menu__img figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px; background: linear-gradient(transparent, #0008); color: #fff; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; }
.menu__img figcaption:empty { display: none; }
.product__art.has-photo { padding: 0; }
.product__art.has-photo img { width: 100%; height: 100%; object-fit: cover; }
.hours__t { text-align: right; font-variant-numeric: tabular-nums; }
.hours li { gap: 16px; align-items: start; }

/* ---------- Carrito ---------- */
.nav__actions { display: flex; align-items: center; gap: 8px; order: 3; }
.nav__cart { position: relative; width: 40px; height: 40px; display: grid; place-items: center; background: none; border: 0; color: var(--ink); cursor: pointer; }
.nav__cart[hidden] { display: none; }
.nav__cart svg { width: 22px; height: 22px; }
.nav__cart-count { position: absolute; top: 3px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--ink); color: var(--white); font: 500 10px/17px var(--sans); text-align: center; transition: transform .2s; }
.nav__cart-count.is-empty { display: none; }
@media (min-width: 761px) { .nav__links { margin-left: auto; margin-right: 20px; } }

.btn:disabled { opacity: .35; cursor: not-allowed; background: var(--ink); color: var(--white); }
.stock-note { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: #8a5a1f; font-weight: 500; }
.product.is-out .product__art > svg, .product.is-out .product__art > img { opacity: .45; filter: grayscale(1); }
.product__art { position: relative; }
.product__art .badge { top: 14px; left: 14px; }

.cart { position: fixed; inset: 0; z-index: 100; }
.cart[hidden] { display: none; }
.cart__overlay { position: absolute; inset: 0; background: #0006; opacity: 0; transition: opacity .3s; }
.cart__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%);
  background: var(--paper); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .3s ease;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
.cart.is-open .cart__overlay { opacity: 1; }
.cart.is-open .cart__panel { transform: none; }
.cart__head { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--ink); }
.cart__head .h3 { margin: 0; font-size: 14px; }
.cart__close { background: none; border: 0; font-size: 28px; line-height: 1; cursor: pointer; color: var(--ink); width: 36px; height: 36px; }
.cart__body { flex: 1; overflow-y: auto; padding: 8px 24px; }
.cart__empty { padding: 32px 0; text-align: center; }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: center; }
.cart-line__name { font-size: 14px; font-weight: 400; }
.cart-line__total { font-variant-numeric: tabular-nums; text-align: right; }
.cart-line__remove { justify-self: end; background: none; border: 0; font: 400 11px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); cursor: pointer; text-decoration: underline; padding: 0; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--ink); justify-self: start; }
.qty button { width: 34px; height: 32px; background: none; border: 0; font-size: 16px; cursor: pointer; color: var(--ink); }
.qty button:disabled { opacity: .25; cursor: not-allowed; }
.qty span { min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; }
.cart__foot { padding: 20px 24px 24px; border-top: 1px solid var(--ink); display: grid; gap: 12px; background: var(--white); }
.cart__total { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; }
.cart__total strong { font: 500 20px var(--sans); letter-spacing: 0; }
.cart__checkout { width: 100%; padding: 16px; }
.cart__clear { background: none; border: 0; font: 400 11px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); cursor: pointer; text-decoration: underline; }
.cart__clear[hidden] { display: none; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 120;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--white); padding: 12px 18px; font-size: 13px; letter-spacing: .04em;
  max-width: calc(100% - 32px); transition: opacity .25s, transform .25s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
