/* Ostionería La Cabañita · colores sacados del logo (sol, ola, letras) y de la madera del local */
:root {
  --tinta: #261b19;   /* letras del logo */
  --sol: #ffe700;     /* sol del logo */
  --mar: #0292d9;     /* ola del logo */
  --madera: #f2a038;  /* madera del local */
  --blanco: #ffffff;
  --mar-hondo: #0c71a3; /* el mismo azul, más hondo para texto */
  --suave: #706867;      /* tinta al 66 % */
  --linea: #e5e4e3;      /* tinta al 12 % */
  --espuma: #edf7fc;     /* mar al 7 % */
  --display: "Caprasimo", Georgia, serif;
  --texto: "Bricolage Grotesque", system-ui, sans-serif;
  --r: 18px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 120px; }
body {
  font-family: var(--texto); color: var(--tinta); background: var(--blanco);
  font-size: 16px; line-height: 1.5; padding-bottom: 96px; overflow-x: hidden;
}
body.loading { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { width: 1em; height: 1em; flex: none; }
:focus-visible { outline: 3px solid var(--mar); outline-offset: 3px; }

.kicker { font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--mar-hondo); }
.title { font-family: var(--display); font-weight: 400; font-size: clamp(2.4rem, 11vw, 5rem); line-height: .98; letter-spacing: -.01em; }
.title em { font-style: normal; color: var(--mar-hondo); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 52px; padding: 0 24px; border-radius: 999px; font-weight: 700; font-size: 1rem;
  text-decoration: none; transition: transform .25s var(--ease), background-color .25s;
}
.btn svg { font-size: 1.15em; transition: transform .3s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn:active { transform: scale(.97); }
.btn-mar { background: var(--mar-hondo); color: var(--blanco); }
.btn-sol { background: var(--sol); color: var(--tinta); }
.btn-tinta { background: var(--tinta); color: var(--blanco); }
.btn.full { width: 100%; }

/* ---------- Carga: sale el sol detrás de las olas ---------- */
.loader {
  position: fixed; inset: 0; z-index: 100; background: var(--blanco);
  display: grid; place-content: center; justify-items: center; gap: 6px;
  transition: transform 1s var(--ease);
}
.loader-art { width: min(64vw, 300px); height: auto; overflow: visible; }
.loader .ring { fill: none; stroke: var(--sol); stroke-width: 7; }
.loader .disc { fill: var(--sol); }
.loader .sun { transform: translateY(120px); animation: sunrise 1.3s var(--ease) .15s forwards; }
.loader .wave { fill: none; stroke-width: 9; stroke-linecap: round; stroke-dasharray: 260; stroke-dashoffset: 260; animation: draw 1s var(--ease) forwards; }
.loader .w1 { stroke: var(--mar); animation-delay: .55s; }
.loader .w2 { stroke: color-mix(in srgb, var(--mar) 62%, var(--blanco)); animation-delay: .7s; }
.loader .w3 { stroke: color-mix(in srgb, var(--mar) 34%, var(--blanco)); animation-delay: .85s; }
.loader-name { font-family: var(--display); font-size: clamp(2.4rem, 12vw, 3.6rem); line-height: 1; opacity: 0; transform: translateY(14px); animation: rise .8s var(--ease) 1s forwards; }
.loader-edge { position: absolute; left: 0; top: 100%; width: 100%; height: 60px; fill: var(--blanco); }
.loader.out { transform: translateY(calc(-100% - 70px)); }
.loader.done { display: none; }
@keyframes sunrise { to { transform: translateY(0); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- Barra de arriba ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px;
  padding: 8px 16px; background: var(--blanco); border-bottom: 1px solid var(--linea);
}
.brand img { width: 62px; height: 62px; object-fit: contain; }
.top-links { display: none; gap: 26px; margin-left: auto; font-weight: 600; }
.top-links a { text-decoration: none; position: relative; }
.top-links a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -3px; height: 2px; background: var(--mar); transition: right .3s var(--ease); }
.top-links a:hover::after { right: 0; }
.today { margin-left: auto; font-size: .82rem; font-weight: 700; padding: 7px 12px; border-radius: 999px; background: var(--sol); }

/* ---------- Portada ---------- */
.hero { padding: 34px 16px 0; max-width: 1240px; margin: 0 auto; }
.hero-title { font-family: var(--display); font-weight: 400; font-size: clamp(3.3rem, 17vw, 9.6rem); line-height: .9; letter-spacing: -.015em; margin: 14px 0 22px; }
.hero-title .w { display: inline-block; overflow: hidden; padding-bottom: .08em; vertical-align: top; }
.hero-title .w > span { display: inline-block; transform: translateY(105%); transition: transform 1s var(--ease); }
.hero-title .w:nth-child(3) > span { color: var(--mar-hondo); }
.ready .hero-title .w > span { transform: none; }
.ready .hero-title .w:nth-child(2) > span { transition-delay: .07s; }
.ready .hero-title .w:nth-child(3) > span { transition-delay: .14s; }
.ready .hero-title .w:nth-child(4) > span { transition-delay: .21s; }
.ready .hero-title .w:nth-child(5) > span { transition-delay: .28s; }
.hero-row { display: grid; gap: 20px; align-items: end; }
.hero-intro { font-size: 1.08rem; color: var(--suave); max-width: 46ch; }
.hero-row .btn { justify-self: start; }
.hero-pic { margin: 30px -16px 0; overflow: hidden; aspect-ratio: 4 / 3.4; position: relative; }
.hero-pic img { width: 100%; height: 124%; margin-top: -12%; object-fit: cover; will-change: transform; }
.hero-pic::after { /* ola que corta la foto */
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 34px; background: var(--espuma);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40' preserveAspectRatio='none'%3E%3Cpath d='M0 40V20C200 0 400 0 600 20s400 20 600 0v20z'/%3E%3C/svg%3E") center / 100% 100%;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 40' preserveAspectRatio='none'%3E%3Cpath d='M0 40V20C200 0 400 0 600 20s400 20 600 0v20z'/%3E%3C/svg%3E") center / 100% 100%;
}

/* ---------- Del mar: título fijo, fotos que suben ---------- */
.drift { position: relative; height: 480vh; background: var(--espuma); }
.drift-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: grid; place-content: center; text-align: center; padding: 0 16px; }
.drift-word { font-family: var(--display); font-weight: 400; font-size: clamp(3.4rem, 19vw, 13rem); line-height: 1; margin-top: 10px; position: relative; z-index: 1; }
.drift-word span { display: inline-block; }
.drift-pics { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.dp {
  position: absolute; top: 0; width: 40vw; max-width: 280px; text-decoration: none; pointer-events: auto;
  will-change: transform; transform: translate3d(0, 110vh, 0);
}
.dp img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 999px 999px var(--r) var(--r); box-shadow: 0 18px 40px -18px rgba(38, 27, 25, .45); }
.dp span { display: block; margin-top: 8px; font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; text-align: left; }
.dp1 { left: 5%; } .dp2 { right: 5%; } .dp3 { left: 8%; } .dp4 { right: 6%; } .dp5 { left: 30%; }
.still .drift { height: auto; }
.still .drift-stage { position: static; height: auto; padding: 60px 16px; }
.still .drift-pics { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 24px; }
.still .dp { position: static; transform: none; width: auto; }

