/* ============================================================================
   MAS BUSINESS GROUP — LAYOUT  (Premium edition)
   Glass header, cinematic hero, offer marquee, premium footer, grids.
   ========================================================================== */

/* ---- Announcement bar — single welcome line (never wraps) -------------- */
.topbar {
  background: var(--grad-dark);
  color: #eaf3ec;
  font-size: var(--fs-300);
  display: flex; justify-content: center; align-items: center;
  padding: 9px 14px;
  letter-spacing: .015em;
  position: relative;
}
/* Keep the message on one line; gracefully ellipsis on narrow phones */
.topbar__msg {
  display: inline-block; max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar strong { color: var(--gold-2); }
.topbar a { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---- Sticky glass header ---------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.72);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(232,228,216,.7);
  transition: box-shadow var(--t), background var(--t), border-color var(--t);
}
.site-header.scrolled {
  background: rgba(255,255,255,.92);
  box-shadow: 0 6px 30px rgba(15,61,36,.08);
  border-color: var(--line);
}
.header-inner {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: clamp(12px, 3vw, 30px);
  min-height: var(--header-h);
}

/* Brand */
.brand { display: flex; align-items: center; gap: 13px; font-family: var(--font-head); font-weight: 700; white-space: nowrap; }
.brand__mark {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
  background: var(--grad-brand); color: #fff;
  border-radius: 14px; font-size: 1.02rem; letter-spacing: .02em; font-weight: 800;
  box-shadow: var(--shadow-brand);
  position: relative; overflow: hidden;
}
.brand__mark::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.35), transparent 45%);
}
/* Wordmark — colour & weight matched to the MAS logo (navy name, blue tagline) */
.brand__name { font-size: 1.42rem; font-weight: 800; line-height: 1.02; color: var(--brand-deep); letter-spacing: -.015em; }
.brand__name small {
  display: block; font-family: var(--font-body); font-size: .82rem; font-weight: 600;
  letter-spacing: .01em; text-transform: none; color: var(--brand); margin-top: 1px;
}
/* Logo wave mark + wordmark lockup (header + footer) — larger, on-brand */
.brand-mark { width: 58px; height: 58px; flex: none; display: block; }
.footer-brand .brand-mark { width: 60px; height: 60px; }
@media (max-width: 760px) { .brand__name { font-size: 1.28rem; } }
@media (max-width: 600px) {
  .brand-mark { width: 50px; height: 50px; }
  /* Phones: header shows the short "MAS Group" lockup so the menu button always
     fits; the full "MAS Business Group" still shows in the footer. */
  .site-header .brand__bz { display: none; }
  .site-header .brand__name { font-size: 1.16rem; line-height: 1.05; }
  .site-header .brand__name small { font-size: .72rem; }
}

/* Search */
.header-search {
  display: flex; align-items: center; max-width: 540px; width: 100%;
  background: rgba(244,242,234,.85);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 4px 4px 4px 20px;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
.header-search:focus-within { border-color: var(--brand); box-shadow: var(--ring); background: #fff; }
.header-search input { flex: 1; border: none; background: none; outline: none; padding: 9px 0; font-size: var(--fs-400); }
.header-search button {
  flex: none; width: 42px; height: 42px; display: grid; place-items: center;
  background: var(--grad-brand); color: #fff; border-radius: var(--radius-pill);
  transition: transform var(--t), box-shadow var(--t);
}
.header-search button:hover { transform: scale(1.05); box-shadow: var(--shadow-brand); }

/* Header actions */
.header-actions { display: flex; align-items: center; gap: 4px; }
.icon-btn {
  position: relative; display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 14px; color: var(--ink);
  transition: background var(--t), color var(--t), transform var(--t);
}
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); transform: translateY(-1px); }
.icon-btn svg { width: 23px; height: 23px; }
/* WhatsApp quick-contact icon in the header (all pages) */
.icon-btn--wa { color: var(--success); }
.icon-btn--wa:hover { background: rgba(37,165,101,.12); color: var(--success-dark); }
.cart-count {
  position: absolute; top: 3px; right: 3px; min-width: 19px; height: 19px; padding: 0 5px;
  display: grid; place-items: center; background: var(--grad-accent); color: #fff;
  font-size: .66rem; font-weight: 800; border-radius: var(--radius-pill); line-height: 1;
  box-shadow: 0 2px 8px rgba(232,92,50,.4); font-family: var(--font-head);
}

