/* Blue Lemon Bakery — base compartida: tokens de marca, tipografía, botones, formularios, cajón y modal. */

:root {
  --navy: #083969;
  --navy-deep: #062c52;
  --navy-soft: #0d4a85;
  --blue: #177599;
  --teal: #86cbd3;
  --teal-100: #dff1f2;
  --teal-200: #c4e6e9;
  --cream: #fff9f1;
  --cream-2: #f7efe2;
  --lime: #caff8a;
  --lime-deep: #b4ef6a;
  --ink: #0b2a4a;
  --muted: #4b6682;
  --line: rgba(8, 57, 105, 0.14);
  --danger: #b3261e;
  --white: #fff;

  --font-body: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-caps: 'Marcellus SC', 'Marcellus', Georgia, serif;
  --font-serif: 'Fraunces', Georgia, serif;

  --radius: 26px;
  --radius-sm: 14px;
  --shadow: 0 18px 40px -18px rgba(6, 44, 82, 0.35);
  --shadow-sm: 0 6px 18px -8px rgba(6, 44, 82, 0.3);
  --header-h: 72px;
  --gutter: clamp(18px, 4vw, 48px);
  --max: 1200px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(100% - var(--gutter) * 2, var(--max)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Tipografía de marca */
.caps { font-family: var(--font-caps); font-weight: 400; letter-spacing: 0.04em; line-height: 1.05; }
.serif { font-family: var(--font-serif); font-weight: 500; letter-spacing: -0.01em; line-height: 1.1; }
.eyebrow { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--blue); }
.label-caps { font-weight: 700; font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase; }

/* Separador del catálogo: línea — hoja — línea */
.divider { display: flex; align-items: center; gap: 12px; color: var(--lime); }
.divider::before, .divider::after { content: ''; height: 2px; width: 74px; background: currentColor; border-radius: 2px; }
.divider svg { width: 22px; height: 22px; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 26px;
  border: 2px solid transparent; border-radius: 999px;
  font-weight: 600; font-size: 0.95rem; text-decoration: none; white-space: nowrap;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-lime { background: var(--lime); color: var(--navy); border-color: var(--navy); box-shadow: 0 4px 0 var(--navy); }
.btn-lime:hover { box-shadow: 0 6px 0 var(--navy); background: var(--lime-deep); }
.btn-lime:active { box-shadow: 0 2px 0 var(--navy); transform: translateY(2px); }
.btn-navy { background: var(--navy); color: var(--white); }
.btn-navy:hover { background: var(--navy-soft); box-shadow: var(--shadow-sm); }
.btn-ghost { border-color: currentColor; background: transparent; }
.btn-ghost:hover { background: rgba(134, 203, 211, 0.18); }
.btn-soft { background: var(--teal-100); color: var(--navy); }
.btn-soft:hover { background: var(--teal-200); }
.btn-wa { background: #1faa59; color: #fff; }
.btn-wa:hover { background: #17924a; }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 0.85rem; }
.btn-block { width: 100%; white-space: normal; text-align: center; padding-block: 10px; line-height: 1.25; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: transparent; position: relative; transition: background 0.2s;
}
.icon-btn:hover { background: rgba(134, 203, 211, 0.25); }
.icon-btn svg { width: 22px; height: 22px; }

/* Etiqueta de precio del catálogo */
.price-tag {
  display: inline-block; padding: 4px 12px; border-radius: 10px;
  background: var(--teal); color: var(--navy); font-style: italic; font-weight: 500; letter-spacing: 0.03em;
}

/* Cabecera */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h);
  display: flex; align-items: center;
  color: var(--white);
  transition: background 0.3s, box-shadow 0.3s, color 0.3s;
}
.site-header .wrap { display: flex; align-items: center; gap: 20px; }
.site-header.is-solid { background: rgba(255, 249, 241, 0.92); backdrop-filter: blur(14px); color: var(--navy); box-shadow: 0 1px 0 var(--line); }
.brand { display: flex; align-items: center; flex: none; }
.brand img { height: 46px; width: auto; }
.brand .logo-navy { display: none; }
.is-solid .brand .logo-navy { display: block; }
.is-solid .brand .logo-white { display: none; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { padding: 8px 13px; border-radius: 999px; text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: background 0.2s; }
.nav a:hover, .nav a[aria-current='page'] { background: rgba(134, 203, 211, 0.28); }
.header-actions { display: flex; align-items: center; gap: 6px; }
.cart-count {
  position: absolute; top: 2px; right: 0; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px; background: var(--lime); color: var(--navy); border: 1.5px solid var(--navy);
  font-size: 0.68rem; font-weight: 700; display: grid; place-items: center; line-height: 1;
}
.cart-count:empty { display: none; }
.menu-toggle { display: none; }

@media (max-width: 980px) {
  .header-actions { margin-left: auto; }
  .menu-toggle { display: inline-grid; }
  .header-cta { display: none; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0; margin: 0; padding: 14px var(--gutter) 26px;
    flex-direction: column; gap: 2px; background: var(--cream); color: var(--navy);
    box-shadow: var(--shadow); border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius);
    transform: translateY(-12px); opacity: 0; visibility: hidden; transition: 0.25s var(--ease);
  }
  .nav a { padding: 13px 14px; font-size: 1.02rem; }
  .nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .nav .nav-cta { display: flex; margin-top: 10px; }
}
@media (min-width: 981px) { .nav .nav-cta { display: none; } }

/* Formularios */
.field { display: grid; gap: 6px; }
.field > span { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.textarea { min-height: 84px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(23, 117, 153, 0.15); }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--teal-100); border-radius: 999px; }
.seg button { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 0.86rem; color: var(--navy); }
.seg button[aria-pressed='true'] { background: var(--navy); color: #fff; }

/* Cajón lateral y modal */
.scrim { position: fixed; inset: 0; z-index: 80; background: rgba(6, 44, 82, 0.5); opacity: 0; visibility: hidden; transition: 0.3s; }
.scrim.is-open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; z-index: 90; inset: 0 0 0 auto; width: min(440px, 100%);
  background: var(--cream); display: flex; flex-direction: column;
  transform: translateX(104%); transition: transform 0.4s var(--ease); box-shadow: var(--shadow);
}
.drawer.is-open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 1.5rem; }
.drawer-body { flex: 1; overflow: auto; padding: 18px 22px; overscroll-behavior: contain; }
.drawer-foot { padding: 18px 22px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--white); display: grid; gap: 12px; }