/* ---------- Menú ---------- */
.menu { max-width: 1040px; margin: 0 auto; padding: 72px 0 40px; }
.menu-head { padding: 0 16px; }
.menu-head .title { margin: 10px 0 14px; }
.menu-note { color: var(--suave); max-width: 44ch; }
.chips {
  position: sticky; top: 79px; z-index: 20; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 12px 16px; margin-top: 26px; background: var(--blanco); border-bottom: 1px solid var(--linea);
}
.chips::-webkit-scrollbar { display: none; }
.chips a {
  flex: none; padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--linea);
  font-size: .9rem; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background-color .25s, border-color .25s, color .25s;
}
.chips a.on { background: var(--tinta); border-color: var(--tinta); color: var(--blanco); }
.cat { padding: 44px 16px 8px; }
.cat-head { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: baseline; padding-bottom: 14px; border-bottom: 2px solid var(--tinta); }
.cat-num { font-family: var(--display); font-size: 1.1rem; color: var(--mar-hondo); }
.cat-head h3 { font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 9vw, 3.4rem); line-height: 1; }
.cat-sub { grid-column: 2; margin-top: 6px; color: var(--suave); font-size: .92rem; }
.dish { display: grid; grid-template-columns: 1fr auto; gap: 12px 14px; padding: 18px 0; border-bottom: 1px solid var(--linea); }
.dish.has-pic { grid-template-columns: 84px 1fr auto; }
.dish-pic { width: 84px; height: 84px; object-fit: cover; border-radius: 50%; }
.dish h4 { font-size: 1.08rem; font-weight: 700; line-height: 1.25; }
.dish h4 small { font-weight: 500; color: var(--suave); font-size: .82rem; }
.dish-main p { color: var(--suave); font-size: .92rem; margin-top: 3px; }
.dish-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.price { font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.price small { font-weight: 500; font-size: .8rem; color: var(--suave); }
.tag { font-size: .74rem; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: var(--espuma); color: var(--mar-hondo); white-space: nowrap; }
.vars { display: grid; gap: 8px; margin-top: 12px; }
.var { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 6px 6px 14px; border-radius: 999px; background: var(--espuma); }
.var span { font-size: .92rem; }
.var b { margin-left: 4px; }
.plus {
  position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--mar-hondo); color: var(--blanco); font-size: 1.15rem; transition: transform .2s var(--ease);
}
.var .plus { width: 38px; height: 38px; font-size: 1rem; }
.plus:active { transform: scale(.9); }
.add-count {
  position: absolute; top: -5px; right: -5px; min-width: 21px; height: 21px; padding: 0 5px; border-radius: 999px;
  background: var(--sol); color: var(--tinta); font-size: .72rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--blanco);
}
.dish.picked h4::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--sol); box-shadow: 0 0 0 2px var(--tinta); margin-right: 8px; vertical-align: middle; }
.raw-note { margin: 34px 16px 0; font-size: .85rem; color: var(--suave); }

