/* ==========================================================================
   shared.css — Foundation-owned. Pages MUST NOT edit this file.
   Defines :root design tokens + shared component classes used site-wide.
   Token values are the authoritative extracted Grubhub palette (see
   BUILD-CONVENTIONS.md for provenance).
   ========================================================================== */

:root {
  /* --- Brand colors --- */
  --gh-orange: #FF5500;          /* logo / brand accent */
  --gh-orange-hover: #E03C01;
  --gh-orange-pressed: #AD2E00;

  --gh-purple: #572AF8;          /* primary action: Sign in, Add to bag, Continue */
  --gh-purple-hover: #3628C6;
  --gh-purple-pressed: #281E92;
  --gh-purple-tint: #EFEFF2;     /* light purple-gray button/tint background */

  --gh-green: #0E8450;           /* brand green: cart icon + checkout accents */
  --gh-green-button: #32855F;    /* Proceed/Place-order button face */
  --gh-green-hover: #2E6851;
  --gh-green-dark: #1B4032;

  /* --- Text --- */
  --gh-text: #1A1A19;            /* primary near-black text */
  --gh-text-secondary: #575655;  /* body / labels */
  --gh-text-muted: #93918F;
  --gh-error: #E03C01;

  /* --- Backgrounds --- */
  --gh-bg-white: #FFFFFF;
  --gh-bg-offwhite: #FBFBFC;     /* page background */
  --gh-bg-gray-light: #F5F3F1;
  --gh-bg-gray: #EFEFF2;

  /* --- Borders --- */
  --gh-border: #DBD9D7;          /* card border */
  --gh-border-light: #E4E7E7;
  --gh-input-border: #93918F;
  --gh-input-focus: #572AF8;
  --gh-divider: #EFEFEF;

  /* --- Radii --- */
  --gh-radius-sm: 4px;           /* inputs / small chips */
  --gh-radius-md: 8px;           /* small cards */
  --gh-radius-card: 16px;        /* content cards / modals */
  --gh-radius-lg: 24px;
  --gh-radius-pill: 9999px;      /* full pill action buttons */
  --gh-radius-round: 100px;      /* circular qty steppers / avatars */

  /* --- Typography --- */
  --gh-font: "Bagoss Standard", "Fira Sans", Helvetica, Arial, sans-serif;
  --gh-weight-regular: 400;
  --gh-weight-medium: 500;
  --gh-weight-bold: 700;

  /* --- Shadows --- */
  --gh-shadow-card: rgba(38, 38, 38, 0.1) 0px 0px 0px 1px, rgba(38, 38, 38, 0.1) 0px 1px 8px 0px;
  --gh-shadow-elevated: 0 2px 5px rgba(26, 26, 25, 0.2);
  --gh-shadow-panel: -2px 0 16px rgba(26, 26, 25, 0.18);

  /* --- Layout --- */
  --gh-header-height: 64px;
  --gh-maxw: 1200px;
}

/* ==========================================================================
   Reset / base
   ========================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--gh-font);
  color: var(--gh-text);
  background: var(--gh-bg-offwhite);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--gh-purple); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 0.5em; font-weight: var(--gh-weight-bold); color: var(--gh-text); }

img { max-width: 100%; display: block; }

button { font-family: inherit; cursor: pointer; }

:focus-visible { outline: 2px solid var(--gh-purple); outline-offset: 2px; }

.gh-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.gh-container {
  max-width: var(--gh-maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   Buttons — .gh-btn + variants
   Default action button is a full purple pill.
   ========================================================================== */
