/* ==========================================================================
   Uniy Designz — site layout: utility bar, header, mega menu, mobile nav,
   footer, chat launcher. Depends on tokens.css + base.css + components.css.
   Markup: assets/components/header.html + footer.html; behavior: main.js.
   ========================================================================== */

/* ---- Header shell ----------------------------------------------------------
   The sticky header is the containing block for the full-width mega menu,
   so nothing between it and .mega may be positioned. */
.site-header {
  position: sticky; top: 0; z-index: var(--z-header);
  background: #fff; border-bottom: 1px solid var(--border-color);
}

/* ---- Utility bar ------------------------------------------------------------ */
.utility-bar { background: var(--background-secondary); border-bottom: 1px solid var(--border-color); font-size: 13px; color: var(--text-secondary); }
.utility-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 34px; }
.utility-inner a { color: var(--text-primary); font-weight: 500; }
.utility-inner a:hover { color: var(--brand-magenta-dark); }
.utility-sep { margin: 0 var(--space-2); color: var(--border-strong); }
.utility-extra, .utility-sep, .utility-links { display: none; }
.utility-links { gap: var(--space-5); }
@media (min-width: 768px) { .utility-extra, .utility-sep { display: inline; } .utility-links { display: flex; } }
@media (max-width: 767px) { .utility-inner { justify-content: center; } }

