/* ==========================================================================
   GLOBAIA SUPERMARKET — Design Tokens & Base Styles
   Palette derived from logo: leaf-green basket, golden-yellow wordmark,
   charcoal header band, striped "harvest-row" cart mark.
   ========================================================================== */

:root {
  /* Color */
  --globaia-green: #2E9C4B;       /* primary brand green (leaf/basket) */
  --globaia-green-dark: #1F7A38;  /* hover/active state */
  --globaia-yellow: #F2B807;      /* accent / CTA / price highlight */
  --globaia-charcoal: #1A1D1A;    /* header & footer band, matches logo bg */
  --globaia-sage-tint: #EEF6EC;   /* soft section background */
  --globaia-ink: #20241F;         /* headings */
  --globaia-slate: #5B6660;       /* body text */
  --globaia-line: #E1E8DF;        /* hairline borders */
  --globaia-white: #FFFFFF;

  /* Type */
  --font-display: 'Outfit', 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Shape language — derived from the logo's curved basket + leaf scallop */
  --scallop-radius: 28px;
  --radius-card: 14px;
  --radius-pill: 999px;

  /* Spacing rhythm */
  --space-section: 4.5rem;
}

body {
  font-family: var(--font-body);
  color: var(--globaia-slate);
  background: var(--globaia-white);
}

h1, h2, h3, h4, .display-font {
  font-family: var(--font-display);
  color: var(--globaia-ink);
  font-weight: 700;
  letter-spacing: -0.01em;
}

a { color: var(--globaia-green-dark); text-decoration: none; }
a:hover { color: var(--globaia-green); }

/* Focus visibility kept intentionally strong — grocery checkout flows
   need accessible keyboard nav, this isn't optional polish. */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--globaia-yellow);
  outline-offset: 2px;
}

/* ==========================================================================
   Top utility strip
   ========================================================================== */
.utility-strip {
  background: var(--globaia-charcoal);
  color: #CFE8D5;
  font-size: 0.85rem;
}
.utility-strip a { color: #CFE8D5; }
.utility-strip a:hover { color: var(--globaia-yellow); }
.utility-strip .badge-pay {
  background: var(--globaia-green);
  color: var(--globaia-white);
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.7rem;
  font-weight: 600;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  background: var(--globaia-white);
  border-bottom: 1px solid var(--globaia-line);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.brand-mark img {
  height: 56px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-tagline {
  font-size: 0.75rem;
  color: var(--globaia-slate);
  font-weight: 500;
  letter-spacing: 0.03em;
}

.search-pill {
  display: flex;
  align-items: stretch;
  width: 100%;
  border: 1.5px solid var(--globaia-line);
  border-radius: var(--radius-pill);
  background: var(--globaia-sage-tint);
  overflow: hidden;
}
.search-pill input {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0.65rem 1.2rem;
}
.search-pill input:focus { outline: none; box-shadow: none; }
.search-pill button {
  flex: 0 0 46px;
  background: var(--globaia-green);
  border: none;
  color: var(--globaia-white);
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-pill button:hover { background: var(--globaia-green-dark); }

.cart-pill {
  background: var(--globaia-sage-tint);
  border-radius: var(--radius-pill);
  padding: 0.5rem 1rem;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.cart-pill .count-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--globaia-yellow);
  color: var(--globaia-ink);
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Category bar — the striped "harvest-row" motif from the cart icon
   reappears here as a thin multi-tone underline instead of a flat border.
   ========================================================================== */
.category-bar {
  background: var(--globaia-white);
  position: relative;
}
.category-bar::after {
  content: "";
  display: block;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--globaia-green) 0 18%,
    #6CC36F 18% 36%,
    var(--globaia-yellow) 36% 50%,
    var(--globaia-green) 50% 68%,
    #6CC36F 68% 86%,
    var(--globaia-yellow) 86% 100%
  );
}
.category-bar .nav-link {
  color: var(--globaia-ink);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  padding: 0.9rem 0.9rem;
}
.category-bar .nav-link:hover { color: var(--globaia-green-dark); }

.all-categories-btn {
  background: var(--globaia-ink);
  color: var(--globaia-white);
  border-radius: var(--radius-pill);
  padding: 0.85rem 1.4rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  border: none;
}
.all-categories-btn .count {
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-pill);
  padding: 0.15rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 500;
}

/* ==========================================================================
   Hero — signature scallop divider replaces a hard rectangle edge,
   nodding to the leaf/basket curve in the logo.
   ========================================================================== */
.hero {
  position: relative;
  background: var(--globaia-ink);
  color: var(--globaia-white);
  overflow: hidden;
  padding-bottom: var(--scallop-radius);
}
.hero .hero-inner {
  position: relative;
  z-index: 2;
  padding: 4rem 1rem 5rem;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(46, 156, 75, 0.25);
  border: 1px solid rgba(108, 195, 111, 0.5);
  color: #BFE8C4;
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
}
.hero h1 {
  color: var(--globaia-white);
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  line-height: 1.08;
}
.hero h1 .accent { color: var(--globaia-yellow); }
.hero p.lede {
  color: #D8E6D9;
  font-size: 1.05rem;
  max-width: 32rem;
}
.btn-globaia-primary {
  background: var(--globaia-green);
  color: var(--globaia-white);
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.8rem 1.6rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.btn-globaia-primary:hover { background: var(--globaia-green-dark); color: var(--globaia-white); }

/* The scallop: a row of overlapping circles forming a leaf-like wave,
   used as the hero's bottom edge instead of a straight cut. */
.hero-scallop {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: var(--scallop-radius);
  background-color: var(--globaia-white);
  -webkit-mask-image: radial-gradient(circle at 10px 0, transparent 14px, black 15px);
  mask-image: radial-gradient(circle at 10px 0, transparent 14px, black 15px);
  -webkit-mask-size: 28px var(--scallop-radius);
  mask-size: 28px var(--scallop-radius);
  -webkit-mask-repeat: repeat-x;
  mask-repeat: repeat-x;
}

/* ==========================================================================
   Section rhythm & cards
   ========================================================================== */
.section { padding: var(--space-section) 0; }
.section-tint { background: var(--globaia-sage-tint); }

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.8rem;
}
.section-heading .view-all {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--globaia-green-dark);
}