.gh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 16px;
  font-weight: var(--gh-weight-bold);
  line-height: 1;
  padding: 14px 24px;
  border: 1px solid transparent;
  border-radius: var(--gh-radius-pill);
  background: var(--gh-purple);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  text-decoration: none;
  white-space: nowrap;
}
.gh-btn:hover { background: var(--gh-purple-hover); text-decoration: none; }
.gh-btn:active { background: var(--gh-purple-pressed); }
.gh-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Purple is the default; keep an explicit modifier for clarity */
.gh-btn--purple { background: var(--gh-purple); color: #fff; }
.gh-btn--purple:hover { background: var(--gh-purple-hover); }
.gh-btn--purple:active { background: var(--gh-purple-pressed); }

/* Green — Proceed to checkout / Place order */
.gh-btn--green { background: var(--gh-green-button); color: #fff; }
.gh-btn--green:hover { background: var(--gh-green-hover); }
.gh-btn--green:active { background: var(--gh-green-dark); }

/* Dark — hero "See what's nearby" pill (near-black) */
.gh-btn--dark { background: var(--gh-text); color: #fff; }
.gh-btn--dark:hover { background: #000; }

/* Ghost / secondary — outlined */
.gh-btn--ghost {
  background: transparent;
  color: var(--gh-purple);
  border-color: var(--gh-border);
}
.gh-btn--ghost:hover { background: var(--gh-purple-tint); }

/* Block / full width */
.gh-btn--block { width: 100%; }

/* ==========================================================================
   Inputs — .gh-input
   ========================================================================== */
.gh-input {
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  color: var(--gh-text);
  background: var(--gh-bg-white);
  padding: 14px 16px;
  border: 1px solid var(--gh-input-border);
  border-radius: var(--gh-radius-sm);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.gh-input::placeholder { color: var(--gh-text-muted); }
.gh-input:focus {
  outline: none;
  border-color: var(--gh-input-focus);
  box-shadow: 0 0 0 1px var(--gh-input-focus);
}
.gh-input--error { border-color: var(--gh-error); }
.gh-input--error:focus { box-shadow: 0 0 0 1px var(--gh-error); }

.gh-field { margin-bottom: 16px; }
.gh-label {
  display: block;
  font-size: 13px;
  font-weight: var(--gh-weight-medium);
  color: var(--gh-text-secondary);
  margin-bottom: 6px;
}
.gh-error-text {
  display: block;
  color: var(--gh-error);
  font-size: 13px;
  margin-top: 6px;
}

/* ==========================================================================
   Card — .gh-card
   ========================================================================== */
.gh-card {
  background: var(--gh-bg-white);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius-card);
  box-shadow: var(--gh-shadow-card);
  overflow: hidden;
}

/* ==========================================================================
   Pill — .gh-pill (address pill / chips)
   ========================================================================== */
.gh-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: var(--gh-weight-medium);
  color: var(--gh-text);
  background: var(--gh-bg-white);
  border: 1px solid var(--gh-border);
  border-radius: var(--gh-radius-pill);
  padding: 8px 14px;
  cursor: pointer;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gh-pill:hover { background: var(--gh-bg-gray); }

/* ==========================================================================
   Badge — .gh-badge (cart count)
   ========================================================================== */
.gh-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: var(--gh-weight-bold);
  line-height: 1;
  color: #fff;
  background: var(--gh-orange);
  border-radius: var(--gh-radius-round);
}

/* ==========================================================================
   Header — .gh-header (built by js/header.js)
   ========================================================================== */
.gh-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--gh-bg-white);
  border-bottom: 1px solid var(--gh-divider);
}
.gh-header__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--gh-header-height);
  max-width: var(--gh-maxw);
  margin: 0 auto;
  padding: 0 24px;
}
.gh-header__logo { display: inline-flex; align-items: center; flex: 0 0 auto; }
.gh-header__logo img { height: 22px; width: auto; }

.gh-header__address { flex: 0 0 auto; }

.gh-header__search {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  max-width: 420px;
}
.gh-header__search .gh-input {
  padding: 10px 14px 10px 38px;
  border-radius: var(--gh-radius-pill);
  background: var(--gh-bg-gray) url("../assets/brand/search.svg") no-repeat 14px center;
  background-size: 16px 16px;
  border-color: transparent;
}
.gh-header__spacer { flex: 1 1 auto; }

.gh-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.gh-header__cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  border-radius: var(--gh-radius-round);
  color: var(--gh-green);
}
.gh-header__cart:hover { background: var(--gh-bg-gray); }
.gh-header__cart svg { width: 22px; height: 22px; display: block; }
.gh-header__cart .gh-badge {
  position: absolute;
  top: 4px;
  right: 4px;
}
.gh-header__cart-badge--empty { display: none; }