/* ---- Main bar --------------------------------------------------------------- */
.nav-bar { display: flex; align-items: center; gap: var(--space-4); min-height: 72px; }
.brand-mark { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand-mark-logo { height: 52px; width: auto; }
.nav-burger { margin-left: -10px; }
.nav-burger svg { width: 22px; height: 22px; }

.main-nav { display: none; flex: 1; }
.main-nav-list { display: flex; align-items: stretch; justify-content: center; gap: var(--space-1); }
.main-nav-link {
  display: inline-flex; align-items: center; gap: 6px; height: 72px; padding: 0 var(--space-4);
  border: 0; background: none; font-size: 15px; font-weight: 500; color: var(--text-primary);
  position: relative;
}
.main-nav-link svg { width: 14px; height: 14px; color: var(--text-muted); transition: transform var(--duration-fast) ease; }
.main-nav-link::after {
  content: ""; position: absolute; left: var(--space-4); right: var(--space-4); bottom: -1px; height: 2px;
  background: var(--brand-magenta); transform: scaleX(0); transition: transform var(--duration-fast) ease;
}
.main-nav-link:hover::after, .main-nav-link[aria-expanded="true"]::after { transform: scaleX(1); }
.main-nav-link[aria-expanded="true"] svg { transform: rotate(180deg); }
.main-nav-link:focus-visible { outline-offset: -4px; }

.nav-actions { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.cart-link { position: relative; }
.cart-link svg { width: 22px; height: 22px; }
.cart-badge {
  position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--radius-full); background: var(--brand-magenta); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.nav-cta { display: none; }

@media (min-width: 1024px) {
  .nav-bar { min-height: 80px; gap: var(--space-6); }
  .brand-mark-logo { height: 60px; }
  .main-nav-link { height: 80px; }
  .main-nav { display: block; }
  .nav-burger { display: none; }
  .nav-actions { margin-left: 0; }
  .nav-cta { display: inline-flex; }
}

/* ---- Mega menu -------------------------------------------------------------- */
.mega {
  position: absolute; left: 0; right: 0; top: 100%; z-index: var(--z-dropdown);
  background: #fff; border-top: 1px solid var(--border-color); border-bottom: 1px solid var(--border-color);
  box-shadow: 0 24px 40px -24px rgba(32, 33, 42, .25);
  max-height: calc(100vh - 120px); overflow-y: auto;
}
/* Browse layout: category rail (left) + the active category's pane (right).
   Each pane sits in the DOM right after its rail link, so keyboard focus
   moves link -> that category's products -> next category. */
.mega-browse { position: relative; min-height: 540px; padding-top: var(--space-6); padding-bottom: var(--space-8); }
.mega-rail { width: 240px; padding-right: var(--space-4); border-right: 1px solid var(--border-color); }
.mega-rail-group { margin: var(--space-4) 0 var(--space-1); padding: 0 var(--space-3); font-size: 11px; font-weight: 600; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-muted); }
.mega-rail-group:first-child { margin-top: 0; }
.mega-rail-link {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  padding: 7px var(--space-3); border-radius: var(--radius-sm); font-size: 15px; font-weight: 500; color: var(--text-primary);
}
.mega-rail-link svg { width: 14px; height: 14px; color: var(--text-muted); opacity: 0; transition: opacity var(--duration-fast) ease; }
.mega-rail-item.is-active > .mega-rail-link { background: var(--background-secondary); color: var(--brand-magenta-dark); }
.mega-rail-item.is-active > .mega-rail-link svg { opacity: 1; color: var(--brand-magenta); }

.mega-pane {
  display: none; position: absolute; top: var(--space-6); bottom: var(--space-8);
  left: calc(var(--container-gutter) + 240px + var(--space-8)); right: var(--container-gutter); overflow-y: auto;
}
.mega-rail-item.is-active > .mega-pane { display: block; }
.mega-pane-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); padding-bottom: var(--space-4); margin-bottom: var(--space-5); border-bottom: 1px solid var(--border-color); }
.mega-pane-title { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 600; }
.mega-pane-all { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); font-weight: 600; color: var(--brand-magenta-dark); }
.mega-pane-all svg { width: 15px; height: 15px; }
.mega-pane-all:hover { text-decoration: underline; text-underline-offset: 3px; }
.mega-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-6) var(--space-8); }
.mega-type-link { display: inline-block; font-weight: 600; font-size: 15px; margin-bottom: var(--space-3); }
.mega-type-link:hover { color: var(--brand-magenta-dark); }
.mega-type-empty { font-size: var(--text-sm); color: var(--text-muted); }
.mega-products { display: grid; gap: var(--space-2); }
.mega-product { display: flex; align-items: center; gap: var(--space-3); padding: 4px; margin: -4px; border-radius: var(--radius-sm); }
.mega-product:hover { background: var(--background-secondary); }
.mega-product-thumb { flex-shrink: 0; width: 48px; height: 48px; border-radius: var(--radius-sm); background: var(--background-tertiary); overflow: hidden; }
.mega-product-thumb picture, .mega-product-thumb img { display: block; width: 100%; height: 100%; }
.mega-product-thumb img { object-fit: contain; padding: 4px; background: #fff; }
.mega-product-name { font-size: var(--text-sm); color: var(--text-secondary); line-height: var(--leading-snug); }
.mega-product:hover .mega-product-name { color: var(--text-primary); }

/* ---- Dropdowns (Occasions, Custom Shops) ------------------------------------------------ */
.main-nav-item.has-dropdown { position: relative; }
.dropdown {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%); z-index: var(--z-dropdown);
  width: 380px; background: #fff; border: 1px solid var(--border-color); border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.dropdown-list { padding: var(--space-2); }
.dropdown-list a { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); }
.dropdown-list a:hover { background: var(--background-secondary); }
.dropdown-list strong { font-size: 15px; font-weight: 600; }
.dropdown-list span { font-size: var(--text-sm); color: var(--text-secondary); }
.dropdown-foot { display: flex; align-items: center; justify-content: space-between; padding: var(--space-3) var(--space-6); border-top: 1px solid var(--border-color); background: var(--background-secondary); font-size: var(--text-sm); font-weight: 600; }
.dropdown-foot svg { width: 16px; height: 16px; }
.dropdown-foot:hover { color: var(--brand-magenta-dark); }