.product-gallery-frame {
    padding: 0;
    overflow: hidden;
    border-radius: var(--radius-card);
}

.product-main-image {
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}
.product-card {
  background: var(--globaia-white);
  border: 1px solid var(--globaia-line);
  border-radius: var(--radius-card);
  padding: 1rem;
  height: 100%;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.product-card:hover {
  box-shadow: 0 10px 24px -12px rgba(26,29,26,0.18);
  transform: translateY(-2px);
}
.product-card .price {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--globaia-ink);
}
.product-card .price .old {
  font-family: var(--font-body);
  font-weight: 400;
  text-decoration: line-through;
  color: #A6AEA3;
  font-size: 0.85rem;
  margin-left: 0.4rem;
}
.badge-discount {
  background: var(--globaia-yellow);
  color: var(--globaia-ink);
  font-weight: 700;
  font-size: 0.72rem;
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.55rem;
}
.btn-add-cart {
  background: var(--globaia-sage-tint);
  color: var(--globaia-green-dark);
  border: 1px solid var(--globaia-line);
  border-radius: var(--radius-pill);
  font-weight: 600;
  width: 100%;
  padding: 0.5rem;
}
.btn-add-cart:hover {
  background: var(--globaia-green);
  color: var(--globaia-white);
  border-color: var(--globaia-green);
}

/* Category tile — uses the striped motif as a quiet background accent */
.category-tile {
  border-radius: var(--radius-card);
  background: var(--globaia-white);
  border: 1px solid var(--globaia-line);
  text-align: center;
  padding: 1.4rem 0.8rem;
  display: block;
  color: var(--globaia-ink);
  font-weight: 600;
  font-size: 0.9rem;
}
.category-tile:hover {
  border-color: var(--globaia-green);
  color: var(--globaia-ink);
}
.category-tile .icon-wrap {
  width: 56px; height: 56px;
  margin: 0 auto 0.7rem;
  border-radius: 50%;
  background: var(--globaia-sage-tint);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  color: var(--globaia-green-dark);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--globaia-charcoal);
  color: #B9C7BA;
  position: relative;
  padding-top: calc(var(--scallop-radius) + 3rem);
}
.footer-scallop {
  position: absolute;
  left: 0; right: 0; top: -1px;
  height: var(--scallop-radius);
  background-color: var(--globaia-white);
  -webkit-mask-image: radial-gradient(circle at 10px var(--scallop-radius), transparent 14px, black 15px);
  mask-image: radial-gradient(circle at 10px var(--scallop-radius), transparent 14px, black 15px);
  -webkit-mask-size: 28px var(--scallop-radius);
  mask-size: 28px var(--scallop-radius);
  -webkit-mask-repeat: repeat-x;
  mask-repeat: repeat-x;
  transform: scaleY(-1);
  background: var(--globaia-charcoal);
}
.site-footer h6 {
  color: var(--globaia-white);
  font-family: var(--font-display);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
.site-footer a { color: #B9C7BA; }
.site-footer a:hover { color: var(--globaia-yellow); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 0.82rem;
  padding: 1.2rem 0;
  color: #8B9A8C;
}

/* ==========================================================================
   Status pills — used on product cards (out of stock) and the product
   detail page (in stock / out of stock). Mirrors the admin theme's
   status-pill so both areas stay visually consistent.
   ========================================================================== */
.status-pill {
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.status-pill.active { background: #E3F5E6; color: var(--globaia-green-dark); }
.status-pill.inactive { background: #F3E9E9; color: #A33B3B; }

/* ==========================================================================
   Cart toast — small confirmation popup shown after adding to cart.
   Auto-dismisses; see cart.js for the show/hide timing.
   ========================================================================== */
.cart-toast {
  background: var(--globaia-ink);
  color: #fff;
  border-radius: var(--radius-card);
  padding: 0.85rem 1rem;
  box-shadow: 0 12px 28px -8px rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.cart-toast.cart-toast-visible {
  opacity: 1;
  transform: translateX(0);
}
.cart-toast .cart-toast-icon {
  color: var(--globaia-green);
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 991.98px) {
  .hero .hero-inner { padding: 3rem 1rem 4rem; text-align: center; }
  .hero p.lede { margin-left: auto; margin-right: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .product-card { transition: none; }
  .product-card:hover { transform: none; }
}