.gh-header__account {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: var(--gh-weight-bold);
  color: var(--gh-text);
  background: transparent;
  border: none;
  padding: 10px 12px;
  border-radius: var(--gh-radius-pill);
}
.gh-header__account:hover { background: var(--gh-bg-gray); text-decoration: none; }

/* Developer menu — intentionally distinct so it's an obvious POC affordance */
.gh-header__dev {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: var(--gh-weight-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: repeating-linear-gradient(
    45deg, #281E92, #281E92 8px, #3628C6 8px, #3628C6 16px
  );
  border: 1px dashed #fff;
  padding: 6px 10px;
  border-radius: var(--gh-radius-sm);
  box-shadow: var(--gh-shadow-card);
}
.gh-header__dev:hover { color: #fff; text-decoration: none; filter: brightness(1.1); }
.gh-header__dev::before { content: "\2699"; font-size: 13px; }

/* ==========================================================================
   Footer — .gh-footer (built by js/header.js mountFooter)
   ========================================================================== */
.gh-footer {
  background: var(--gh-bg-gray-light);
  border-top: 1px solid var(--gh-divider);
  color: var(--gh-text-secondary);
  margin-top: 48px;
}
.gh-footer__inner {
  max-width: var(--gh-maxw);
  margin: 0 auto;
  padding: 40px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  align-items: flex-start;
  justify-content: space-between;
}
.gh-footer__brand img { height: 20px; width: auto; }
.gh-footer__cols { display: flex; flex-wrap: wrap; gap: 48px; }
.gh-footer__col h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gh-text-muted);
  margin-bottom: 12px;
}
.gh-footer__col ul { list-style: none; margin: 0; padding: 0; }
.gh-footer__col li { margin-bottom: 8px; }
.gh-footer__col a { color: var(--gh-text-secondary); font-size: 14px; }
.gh-footer__legal {
  width: 100%;
  border-top: 1px solid var(--gh-divider);
  padding: 16px 24px;
  text-align: center;
  font-size: 12px;
  color: var(--gh-text-muted);
}

/* ==========================================================================
   Modal — .gh-modal (item modal, address modal)
   ========================================================================== */
.gh-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(26, 26, 25, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.gh-modal {
  position: relative;
  background: var(--gh-bg-white);
  border-radius: var(--gh-radius-card);
  box-shadow: var(--gh-shadow-elevated);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.gh-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--gh-bg-white);
  border-radius: var(--gh-radius-round);
  box-shadow: var(--gh-shadow-card);
  font-size: 20px;
  line-height: 1;
  color: var(--gh-text);
}
.gh-modal__close:hover { background: var(--gh-bg-gray); }

/* ==========================================================================
   Panel — .gh-panel (slide-in cart sidebar)
   ========================================================================== */
.gh-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(26, 26, 25, 0.45);
}
.gh-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1001;
  height: 100vh;
  width: 420px;
  max-width: 100vw;
  background: var(--gh-bg-white);
  box-shadow: var(--gh-shadow-panel);
  display: flex;
  flex-direction: column;
}
.gh-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gh-divider);
}
.gh-panel__body { flex: 1 1 auto; overflow-y: auto; padding: 16px 24px; }
.gh-panel__footer { border-top: 1px solid var(--gh-divider); padding: 16px 24px; }

/* ==========================================================================
   Quantity stepper — circular buttons (shared widget)
   ========================================================================== */
.gh-stepper {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.gh-stepper__btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  border: 1px solid var(--gh-border);
  background: var(--gh-bg-white);
  border-radius: var(--gh-radius-round);
  color: var(--gh-text);
}
.gh-stepper__btn:hover { background: var(--gh-bg-gray); }
.gh-stepper__btn:disabled { opacity: 0.4; cursor: not-allowed; }
.gh-stepper__value { min-width: 24px; text-align: center; font-weight: var(--gh-weight-bold); }
