/* ============================================================
   Rose's Sugar Shack Cafe — design system
   "Sun-faded surf-postcard diner": cream base, diner-red CTAs,
   awning-teal accents, toast-brown ink, gingham + scallop details.
   Mobile-first, 375px baseline. Page-specific styles: pages.css.
   ============================================================ */

@font-face {
  font-family: 'Fraunces';
  src: url('/assets/fonts/fraunces-var.woff2') format('woff2');
  font-weight: 300 900;
  font-display: swap;
}
@font-face {
  font-family: 'Cabin';
  src: url('/assets/fonts/cabin-var.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  /* palette */
  --cream:        #FBF5E9;   /* page base — morning-light cream */
  --cream-deep:   #F4E9D3;   /* alt section band */
  --shell:        #FFFDF7;   /* card faces */
  --ink:          #3A2E22;   /* toast-brown text */
  --ink-soft:     #6B5A48;   /* secondary text */
  --red:          #C3402B;   /* diner red — umbrellas, gingham, CTAs */
  --red-deep:     #A02F1E;   /* hover / press */
  --teal:         #1F6E70;   /* awning teal — links, secondary actions */
  --teal-deep:    #14575A;
  --butter:       #F5C542;   /* sun-yellow highlight, sparingly */
  --sky:          #BFDDE0;   /* pale sky wash */
  --seafoam:      #CDE8E1;   /* dining-room wall seafoam (real interior color) */
  --seafoam-deep: #9CCFC4;
  --line:         #E4D5BC;   /* hairlines on cream */
  --ok:           #2E7D46;
  --warn:         #B26A00;
  --danger:       #B3261E;

  /* type */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body:    'Cabin', 'Trebuchet MS', Verdana, sans-serif;

  /* rhythm */
  --radius:    14px;
  --radius-lg: 22px;
  --shadow-card: 0 1px 2px rgba(58, 46, 34, .08), 0 6px 18px -8px rgba(58, 46, 34, .22);
  --shadow-pop:  0 2px 4px rgba(58, 46, 34, .10), 0 14px 34px -12px rgba(58, 46, 34, .30);
  --wrap:      1080px;
  --bottombar-h: 62px;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--cream);
  /* faint paper grain */
  background-image: radial-gradient(rgba(58,46,34,.028) 1px, transparent 1px);
  background-size: 22px 22px;
}
@media (min-width: 768px) { body { font-size: 17.5px; } }

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.01em;
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 6.5vw, 3.4rem); font-weight: 900; }
h2 { font-size: clamp(1.5rem, 4.5vw, 2.2rem); }
h3 { font-size: clamp(1.15rem, 3.5vw, 1.4rem); }
p  { margin: 0 0 1em; }
a  { color: var(--teal); text-underline-offset: 2px; }
a:hover { color: var(--teal-deep); }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.1rem; }
@media (min-width: 768px) { .wrap { padding: 0 2rem; } }

/* small caps kicker above headings */
.kicker {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 .6rem;
}

/* ---------- gingham + scallop accents ---------- */
.gingham {
  background:
    repeating-linear-gradient(0deg,  rgba(195,64,43,.16) 0 10px, transparent 10px 20px),
    repeating-linear-gradient(90deg, rgba(195,64,43,.16) 0 10px, transparent 10px 20px),
    var(--shell);
}
.gingham-strip { height: 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* scalloped awning edge — attach to a section's top */
.scallop {
  --scallop-color: var(--cream);
  height: 18px;
  background-image: radial-gradient(circle at 50% 0, var(--scallop-color) 13px, transparent 14px);
  background-size: 26px 18px;
  background-repeat: repeat-x;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px;
  padding: .7rem 1.5rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.02rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform .06s ease, background-color .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--red); color: #fff;
  box-shadow: 0 3px 0 var(--red-deep), 0 10px 22px -10px rgba(195,64,43,.55);
}
.btn-primary:hover { background: var(--red-deep); color: #fff; }
.btn-secondary {
  background: transparent; color: var(--teal-deep);
  border-color: var(--teal);
}
.btn-secondary:hover { background: rgba(31,110,112,.09); color: var(--teal-deep); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-soft); }
.btn-sm { min-height: 40px; padding: .35rem 1rem; font-size: .92rem; }
.btn-lg { min-height: 54px; padding: .85rem 2rem; font-size: 1.12rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .55; pointer-events: none; }