/* Primary nav */
.nav-toggle { display: none; }
.primary-nav { border-top: 1px solid rgba(232,228,216,.7); }
.primary-nav ul {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: clamp(14px, 2.4vw, 36px); list-style: none; padding: 0; min-height: 50px;
}
.primary-nav a {
  font-family: var(--font-head); font-weight: 600; font-size: var(--fs-400);
  color: var(--ink); padding: 13px 0; position: relative; transition: color var(--t);
}
.primary-nav a::after {
  content: ""; position: absolute; left: 0; bottom: 8px; width: 0; height: 2px;
  background: var(--grad-brand); border-radius: 2px; transition: width var(--t);
}
.primary-nav a:hover, .primary-nav a[aria-current="page"] { color: var(--brand); }
.primary-nav a:hover::after, .primary-nav a[aria-current="page"]::after { width: 100%; }
.primary-nav .nav-cta { color: var(--accent); }
.primary-nav .nav-cta::after { background: var(--grad-accent); }
/* Section labels — hidden in the desktop bar, shown inside the mobile drawer */
.nav-label { display: none; }
/* Drawer-only chrome (icons, header, footer) — hidden on the desktop bar */
.nav-ico, .drawer-head, .drawer-foot { display: none; }

/* ---- Offer marquee ----------------------------------------------------- */
.marquee {
  background: var(--brand-deep); color: #eaf3ec; overflow: hidden;
  border-block: 1px solid rgba(255,255,255,.08);
}
.marquee__track {
  display: flex; gap: 56px; width: max-content;
  padding: 12px 0; animation: marquee 32s linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee span { display: inline-flex; align-items: center; gap: 12px; font-size: var(--fs-300); letter-spacing: .04em; white-space: nowrap; }
.marquee span::before { content: "✦"; color: var(--gold-2); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---- Hero -------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; background: var(--grad-page); }
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(8px); z-index: 0; pointer-events: none;
}
.hero::before {
  width: 460px; height: 460px; top: -160px; right: -120px;
  background: radial-gradient(circle at 30% 30%, rgba(46,161,92,.22), transparent 70%);
}
.hero::after {
  width: 380px; height: 380px; bottom: -160px; left: -120px;
  background: radial-gradient(circle at 50% 50%, rgba(201,162,39,.16), transparent 70%);
}
.hero-inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.02fr .98fr; align-items: center;
  gap: clamp(28px, 5vw, 64px); padding: clamp(48px, 6vw, 96px) 0;
}
.hero-inner > * { min-width: 0; }   /* let grid tracks shrink so the image/headline never overflow on mobile */
.hero-copy .pill {
  display: inline-flex; align-items: center; gap: 9px;
  background: rgba(255,255,255,.8); border: 1px solid var(--line);
  color: var(--brand-dark); font-family: var(--font-head); font-weight: 600; font-size: var(--fs-300);
  padding: 8px 16px; border-radius: var(--radius-pill); box-shadow: var(--shadow-xs);
  backdrop-filter: blur(6px);
}
.hero-copy .pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(37,165,101,.18); }
.hero-copy h1 { margin: 22px 0 18px; max-width: min(15ch, 100%); overflow-wrap: break-word; }
.hero-copy h1 .hl { color: var(--brand); }
.hero-copy .lede { font-size: var(--fs-500); color: var(--muted); max-width: min(44ch, 100%); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.hero-stats {
  display: flex; flex-wrap: wrap; gap: clamp(20px, 4vw, 48px);
  margin-top: 40px; padding-top: 30px; border-top: 1px solid var(--line);
}
.hero-stats div strong {
  display: block; font-family: var(--font-display); font-weight: 600; font-size: var(--fs-600); color: var(--brand-dark);
}
.hero-stats div span { font-size: var(--fs-300); color: var(--muted); }

.hero-media { position: relative; z-index: 1; }
.hero-media__frame {
  position: relative; border-radius: var(--radius-xl); overflow: hidden;
  box-shadow: var(--shadow-lg); background: #fff;
  border: 1px solid rgba(255,255,255,.6);
}
.hero-media__frame img { width: 100%; height: 100%; object-fit: cover; }
/* Auto-rotating hero slideshow — slides crossfade every 2s (see app.js) */
.hero-slider { position: relative; width: 100%; aspect-ratio: 4 / 3; }
.hero-slide {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity .8s ease;
}
.hero-slide.is-active { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .hero-slide { transition: none; } }
/* Floating glass cards on the hero image */
.hero-chip {
  position: absolute; z-index: 2;
  display: flex; align-items: center; gap: 11px;
  background: rgba(255,255,255,.82); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.7);
  padding: 12px 16px; border-radius: 16px; box-shadow: var(--shadow);
  font-family: var(--font-head); font-weight: 700; font-size: var(--fs-300);
  animation: floaty 5s ease-in-out infinite;
}
.hero-chip .ic { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.hero-chip .ic svg { width: 18px; height: 18px; }
.hero-chip small { display: block; font-weight: 500; color: var(--muted); font-size: .72rem; }
.hero-chip--tl { top: 22px; left: -16px; }
.hero-chip--br { bottom: 24px; right: -16px; animation-delay: 1.2s; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

/* ---- Grids ------------------------------------------------------------- */
.grid { display: grid; gap: var(--gap); }
.product-grid { display: grid; gap: clamp(16px, 2vw, 26px); grid-template-columns: repeat(2, 1fr); }
.category-grid { display: grid; gap: clamp(18px, 2.5vw, 30px); grid-template-columns: repeat(3, 1fr); }
.benefits-grid { display: grid; gap: clamp(16px, 2vw, 26px); grid-template-columns: repeat(3, 1fr); }
.features-grid { display: grid; gap: clamp(16px, 2vw, 26px); grid-template-columns: repeat(4, 1fr); }

@media (min-width: 640px)  { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px)  { .product-grid { grid-template-columns: repeat(4, 1fr); } }

/* ---- Footer ------------------------------------------------------------ */
.site-footer {
  position: relative;
  background: var(--grad-dark);
  color: #c7d8cd;
  padding-top: clamp(52px, 7vw, 88px);
  margin-top: clamp(48px, 7vw, 96px);
}
.site-footer::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad-brand);
}
.footer-grid {
  display: grid; grid-template-columns: 1.7fr 1fr 1fr 1.3fr;
  gap: clamp(28px, 4vw, 52px); padding-bottom: 48px;
}
.footer-col h4 { color: #fff; font-size: 1rem; margin-bottom: 18px; letter-spacing: .01em; }
.footer-col ul { list-style: none; padding: 0; display: grid; gap: 11px; }
.footer-col a { color: #aec4b6; font-size: var(--fs-400); transition: color var(--t), padding-left var(--t); }
.footer-col a:hover { color: #fff; padding-left: 4px; }
.footer-brand .brand__name { color: #fff; }
.footer-brand .brand__name small { color: #8FCBFB; }
.footer-about { color: #a8c0b2; margin: 18px 0; max-width: 38ch; font-size: var(--fs-400); }
.footer-contact { display: grid; gap: 12px; font-size: var(--fs-400); }
.footer-contact a { display: flex; gap: 11px; align-items: flex-start; color: #c7d8cd; }
.footer-contact a:hover { color: #fff; }
.footer-contact svg { width: 18px; height: 18px; flex: none; color: var(--gold-2); margin-top: 3px; }

/* Official brand social icons */
.social { display: flex; gap: 10px; margin-top: 20px; }
.social a {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(255,255,255,.07); color: #cfe0ee; border: 1px solid rgba(255,255,255,.1);
  transition: transform var(--t), background var(--t), color var(--t), border-color var(--t);
}
.social a:hover { transform: translateY(-3px); color: #fff; }
.social a.wa:hover { background: #25D366; border-color: transparent; }
.social a.fb:hover { background: #1877F2; border-color: transparent; }
.social a.ig:hover { background: linear-gradient(45deg,#F58529,#DD2A7B,#8134AF); border-color: transparent; }
.social a.yt:hover { background: #FF0000; border-color: transparent; }
.social a.x:hover { background: #000; border-color: transparent; }
.social svg { width: 20px; height: 20px; }
.footer-legal {
  border-top: 1px solid rgba(255,255,255,.1); padding: 22px 0;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  font-size: var(--fs-300); color: #8aa595;
}
.footer-legal .cin { color: #b7cabd; }

/* ---- Mobile nav -------------------------------------------------------- */
@media (max-width: 880px) {
  /* Disable the glass backdrop-filter on mobile: it creates a containing block
     for fixed children, which would trap the slide-in drawer inside the header
     (capping its height). Solid header instead → drawer is full-height. */
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: #fff; }
  .site-header.scrolled { background: #fff; }
  /* Brand | flexible spacer | search-icon | actions — all on one row */
  .header-inner { grid-template-columns: auto 1fr auto auto; gap: 6px; }
  .brand { grid-column: 1; }
  /* Collapse the search box down to a single tappable icon (taps → /shop.html) */
  .header-search {
    grid-column: 3; grid-row: 1; align-self: center;
    width: 46px; height: 46px; max-width: none; margin: 0;
    padding: 0; background: none; border: none; border-radius: 14px;
  }
  .header-search:focus-within { background: none; border-color: transparent; box-shadow: none; }
  .header-search input { display: none; }
  .header-search button {
    width: 46px; height: 46px; background: none; color: var(--ink);
    border-radius: 14px; box-shadow: none;
  }
  .header-search button:hover { background: var(--brand-soft); color: var(--brand); transform: none; box-shadow: none; }
  .header-actions { grid-column: 4; grid-row: 1; }
  .nav-toggle { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; }
  .nav-toggle:hover { background: var(--brand-soft); color: var(--brand); }
  /* ---- Premium slide-in drawer (the "three-line" hamburger menu) ---- */
  .primary-nav {
    position: fixed; inset: 0 0 0 auto; width: min(88vw, 360px);
    transform: translateX(100%); transition: transform var(--t-slow);
    border-top: none; box-shadow: var(--shadow-lg); background: #fff;
    padding: 0; z-index: 120; display: flex; flex-direction: column;
  }
  .primary-nav.open { transform: translateX(0); }
  .primary-nav .container { width: 100%; margin: 0; padding: 0; display: flex; flex-direction: column; flex: 1; min-height: 0; }

  .drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
  .drawer-title { font-family: var(--font-head); font-weight: 800; font-size: 1.05rem; color: var(--brand-deep); }
  .drawer-close { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--ink); }
  .drawer-close:hover { background: var(--bg-soft); color: var(--brand); }

  .primary-nav ul { flex: 1; min-height: 0; overflow-y: auto; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 3px; padding: 14px; }
  .primary-nav a {
    display: flex; align-items: center; gap: 13px; padding: 11px 12px;
    border: none; border-radius: 14px; font-family: var(--font-head); font-weight: 600;
    font-size: 1.02rem; color: var(--ink);
  }
  .primary-nav a::after { display: none; }
  .primary-nav a:hover { background: var(--bg-soft); }
  .primary-nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-dark); }
  .nav-ico { display: inline-flex; flex: none; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 11px; background: var(--brand-soft); color: var(--brand); }
  .nav-ico svg { width: 19px; height: 19px; }
  .primary-nav a[aria-current="page"] .nav-ico { background: var(--grad-brand); color: #fff; }
  .nav-cta { color: var(--accent); }
  .nav-cta .nav-ico { background: #FCEDE5; color: var(--accent); }
  .nav-cta[aria-current="page"] { background: #FCEDE5; color: var(--accent-dark); }

  .nav-label {
    display: block; padding: 16px 12px 4px;
    font-family: var(--font-head); font-weight: 800; font-size: var(--fs-300);
    letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  }

  .drawer-foot { display: grid; gap: 10px; padding: 16px 18px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
  .drawer-call { display: flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--font-head); font-weight: 700; color: var(--brand-dark); padding: 6px; }

  /* Sits BELOW the sticky header (z-index 100) so the drawer — which lives
     inside the header's stacking context — always paints on top of it. */
  .nav-backdrop {
    position: fixed; inset: 0; background: rgba(6,40,92,.45); backdrop-filter: blur(3px);
    opacity: 0; visibility: hidden; transition: opacity var(--t); z-index: 95;
  }
  .nav-backdrop.open { opacity: 1; visibility: visible; }
}

@media (max-width: 760px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
  .hero-chip--tl { left: 8px; } .hero-chip--br { right: 8px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .benefits-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .category-grid { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  /* Declutter the header on phones so brand + search + cart + menu always fit.
     Track + WhatsApp stay reachable (WhatsApp via the floating button + drawer). */
  .header-actions { gap: 2px; }
  .icon-btn { width: 42px; height: 42px; }
  .icon-btn svg { width: 21px; height: 21px; }
  .icon-btn--track { display: none; }   /* still reachable inside the menu */
  .site-header .icon-btn--wa { display: none; }  /* redundant: floating WhatsApp button is always on screen */
  .header-search, .header-search button { width: 42px; height: 42px; }
  .header-search button svg { width: 21px; height: 21px; }
}
@media (max-width: 520px) {
  /* Fraunces 'ch' runs wide — shrink the hero headline so it never clips on phones */
  .hero-copy h1 { font-size: clamp(2rem, 8.2vw, 2.6rem); line-height: 1.1; }
}
@media (max-width: 460px) {
  .footer-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .brand__name { font-size: 1.08rem; }
  .hero-chip { display: none; }
}
/* ---- Small phones (≤400px): tighten gutters + brand so nothing stretches --- */
@media (max-width: 400px) {
  .container, .container--wide { width: calc(100% - 24px); }
  .header-inner { gap: 4px; }
  .header-actions { gap: 0; }
  .site-header .brand-mark { width: 42px; height: 42px; }
  .site-header .brand__name { font-size: 1.02rem; }
}