/* Aparición suave */
.reveal, .cat-head { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in, .cat-head.in { opacity: 1; transform: none; }

/* Foto que sigue al cursor */
.peek {
  position: fixed; left: 0; top: 0; z-index: 25; width: 220px; aspect-ratio: 1; pointer-events: none;
  border-radius: 50%; overflow: hidden; opacity: 0; scale: .6; transition: opacity .3s, scale .4s var(--ease);
  box-shadow: 0 0 0 6px var(--sol), 0 24px 50px -20px rgba(38, 27, 25, .5);
}
.peek img { width: 100%; height: 100%; object-fit: cover; }
.peek.show { opacity: 1; scale: 1; }

/* ---------- Domingos de paella (madera del local) ---------- */
.sunday {
  display: grid; gap: 20px; padding: 64px 16px; margin-top: 30px;
  background: var(--madera) url("img/madera.webp") center / cover;
}
.sunday-card { background: var(--blanco); border-radius: var(--r); padding: 28px 22px; box-shadow: 0 20px 40px -24px rgba(38, 27, 25, .6); }
.sunday-card .title { margin: 8px 0 12px; font-size: clamp(2.2rem, 10vw, 4rem); }
.sunday-card p:not(.kicker) { color: var(--suave); margin-bottom: 22px; }
.sunday-pic img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r); border: 6px solid var(--blanco); }