.modal {
  position: fixed; z-index: 95; inset: 0; display: grid; place-items: center; padding: 16px;
  opacity: 0; visibility: hidden; transition: 0.25s;
}
.modal.is-open { opacity: 1; visibility: visible; }
.modal-card {
  width: min(620px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
  background: var(--cream); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(20px, 4vw, 34px);
  transform: translateY(16px) scale(0.98); transition: transform 0.35s var(--ease);
}
.modal.is-open .modal-card { transform: none; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.modal-head h2 { font-size: 1.7rem; }

/* Carrito */
.cart-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; padding: 14px 0; border-bottom: 1px dashed var(--line); align-items: start; }
.cart-thumb { width: 64px; height: 76px; border-radius: 14px; overflow: hidden; background: var(--teal-100); border: 2px solid var(--blue); display: grid; place-items: center; }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-thumb .can-svg { width: 46px; }
.cart-thumb .cake-glyph { width: 38px; color: var(--navy); }
.cart-item h3 { font-size: 0.95rem; line-height: 1.3; }
.cart-item small { display: block; color: var(--muted); font-size: 0.78rem; line-height: 1.45; }
.qty { display: inline-flex; align-items: center; gap: 2px; margin-top: 8px; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; }
.qty button { width: 30px; height: 30px; border: 0; background: none; border-radius: 50%; font-weight: 700; }
.qty span { min-width: 22px; text-align: center; font-weight: 600; font-size: 0.9rem; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
.cart-total strong { font-size: 1.5rem; }
.note { font-size: 0.8rem; color: var(--muted); line-height: 1.5; }
.empty { text-align: center; padding: 40px 10px; color: var(--muted); }
.empty img { width: 70px; margin: 0 auto 14px; opacity: 0.5; }

/* Aviso flotante */
.toast {
  position: fixed; z-index: 120; left: 50%; bottom: 26px; transform: translate(-50%, 30px);
  background: var(--navy); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 0.9rem; font-weight: 500;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: 0.35s var(--ease); max-width: calc(100% - 32px); text-align: center;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.demo-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  background: var(--lime); color: var(--navy); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
