:root {
  --bww-ink: #161616;
  --bww-muted: #6f6b65;
  --bww-line: #e7e3dc;
  --bww-soft: #f7f5f1;
  --bww-gold: #b79a60;
  --bww-gold-dark: #947847;
  --bww-white: #fff;
}

.bww-header,
.bww-header * { box-sizing: border-box; }
.bww-header { background: var(--bww-white); color: var(--bww-ink); position: sticky; top: 0; z-index: 9999; box-shadow: 0 1px 0 rgba(0,0,0,.06); }
.admin-bar .bww-header { top: 32px; }
.bww-shell { width: min(100% - 40px, 1440px); margin-inline: auto; }

.bww-servicebar { background: #151515; color: #fff; font-size: 12px; letter-spacing: .035em; }
.bww-servicebar__inner { min-height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.bww-servicebar__left, .bww-servicebar__right { display: flex; align-items: center; gap: 14px; }
.bww-servicebar a { color: #fff; text-decoration: none; opacity: .9; }
.bww-servicebar a:hover { color: #fff; opacity: 1; }
.bww-servicebar__dot { color: var(--bww-gold); }

.bww-mainbar { background: #fff; }
.bww-mainbar__inner { min-height: 92px; display: grid; grid-template-columns: minmax(180px, 260px) minmax(320px, 1fr) auto; align-items: center; gap: clamp(24px,3vw,52px); }
.bww-branding__link { display: inline-flex; align-items: center; color: var(--bww-ink); text-decoration: none; }
.bww-branding__logo { width: auto; max-width: 240px; max-height: 66px; object-fit: contain; display: block; }
.bww-branding__name { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }

.bww-search { height: 48px; border: 1px solid #d9d5ce; border-radius: 3px; display: flex; background: #fff; overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.bww-search:focus-within { border-color: var(--bww-gold); box-shadow: 0 0 0 3px rgba(183,154,96,.12); }
.bww-search input[type="search"] { flex: 1; min-width: 0; border: 0 !important; outline: 0; padding: 0 16px; font-size: 14px; color: var(--bww-ink); background: transparent; box-shadow: none !important; }
.bww-search input::placeholder { color: #918d86; }
.bww-search button { width: 50px; display: grid; place-items: center; border: 0; background: transparent; color: var(--bww-ink); cursor: pointer; }
.bww-search button:hover { background: var(--bww-soft); }
.bww-search svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.bww-actions { display: flex; align-items: center; gap: 22px; }
.bww-action { position: relative; min-width: 54px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--bww-ink) !important; text-decoration: none !important; font-size: 11px; white-space: nowrap; background: none; border: 0; padding: 0; cursor: pointer; }
.bww-action svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.bww-action:hover { color: var(--bww-gold-dark) !important; }
.bww-action__icon-wrap { position: relative; line-height: 0; }
.bww-cart-count { position: absolute; top: -8px; right: -10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 10px; background: var(--bww-gold); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; line-height: 1; }
.bww-action--search { display: none; }

.bww-navrow { border-top: 1px solid var(--bww-line); border-bottom: 1px solid var(--bww-line); background: #fff; }
.bww-navrow__inner { min-height: 56px; display: flex; align-items: stretch; justify-content: space-between; gap: 28px; }
.bww-primary-nav { min-width: 0; flex: 1; }
.bww-menu { list-style: none; margin: 0 !important; padding: 0 !important; display: flex; align-items: stretch; gap: clamp(16px,2.2vw,36px); height: 100%; }
.bww-menu > li { position: relative; display: flex; align-items: stretch; margin: 0; padding: 0; }
.bww-menu > li > a { position: relative; display: flex; align-items: center; color: var(--bww-ink) !important; text-decoration: none !important; font-size: 14px; font-weight: 600; letter-spacing: .01em; white-space: nowrap; padding: 0; }
.bww-menu > li > a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -1px; height: 2px; background: var(--bww-gold); transition: right .2s ease; }
.bww-menu > li:hover > a::after, .bww-menu > li.current-menu-item > a::after, .bww-menu > li.current-menu-ancestor > a::after { right: 0; }

.bww-menu .sub-menu { display: block !important; visibility: hidden; opacity: 0; transform: translateY(8px); pointer-events: none; position: absolute; top: 100%; left: -18px; min-width: 240px; margin: 0 !important; padding: 12px 0 !important; list-style: none; background: #fff; border: 1px solid var(--bww-line); box-shadow: 0 18px 45px rgba(0,0,0,.12); transition: opacity .18s ease, transform .18s ease, visibility .18s; z-index: 30; }
.bww-menu li:hover > .sub-menu, .bww-menu li:focus-within > .sub-menu { visibility: visible; opacity: 1; transform: translateY(0); pointer-events: auto; }
.bww-menu .sub-menu li { position: relative; margin: 0; padding: 0; }
.bww-menu .sub-menu a { display: block; padding: 10px 18px; color: var(--bww-ink) !important; text-decoration: none !important; font-size: 13px; line-height: 1.35; }
.bww-menu .sub-menu a:hover { background: var(--bww-soft); color: var(--bww-gold-dark) !important; }
.bww-menu .sub-menu .sub-menu { top: -13px; left: 100%; }

.bww-quote { align-self: center; display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 20px; background: var(--bww-ink); color: #fff !important; text-decoration: none !important; border: 1px solid var(--bww-ink); font-size: 12px; font-weight: 700; letter-spacing: .035em; white-space: nowrap; transition: background .2s, border-color .2s; }
.bww-quote:hover { background: var(--bww-gold-dark); border-color: var(--bww-gold-dark); color: #fff !important; }

.bww-mobile-toggle, .bww-mobile-panel, .bww-mobile-search { display: none; }

@media (max-width: 1100px) {
  .bww-mainbar__inner { grid-template-columns: 210px minmax(240px,1fr) auto; gap: 20px; }
  .bww-branding__logo { max-width: 205px; }
  .bww-actions { gap: 14px; }
  .bww-menu { gap: 18px; }
  .bww-menu > li > a { font-size: 13px; }
  .bww-quote { padding-inline: 14px; }
}

@media (max-width: 900px) {
  .bww-shell { width: min(100% - 28px, 1440px); }
  .bww-servicebar__inner { justify-content: center; min-height: 30px; }
  .bww-servicebar__left span:not(:first-child), .bww-servicebar__right { display: none; }
  .bww-servicebar__left { gap: 0; }
  .bww-mainbar__inner { min-height: 70px; grid-template-columns: 42px 1fr auto; gap: 12px; }
  .bww-mobile-toggle { width: 40px; height: 40px; border: 0; background: transparent; padding: 9px 7px; display: flex; flex-direction: column; justify-content: center; gap: 5px; cursor: pointer; }
  .bww-mobile-toggle span { display: block; width: 24px; height: 1.5px; background: var(--bww-ink); }
  .bww-branding { text-align: center; min-width: 0; }
  .bww-branding__link { justify-content: center; max-width: 100%; }
  .bww-branding__logo { max-width: min(200px, 46vw); max-height: 52px; }
  .bww-search, .bww-navrow { display: none; }
  .bww-actions { gap: 10px; }
  .bww-action { min-width: 34px; }
  .bww-action span:not(.bww-action__icon-wrap):not(.bww-cart-count) { display: none; }
  .bww-action--search { display: flex; }
  .bww-action svg { width: 22px; height: 22px; }
  .bww-mobile-search { display: block; border-top: 1px solid var(--bww-line); padding: 10px 0; background: #fff; }
  .bww-mobile-search[hidden] { display: none; }
  .bww-search--mobile { display: flex; height: 44px; }

  .bww-mobile-panel { display: block; position: fixed; inset: 0; z-index: 99999; visibility: hidden; pointer-events: none; }
  .bww-mobile-panel.is-open { visibility: visible; pointer-events: auto; }
  .bww-mobile-panel__overlay { position: absolute; inset: 0; background: rgba(0,0,0,.42); opacity: 0; transition: opacity .22s; }
  .bww-mobile-panel.is-open .bww-mobile-panel__overlay { opacity: 1; }
  .bww-mobile-panel__drawer { position: absolute; top: 0; left: 0; width: min(88vw, 390px); height: 100%; background: #fff; transform: translateX(-102%); transition: transform .24s ease; overflow-y: auto; box-shadow: 16px 0 40px rgba(0,0,0,.15); }
  .bww-mobile-panel.is-open .bww-mobile-panel__drawer { transform: translateX(0); }
  .bww-mobile-panel__head { height: 68px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--bww-line); }
  .bww-mobile-panel__head strong { font-size: 16px; letter-spacing: .02em; }
  .bww-mobile-close { border: 0; background: none; width: 40px; height: 40px; font-size: 30px; line-height: 1; font-weight: 300; cursor: pointer; color: var(--bww-ink); }
  .bww-mobile-menu, .bww-mobile-menu ul, .bww-mobile-nav .bww-menu { list-style: none; margin: 0 !important; padding: 0 !important; display: block; height: auto; }
  .bww-mobile-menu > li, .bww-mobile-nav .bww-menu > li { position: relative; display: block; border-bottom: 1px solid var(--bww-line); }
  .bww-mobile-menu a, .bww-mobile-nav .bww-menu a { display: block; padding: 15px 52px 15px 20px; color: var(--bww-ink) !important; text-decoration: none !important; font-size: 14px; font-weight: 600; }
  .bww-mobile-menu .sub-menu { position: static !important; display: none !important; visibility: visible !important; opacity: 1 !important; transform: none !important; pointer-events: auto !important; min-width: 0 !important; border: 0 !important; box-shadow: none !important; padding: 0 0 7px 0 !important; background: var(--bww-soft); }
  .bww-mobile-menu .is-submenu-open > .sub-menu { display: block !important; }
  .bww-mobile-menu .sub-menu li { border: 0; }
  .bww-mobile-menu .sub-menu a { padding: 11px 20px 11px 32px; font-size: 13px; font-weight: 500; }
  .bww-mobile-menu .sub-menu .sub-menu a { padding-left: 44px; }
  .bww-submenu-toggle { position: absolute; right: 10px; top: 7px; width: 40px; height: 40px; border: 0; background: transparent; font-size: 23px; font-weight: 300; cursor: pointer; color: var(--bww-muted); }
  .bww-mobile-panel__footer { padding: 22px 20px 30px; display: grid; gap: 12px; font-size: 13px; color: var(--bww-muted); }
  .bww-mobile-panel__footer > a:not(.bww-mobile-quote) { color: var(--bww-ink); text-decoration: none; font-weight: 600; }
  .bww-mobile-quote { min-height: 46px; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; background: var(--bww-ink); color: #fff !important; text-decoration: none !important; font-weight: 700; }
  html.bww-menu-open, html.bww-menu-open body { overflow: hidden; }
}

@media (max-width: 480px) {
  .bww-shell { width: calc(100% - 20px); }
  .bww-mainbar__inner { grid-template-columns: 38px 1fr auto; gap: 6px; }
  .bww-actions { gap: 5px; }
  .bww-action--search { display: none; }
  .bww-branding__logo { max-width: 47vw; }
  .bww-mobile-toggle { padding-left: 2px; }
}

@media (max-width: 782px) {
  .admin-bar .bww-header { top: 46px; }
}

/* v1.1.0 — fixed premium information architecture + mega menus */
@media (min-width: 901px) {
  .bww-navrow__inner { position: static; }
  .bww-primary-nav, .bww-mega-menu { position: static; }
  .bww-mega-menu > li { position: static; }
  .bww-has-mega > a { gap: 7px; }
  .bww-has-mega > a::before { content: ""; order: 2; width: 6px; height: 6px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg) translateY(-2px); opacity: .55; }
  .bww-mega { position: absolute; left: 0; right: 0; top: 100%; padding-top: 1px; visibility: hidden; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .18s ease, transform .18s ease, visibility .18s; z-index: 120; }
  .bww-has-mega:hover > .bww-mega, .bww-has-mega:focus-within > .bww-mega { visibility: visible; opacity: 1; transform: translateY(0); pointer-events: auto; }
  .bww-mega__inner { display: grid; grid-template-columns: minmax(180px,1fr) minmax(180px,1fr) minmax(300px,1.45fr); gap: clamp(28px,4vw,70px); padding: 34px clamp(30px,4vw,64px) 38px; background: #fff; border-top: 1px solid var(--bww-line); border-bottom: 1px solid var(--bww-line); box-shadow: 0 24px 55px rgba(0,0,0,.11); }
  .bww-mega__inner--floors { grid-template-columns: repeat(3,minmax(150px,1fr)) minmax(290px,1.35fr); gap: clamp(24px,3vw,50px); }
  .bww-mega__inner--compact { grid-template-columns: minmax(180px,1fr) minmax(180px,1fr) minmax(300px,1.55fr); }
  .bww-mega__column { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
  .bww-mega__eyebrow { display: block; margin-bottom: 11px; color: var(--bww-muted); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
  .bww-mega__column > a { position: relative; width: 100%; padding: 7px 0; color: var(--bww-ink) !important; text-decoration: none !important; font-size: 13px; font-weight: 550; line-height: 1.35; }
  .bww-mega__column > a:hover { color: var(--bww-gold-dark) !important; transform: translateX(2px); }
  .bww-mega__column > .bww-mega__accent { margin-top: 5px; color: var(--bww-gold-dark) !important; font-weight: 750; }
  .bww-mega__feature { min-height: 178px; align-self: stretch; display: flex; flex-direction: column; justify-content: flex-end; padding: 28px; background: linear-gradient(135deg,#f4f0e8 0%,#e7dfd2 100%); color: var(--bww-ink) !important; text-decoration: none !important; overflow: hidden; position: relative; }
  .bww-mega__feature::before { content: ""; position: absolute; width: 190px; height: 190px; border: 1px solid rgba(148,120,71,.23); border-radius: 50%; top: -88px; right: -58px; }
  .bww-mega__feature span { position: relative; display: block; margin-bottom: 8px; color: var(--bww-gold-dark); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
  .bww-mega__feature strong { position: relative; max-width: 27ch; font-family: Georgia, 'Times New Roman', serif; font-size: clamp(19px,1.55vw,25px); font-weight: 500; line-height: 1.18; letter-spacing: -.025em; }
  .bww-mega__feature em { position: relative; margin-top: 17px; font-size: 11px; font-weight: 800; font-style: normal; letter-spacing: .03em; }
  .bww-mega__feature:hover em { color: var(--bww-gold-dark); }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .bww-mega__inner { gap: 24px; padding-inline: 28px; }
  .bww-mega__inner--floors { grid-template-columns: repeat(3,minmax(135px,1fr)) minmax(240px,1.2fr); }
  .bww-mega__feature { padding: 22px; }
}

/* v1.1.3 — robust sticky mode. JS promotes the header to fixed positioning
   after scroll while preserving its exact original width/position. */
.bww-header-placeholder { display: none; }
.bww-header.is-bww-fixed {
  position: fixed !important;
  z-index: 99990 !important;
  margin: 0 !important;
  box-shadow: 0 6px 24px rgba(0,0,0,.10);
}
.bww-header-placeholder.is-active { display: block; }


/* v1.1.4 — custom rules stay inside the BWW header. */
#bww-site-header button,
#bww-site-header input,
#bww-site-header a { box-shadow: none; }

@media (min-width: 901px) {
  #bww-site-header .bww-menu > .menu-item-has-children > a { gap: 7px; }
  #bww-site-header .bww-menu > .menu-item-has-children > a::before {
    content: "";
    order: 2;
    width: 6px;
    height: 6px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    opacity: .55;
  }
}


/* Stable 2.0 — mobile sections mirror the desktop mega-menu group headings. */
@media (max-width: 900px) {
  #bww-site-header .bww-mobile-menu > li > .sub-menu {
    padding: 8px 0 12px !important;
  }
  #bww-site-header .bww-mobile-section {
    padding: 0 20px 12px;
  }
  #bww-site-header .bww-mobile-section + .bww-mobile-section {
    padding-top: 8px;
    border-top: 1px solid var(--bww-line);
  }
  #bww-site-header .bww-mobile-section__title {
    display: block;
    padding: 10px 0 6px;
    color: var(--bww-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
  }
  #bww-site-header .bww-mobile-section__links {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
  }
  #bww-site-header .bww-mobile-section__links li {
    margin: 0;
    padding: 0;
  }
  #bww-site-header .bww-mobile-section__links a {
    padding: 10px 0 !important;
    background: transparent !important;
    font-size: 13px;
    font-weight: 550;
  }
  #bww-site-header .bww-mobile-feature > a {
    margin: 4px 20px 8px;
    padding: 16px !important;
    background: #efe9de !important;
    font-weight: 700 !important;
  }
}


/* Stable 2.0.1 — sticky-only reinforcement. Menu hover rules untouched. */
.bww-header.is-bww-fixed {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 99990 !important;
}


/* Stable 2.0.2 — mobile viewport fit.
   Keep the complete storefront inside the device width without touching menu logic. */
@media (max-width: 900px) {
  html,
  body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  #page,
  .site,
  .site-content,
  .content-area,
  .container,
  .inner-wrap,
  .tg-container,
  main,
  .woocommerce,
  .woocommerce-page {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  #bww-site-header,
  #bww-site-header .bww-mainbar,
  #bww-site-header .bww-navrow,
  #bww-site-header .bww-mobile-search {
    width: 100% !important;
    max-width: 100vw !important;
    left: 0 !important;
    right: 0 !important;
  }

  #bww-site-header .bww-shell {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
  }

  img,
  svg,
  video,
  iframe {
    max-width: 100% !important;
    height: auto;
  }

  .woocommerce ul.products,
  .woocommerce-page ul.products,
  .wc-block-grid__products,
  .wp-block-woocommerce-product-collection {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
  }

  .woocommerce ul.products li.product,
  .woocommerce-page ul.products li.product,
  .wc-block-grid__product {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .woocommerce ul.products li.product img,
  .woocommerce-page ul.products li.product img,
  .wc-block-grid__product-image img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: cover;
  }

  .woocommerce .products,
  .woocommerce-page .products {
    overflow: visible !important;
  }

  /* Prevent long product/category names and buttons from forcing the page wider. */
  .woocommerce ul.products li.product a,
  .woocommerce ul.products li.product h2,
  .woocommerce ul.products li.product .woocommerce-loop-product__title,
  .woocommerce ul.products li.product .button,
  .wc-block-grid__product-title,
  .wc-block-grid__product-add-to-cart {
    max-width: 100% !important;
    overflow-wrap: anywhere;
    word-break: normal;
    box-sizing: border-box !important;
  }
}


/* Stable 2.1.1 — robust mobile sticky header.
   Menu visuals/hover logic are untouched. */
@media (max-width: 900px) {
  #bww-site-header.bww-mobile-sticky {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    margin: 0 !important;
    z-index: 99990 !important;
    box-shadow: 0 3px 16px rgba(0,0,0,.10) !important;
  }

  body.admin-bar #bww-site-header.bww-mobile-sticky {
    top: 46px !important;
  }

  .bww-mobile-sticky-placeholder {
    display: none;
  }

  .bww-mobile-sticky-placeholder.is-active {
    display: block;
  }
}