/* ---------- cards ---------- */
.card {
  background: var(--shell);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.card-pad { padding: 1.1rem 1.2rem; }

/* ---------- badges / tags ---------- */
.tag {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: .18rem .6rem; border-radius: 999px;
}
.tag-popular   { background: var(--butter); color: #5d4200; }
.tag-vegetarian{ background: #DDEBD9; color: #2E5B33; }
.tag-spicy     { background: #F7DAD2; color: #90301C; }
.tag-soldout   { background: #E9E2D4; color: #6B5A48; }
.tag-new       { background: #D8E9EA; color: var(--teal-deep); }

/* ---------- forms ---------- */
label { display: block; font-weight: 600; margin: .9rem 0 .3rem; }
input[type=text], input[type=tel], input[type=email], input[type=password],
input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%;
  min-height: 48px;
  padding: .6rem .85rem;
  font: inherit;
  color: var(--ink);
  background: var(--shell);
  border: 1.5px solid var(--line);
  border-radius: 10px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); outline: none; box-shadow: 0 0 0 3px rgba(31,110,112,.18); }
.field-error { color: var(--danger); font-size: .88rem; margin-top: .25rem; }
.hint { color: var(--ink-soft); font-size: .88rem; }

/* choice chips (seating pref, tip presets, egg style, etc.) */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: .4rem;
  min-height: 44px; padding: .45rem 1rem;
  border: 1.5px solid var(--line); border-radius: 999px;
  background: var(--shell); font-weight: 600; cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip:has(input:checked) { border-color: var(--red); background: #FBE9E4; color: var(--red-deep); }
.chip:has(input:focus-visible) { outline: 3px solid var(--teal); outline-offset: 2px; }

/* ---------- flash messages ---------- */
.flash {
  max-width: var(--wrap); margin: .8rem auto; padding: .8rem 1.1rem;
  border-radius: 10px; font-weight: 600;
}
.flash-success { background: #E2EFDF; color: #24552E; border: 1px solid #BCD8B7; }
.flash-error   { background: #F8E1DD; color: #7C1F14; border: 1px solid #EBC0B8; }
.flash-info    { background: #DFEBEC; color: #14575A; border: 1px solid #BCD7D8; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(251,245,233,.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 64px;
  max-width: 1360px;   /* the full desktop nav needs more room than --wrap */
}
@media (min-width: 1160px) and (max-width: 1299px) {
  /* narrower desktops: drop the hours pill (hours live in hero + footer) */
  .site-nav .open-pill { display: none; }
}
.brand {
  display: flex; align-items: center; gap: .65rem;
  text-decoration: none; color: var(--ink);
  flex: none;
}
.brand .brand-name, .brand .brand-sub { white-space: nowrap; }
.brand img { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); }
.brand .brand-name {
  font-family: var(--font-display); font-weight: 900; font-size: 1.18rem; line-height: 1.05;
}
.brand .brand-sub { font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }

.site-nav { display: none; }
@media (min-width: 1160px) {
  .site-nav { display: flex; align-items: center; gap: clamp(.7rem, 1.6vw, 1.4rem); }
  .site-nav a { color: var(--ink); text-decoration: none; font-weight: 600; white-space: nowrap; }
  .site-nav a:hover, .site-nav a[aria-current=page] { color: var(--red); }
  .site-nav .open-pill { white-space: nowrap; }
  .header-cta { white-space: nowrap; }
}
.header-cta { display: none; }
@media (min-width: 1160px) { .header-cta { display: inline-flex; } }

.nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--shell); cursor: pointer;
}
@media (min-width: 1160px) { .nav-toggle { display: none; } }

.mobile-menu {
  display: none;
  border-top: 1px solid var(--line);
  background: var(--shell);
}
.mobile-menu.is-open { display: block; }
.mobile-menu a {
  display: block; padding: .95rem 1.3rem; text-decoration: none;
  color: var(--ink); font-weight: 600; border-bottom: 1px solid var(--line);
}
.mobile-menu a:last-child { border-bottom: 0; }

/* open-now pill */
.open-pill {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .8rem; font-weight: 700;
  padding: .25rem .7rem; border-radius: 999px;
}
.open-pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.open-pill.is-open { background: #E2EFDF; color: var(--ok); }
.open-pill.is-closed { background: #F1EADA; color: var(--ink-soft); }

/* ---------- footer ---------- */
.site-footer {
  margin-top: 3.5rem;
  background: var(--ink);
  color: #EFE5D6;
  padding: 2.6rem 0 calc(2rem + var(--bottombar-h));
}
@media (min-width: 1160px) { .site-footer { padding-bottom: 2.6rem; } }
.site-footer a { color: var(--sky); }
.site-footer h3 { color: #fff; font-size: 1.05rem; margin-bottom: .6rem; }
.footer-grid { display: grid; gap: 1.8rem; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-note { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid rgba(239,229,214,.25); font-size: .88rem; color: #CBBFA9; }
.footer-surf {
  margin: .5rem 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.08rem;
  color: var(--seafoam-deep);
}

/* ---------- sticky bottom action bar (mobile) ---------- */
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--shell);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 20px -12px rgba(58,46,34,.4);
  padding-bottom: env(safe-area-inset-bottom);
  height: calc(var(--bottombar-h) + env(safe-area-inset-bottom));
}
.bottom-bar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--ink-soft);
  font-size: .66rem; font-weight: 700; letter-spacing: .02em;
}
.bottom-bar a svg { width: 22px; height: 22px; }
.bottom-bar a.is-active, .bottom-bar a:hover { color: var(--red); }
.bottom-bar .bb-order {
  color: #fff; background: var(--red); border-radius: 0;
}
.bottom-bar .bb-order:hover { color: #fff; background: var(--red-deep); }
@media (min-width: 1160px) { .bottom-bar { display: none; } }
body { padding-bottom: calc(var(--bottombar-h) + env(safe-area-inset-bottom)); }
@media (min-width: 1160px) { body { padding-bottom: 0; } }

/* cart count badge (in bottom bar + header) */
.cart-badge {
  position: absolute; top: 4px; right: 18%;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--butter); color: #5d4200;
  font-size: .68rem; font-weight: 800; line-height: 18px; text-align: center;
  display: none;
}
.cart-badge.has-items { display: block; }

/* ---------- sections ---------- */
.section { padding: 3rem 0; }
@media (min-width: 768px) { .section { padding: 4.2rem 0; } }
.section-band { background: var(--cream-deep); }
.section-sea  { background: linear-gradient(180deg, var(--seafoam) 0%, #DDF0EA 100%); }
.section-head { max-width: 640px; margin-bottom: 1.8rem; }

/* generic responsive grid */
.grid { display: grid; gap: 1.1rem; }
@media (min-width: 640px)  { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px)  { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }

/* ---------- error pages ---------- */
.error-page { max-width: 560px; margin: 4rem auto; padding: 0 1.2rem; text-align: center; }

/* ---------- help widget (assistant placeholder) ---------- */
.help-fab {
  position: fixed; right: 1rem; bottom: calc(var(--bottombar-h) + env(safe-area-inset-bottom) + 1rem);
  z-index: 70;
  display: inline-flex; align-items: center; gap: .45rem;
  min-height: 46px; padding: .5rem 1rem;
  border: 1.5px solid var(--line); border-radius: 999px;
  background: var(--shell); color: var(--teal-deep);
  font-family: var(--font-body); font-weight: 700; font-size: .92rem;
  box-shadow: var(--shadow-pop); cursor: pointer;
}
@media (min-width: 1160px) { .help-fab { bottom: 1.2rem; } }
.help-fab:hover { border-color: var(--teal); }
.help-sheet {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop); background: var(--shell); color: var(--ink);
  padding: 1.2rem 1.3rem; width: min(92vw, 380px);
}
.help-sheet::backdrop { background: rgba(58, 46, 34, .45); }
.help-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.help-close { background: none; border: 0; cursor: pointer; color: var(--ink-soft); padding: .4rem; }
.help-list { list-style: none; margin: .6rem 0 1rem; padding: 0; display: grid; gap: .15rem; }
.help-list a {
  display: flex; align-items: center; gap: .6rem;
  padding: .65rem .5rem; border-radius: 10px;
  color: var(--ink); text-decoration: none; font-weight: 600;
}
.help-list a:hover { background: var(--cream-deep); color: var(--red-deep); }

/* ---------- utilities ---------- */
.text-center { text-align: center; }
.muted { color: var(--ink-soft); }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

/* ---- floating checkout pill (menu page) ---- */
.cart-pill {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--bottombar-h) + env(safe-area-inset-bottom) + 14px);
  z-index: 90;
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .78rem 1.5rem;
  background: var(--red); color: #fff;
  border-radius: 999px; box-shadow: var(--shadow-pop);
  font-weight: 800; font-size: 1rem; letter-spacing: .01em;
  text-decoration: none; white-space: nowrap;
  animation: cart-pill-in .25s ease-out;
}
.cart-pill:hover { background: var(--red-deep); color: #fff; }
.cart-pill svg { width: 20px; height: 20px; flex: 0 0 auto; }
.cart-pill.is-bump { animation: cart-pill-bump .3s ease-out; }
@keyframes cart-pill-in { from { opacity: 0; transform: translateX(-50%) translateY(12px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes cart-pill-bump { 50% { transform: translateX(-50%) scale(1.07); } }
@media (min-width: 1160px) { .cart-pill { bottom: 24px; } }
.cart-pill[hidden] { display: none !important; }

/* ---- surf-spot cards: photos, directions, credits (local page) ---- */
.spot-photo { margin: 0 0 1rem; }
.spot-photo img {
  display: block; width: 100%; height: auto;
  aspect-ratio: 3 / 2; object-fit: cover;
  border-radius: calc(var(--radius) - 4px);
}
.spot-directions { margin-top: .9rem; }
.spot-dir-link {
  display: inline-flex; align-items: center; gap: .4rem;
  font-weight: 700; text-decoration: none; color: var(--red);
}
.spot-dir-link:hover { color: var(--red-deep); text-decoration: underline; }
.photo-credits { margin-top: 1.4rem; font-size: .72rem; color: var(--ink-soft); }
.photo-credits a { color: inherit; }