/* ---------- El sol que se abre ---------- */
.sunmask { position: relative; height: 260vh; background: var(--blanco); }
.sunmask-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.sunmask-pic { position: absolute; inset: 0; clip-path: circle(14% at 50% 50%); background: var(--sol); will-change: clip-path; }
.sunmask-pic img { width: 100%; height: 100%; object-fit: cover; }
.sunmask-pic::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(38, 27, 25, .7), rgba(38, 27, 25, 0) 55%); }
.sunmask-text { position: absolute; left: 16px; right: 16px; bottom: 9vh; color: var(--blanco); opacity: 0; }
.sunmask-text .kicker { color: var(--sol); }
.sunmask-big { font-family: var(--display); font-size: clamp(2.2rem, 10vw, 5.4rem); line-height: 1; margin-top: 10px; max-width: 14ch; }
.still .sunmask { height: auto; }
.still .sunmask-stage { position: relative; height: 80vh; }
.still .sunmask-pic { clip-path: none; }
.still .sunmask-text { opacity: 1; }

/* ---------- Visítanos ---------- */
.visit { max-width: 1040px; margin: 0 auto; padding: 80px 16px 70px; }
.visit .title { margin: 10px 0 26px; }
.visit-grid { display: grid; gap: 12px; }
.visit-item { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: var(--r); background: var(--espuma); text-decoration: none; }
.visit-item svg { font-size: 1.5rem; color: var(--mar); margin-top: 2px; }
.visit-item b { display: block; font-size: 1.05rem; }
.visit-item span { color: var(--suave); }
.visit-item span b { color: var(--tinta); }

/* ---------- Pie ---------- */
.footer { background: var(--tinta); color: var(--blanco); position: relative; overflow-x: clip; }
.footer-waves { position: absolute; left: 0; bottom: 100%; width: 100%; height: 50px; margin-bottom: -1px; }
.footer-waves path { fill: var(--tinta); }
.footer-inner { padding: 40px 16px 40px; text-align: center; }
.footer-name { font-family: var(--display); color: var(--sol); font-size: clamp(2.8rem, 14.5vw, 13rem); line-height: .9; white-space: nowrap; }
.footer-slogan { font-family: var(--display); font-size: clamp(1.2rem, 5vw, 2rem); color: #d4d1d1; margin-top: 6px; }
.footer-links { display: flex; justify-content: center; gap: 22px; margin: 30px 0 16px; font-weight: 600; }
.footer-small { font-size: .8rem; color: #a8a4a3; }

/* ---------- Barra de abajo (una acción) ---------- */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 10px 16px calc(12px + env(safe-area-inset-bottom)); pointer-events: none; }
.dock-cart {
  pointer-events: auto; width: 100%; max-width: 460px; margin: 0 auto; min-height: 58px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; font-size: 1.05rem;
  background: var(--tinta); color: var(--blanco); box-shadow: 0 14px 34px -14px rgba(38, 27, 25, .7); position: relative;
  transition: background-color .3s, color .3s;
}
.dock-cart svg { font-size: 1.3rem; }
.has-items .dock-cart { background: var(--sol); color: var(--tinta); }
.dock-cart .count { min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; background: var(--tinta); color: var(--sol); display: grid; place-items: center; font-size: .85rem; }
.toast {
  position: fixed; left: 50%; bottom: 92px; z-index: 45; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--mar-hondo); color: var(--blanco); padding: 10px 18px; border-radius: 999px; font-size: .9rem; font-weight: 600;
  max-width: calc(100% - 32px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .3s, transform .3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Mi pedido ---------- */
.sheet {
  margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; border: 0; border-radius: 26px 26px 0 0;
  background: var(--blanco); color: var(--tinta); padding: 0;
}
.sheet::backdrop { background: rgba(38, 27, 25, .55); }
.sheet-form { display: flex; flex-direction: column; max-height: inherit; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 22px 20px 14px; border-bottom: 1px solid var(--linea); }
.sheet-title { font-family: var(--display); font-weight: 400; font-size: 2.2rem; line-height: 1; margin-top: 4px; }
.sheet-body { overflow-y: auto; padding: 8px 20px 18px; }
.sheet-alert { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--sol); font-weight: 600; font-size: .92rem; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--espuma); font-size: 1rem; }
.cart-row { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--linea); }
.cart-info strong { display: block; font-size: .98rem; }
.cart-info small { color: var(--suave); }
.qty { display: flex; align-items: center; gap: 10px; }
.qty output { min-width: 18px; text-align: center; font-weight: 700; }
.cart-empty { padding: 28px 0; color: var(--suave); }
.cart-fields { display: grid; gap: 16px; padding-top: 18px; }
.field { display: grid; gap: 6px; border: 0; }
.field-label { font-weight: 700; font-size: .92rem; }
.field-label small { font-weight: 500; color: var(--suave); }
.field input, .field textarea {
  font: inherit; font-size: 16px; width: 100%; padding: 13px 14px; border-radius: 12px; border: 1.5px solid var(--linea); background: var(--blanco); color: var(--tinta); resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--mar); }