/* ---- Mobile nav (drawer) ------------------------------------------------------ */
.mobile-nav .drawer-head .brand-mark-logo { height: 44px; }
.mobile-nav-heading { margin: var(--space-6) 0 var(--space-2); font-size: 11px; font-weight: 600; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-muted); }
.mobile-nav-links a { display: block; padding: var(--space-3) 0; border-bottom: 1px solid var(--border-color); font-weight: 500; }
.mobile-acc { border-bottom: 1px solid var(--border-color); }
.mobile-acc summary {
  display: flex; align-items: center; justify-content: space-between; padding: var(--space-3) 0;
  font-weight: 500; cursor: pointer; list-style: none;
}
.mobile-acc summary::-webkit-details-marker { display: none; }
.mobile-acc summary svg { width: 16px; height: 16px; color: var(--text-muted); transition: transform var(--duration-fast) ease; }
.mobile-acc[open] summary svg { transform: rotate(180deg); }
.mobile-acc ul { padding: 0 0 var(--space-3) var(--space-4); display: grid; gap: var(--space-1); }
.mobile-acc ul a { display: block; padding: 6px 0; font-size: 15px; color: var(--text-secondary); }
.mobile-acc-label { margin-top: var(--space-2); font-size: 11px; font-weight: 600; letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-muted); }

/* ---- Footer ----------------------------------------------------------------- */
.site-footer { margin-top: var(--space-24); background: var(--background-secondary); border-top: 1px solid var(--border-color); position: relative; font-size: var(--text-sm); color: var(--text-secondary); }
.site-footer::before { content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 2px; background: var(--brand-gold-gradient); opacity: .75; }
.footer-grid { display: grid; gap: var(--space-10) var(--space-8); grid-template-columns: repeat(2, minmax(0, 1fr)); padding: var(--space-16) 0 var(--space-12); }
.footer-brand { grid-column: 1 / -1; }
/* The approved logo is on white; multiply lets the footer grey show through
   without altering the artwork. */
.footer-logo { height: 88px; width: auto; mix-blend-mode: multiply; }
.footer-blurb { margin-top: var(--space-4); max-width: 340px; }
.footer-social { display: flex; gap: var(--space-2); margin-top: var(--space-5); }
.footer-social a { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid var(--border-strong); border-radius: var(--radius-full); color: var(--text-secondary); background: #fff; }
.footer-social a:hover { color: var(--text-primary); border-color: var(--text-primary); }
.footer-social svg { width: 17px; height: 17px; }
.footer-col-title { font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); margin-bottom: var(--space-4); }
.footer-links, .footer-contact { display: grid; gap: var(--space-3); }
.footer-links a:hover, .footer-contact a:hover { color: var(--text-primary); text-decoration: underline; text-underline-offset: 3px; }
.footer-news-title { margin-top: var(--space-8); }
.newsletter-form .input { min-height: 40px; font-size: var(--text-sm); }
.newsletter-form .btn { min-height: 40px; }
.footer-news-status { margin-top: var(--space-2); color: var(--color-success); }
.footer-bottom { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-6) 0; border-top: 1px solid var(--border-color); font-size: var(--text-xs); }
.footer-bottom a { text-decoration: underline; text-underline-offset: 2px; }
@media (min-width: 768px) {
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-bottom { flex-direction: row; justify-content: space-between; }
}
@media (min-width: 1100px) {
  .footer-grid { grid-template-columns: 1.6fr repeat(4, minmax(0, 1fr)); }
  .footer-brand { grid-column: auto; }
}

/* ---- Chat launcher ----------------------------------------------------------- */
.chat-launcher {
  position: fixed; bottom: var(--space-5); right: var(--space-5); z-index: 150;
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; padding: 0 var(--space-4);
  border: 1px solid var(--border-strong); border-radius: var(--radius-full); background: #fff; color: var(--text-primary);
  font-size: var(--text-sm); font-weight: 600; box-shadow: var(--shadow-md);
}
.chat-launcher:hover { border-color: var(--text-primary); }
.chat-launcher svg { width: 18px; height: 18px; color: var(--brand-teal-dark); }
.chat-panel {
  display: none; position: fixed; bottom: 76px; right: var(--space-5); z-index: 150;
  width: min(340px, calc(100vw - 32px)); background: #fff; border: 1px solid var(--border-color); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: var(--space-5);
}
.chat-panel.open { display: block; }
.chat-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-3); }
.chat-panel-title { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; }
.chat-form { display: grid; gap: var(--space-3); }
@media (max-width: 480px) {
  .chat-launcher span { display: none; }
  .chat-launcher { padding: 0; width: 48px; justify-content: center; }
}