.field-hint { font-size: .82rem; color: var(--suave); }
.field-error { font-size: .85rem; color: #b3261e; font-weight: 600; }
.field-error:empty { display: none; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt input { position: absolute; opacity: 0; }
.opt span { display: grid; place-items: center; min-height: 48px; padding: 6px 10px; text-align: center; border-radius: 12px; border: 1.5px solid var(--linea); font-weight: 600; font-size: .92rem; cursor: pointer; }
.opt input:checked + span { border-color: var(--mar); background: var(--espuma); color: var(--mar-hondo); }
.opt input:disabled + span { opacity: .4; cursor: not-allowed; }
.opt input:focus-visible + span { outline: 3px solid var(--mar); outline-offset: 2px; }
.sheet-foot { padding: 14px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--linea); display: grid; gap: 10px; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; }
.cart-total strong { font-family: var(--display); font-weight: 400; font-size: 1.8rem; }
.cart-kilo { font-size: .82rem; color: var(--suave); }
.cart-legal { font-size: .78rem; color: var(--suave); text-align: center; }

/* ---------- Pantallas grandes ---------- */
@media (min-width: 768px) {
  .top-links { display: flex; }
  .today { margin-left: 0; }
  .hero { padding-top: 56px; }
  .hero-row { grid-template-columns: 1fr auto; }
  .hero-pic { margin: 44px 0 0; border-radius: var(--r) var(--r) 0 0; aspect-ratio: 16 / 8; }
  .dp { width: 24vw; }
  .dp1 { left: 6%; } .dp2 { right: 10%; } .dp3 { left: 38%; } .dp4 { right: 4%; } .dp5 { left: 14%; }
  .chips { justify-content: flex-start; }
  .dishes { display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px; }
  .sunday { grid-template-columns: 1fr 1.1fr; align-items: center; padding: 90px max(32px, calc((100% - 1040px) / 2)); }
  .sunday-card { padding: 42px 38px; }
  .sunmask-text { left: max(32px, calc((100% - 1040px) / 2)); }
  .visit-grid { grid-template-columns: 1fr 1fr; }
  .sheet { margin: auto; border-radius: 26px; max-height: 88vh; }
  .footer-waves { height: 80px; }
}
@media (hover: hover) and (pointer: fine) {
  .dish.has-pic { grid-template-columns: 1fr auto; }
  .dish-pic { display: none; }
  .dish[data-img] h4 { text-decoration: underline; text-decoration-color: var(--sol); text-decoration-thickness: 3px; text-underline-offset: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal, .cat-head { opacity: 1; transform: none; }
  .hero-title .w > span { transform: none; }
}
