/* ============================================
   WOOPREMIUM — Global Variables + Header & Mobile Drawer
   Version: 1.0.0
   ============================================ */

/* ---- Global CSS Variables (loaded on all pages) ---- */
:root {
  --wp-bg: #ffffff;
  --wp-surface: #f5f3ef;
  --wp-surface-warm: #edeae4;
  --wp-text: #1a1a1a;
  --wp-text-2: #5c5650;
  --wp-text-3: #706962;
  --wp-gold: #b8960c;
  --wp-gold-text: #8e7409;
  --wp-gold-light: #f5f0e0;
  --wp-border: #ddd8d0;
  --wp-border-input: #9e9186;
  --wp-border-light: #eae6df;
  --wp-cta: #1a1a1a;
  --wp-cta-hover: #333333;
  --wp-success: #548245;
  --wp-white: #ffffff;
  --wp-dark: #1a1a1a;
  --wp-dark-surface: #222120;
  --wp-dark-border: #3a3835;
  --wp-dark-text: #e8e4de;
  --wp-dark-text-2: #a09890;
  /* --wp-serif and --wp-sans defined in style.css — do not redeclare here */
  --wp-container: 1400px;
  --wp-gutter: 40px;
  --wp-r: 8px;
  --wp-r-sm: 6px;
  --wp-r-lg: 12px;
  --wp-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Global container ---- */
.wp-container {
  max-width: var(--wp-container);
  margin: 0 auto;
  padding: 0 var(--wp-gutter);
}

/* ============ TOP BAR ============ */
.wp-header__top {
  background: var(--wp-dark, #1a1a1a);
  color: var(--wp-white, #ffffff);
  font-size: .8125rem;
  padding: 8px 0;
  transition: margin-top .3s ease;
}
/* When scrolled: add subtle shadow to main bar */
.wp-header.wp-header--sticky {
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.wp-header__top .wp-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.wp-header__contact {
  display: flex;
  gap: 20px;
  align-items: center;
}
.wp-header__contact a {
  color: #ffffff;
  opacity: .75;
  transition: opacity .2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-size: .8125rem;
  font-family: var(--wp-sans);
}
.wp-header__contact a:hover { opacity: 1; }
.wp-header__contact svg { width: 13px; height: 13px; flex-shrink: 0; color: #ffffff; }

.wp-header__usps {
  display: flex;
  gap: 28px;
}
.wp-header__usp {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8125rem;
  color: #ffffff;
  font-family: var(--wp-sans);
}
.wp-header__usp svg {
  width: 14px;
  height: 14px;
  color: var(--wp-gold, #b8960c);
  flex-shrink: 0;
}

/* ============ MAIN HEADER ============ */
.wp-header__main {
  padding: 12px 0;
  background: var(--wp-white, #ffffff);
}
.wp-header__main .wp-container {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* Header: sticky, white background, top bar hides on scroll */
.wp-header {
  position: sticky;
  top: -40px; /* negative offset = top bar height, so main bar sticks to top */
  z-index: 200;
  border-bottom: 1px solid var(--wp-border-light, #eae6df);
  background: var(--wp-white, #ffffff);
}
/* When WP admin bar is present, adjust */
.admin-bar .wp-header {
  top: -8px; /* admin bar offset */
}

/* ============ LOGO ============ */
.wp-header__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.wp-header__logo img,
.wp-header__logo-img {
  height: 44px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}
.wp-header__logo-text {
  font-family: var(--wp-serif, Georgia, serif);
  font-size: 1.5rem;
  font-style: italic;
  color: var(--wp-gold-text, #8e7409);
  line-height: 1;
}

/* ============ DESKTOP NAVIGATION ============ */
.wp-header__nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
}
.wp-header__menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.wp-header__menu li {
  position: relative;
}
.wp-header__menu li a {
  display: block;
  padding: 8px 16px;
  font-size: .9375rem;
  font-weight: 500;
  color: var(--wp-text, #1a1a1a);
  text-decoration: none;
  border-radius: var(--wp-r-sm, 6px);
  transition: color .2s, background .2s;
  font-family: var(--wp-sans);
}
.wp-header__menu li a:hover {
  color: var(--wp-gold-text, #8e7409);
}
.wp-header__menu li.current-menu-item > a,
.wp-header__menu li.current-menu-ancestor > a {
  color: var(--wp-gold-text, #8e7409);
}


/* Dropdown submenu */
.wp-header__menu li .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--wp-white, #ffffff);
  border-radius: var(--wp-r, 8px);
  box-shadow: 0 8px 32px rgba(0,0,0,.1);
  padding: 8px 0;
  min-width: 220px;
  list-style: none;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .2s, visibility .2s, transform .2s;
  z-index: 100;
}
.wp-header__menu li:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.wp-header__menu .sub-menu li a {
  padding: 8px 20px;
  font-size: .875rem;
  color: var(--wp-text, #1a1a1a);
  border-radius: 0;
}
.wp-header__menu .sub-menu li a:hover {
  background: var(--wp-surface, #f5f3ef);
  color: var(--wp-gold-text, #8e7409);
}

/* ============ MEGA MENU ============ */
.wp-mega-trigger {
  position: relative;
}
.wp-mega-trigger__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  font-size: .9375rem;
  font-weight: 500;
  color: var(--wp-text, #1a1a1a);
  text-decoration: none;
  border-radius: var(--wp-r-sm, 6px);
  transition: color .2s;
  font-family: var(--wp-sans);
}
.wp-mega-trigger__link:hover { color: var(--wp-gold-text, #8e7409); }
.wp-mega-trigger__link svg { transition: transform .2s; }
.wp-mega-trigger:hover .wp-mega-trigger__link svg { transform: rotate(180deg); }

.wp-mega-menu {
  position: fixed;
  top: var(--wp-mega-menu-top, 68px);
  left: 50%;
  width: min(calc(100vw - 80px), 1000px);
  background: var(--wp-white, #ffffff);
  border-radius: var(--wp-r-lg, 12px);
  box-shadow: 0 12px 48px rgba(0,0,0,.12);
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s, transform .25s;
  transform: translateX(-50%) translateY(8px);
  z-index: 200;
  overflow: hidden;
}
.wp-mega-trigger:hover .wp-mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.wp-mega-menu__inner {
  display: grid;
  grid-template-columns: 220px 1fr 240px;
  gap: 0;
  min-height: 320px;
}

/* Left column: main categories */
.wp-mega-menu__main-cats {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--wp-border-light, #eae6df);
  padding: 16px 0;
}
.wp-mega-menu__cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  font-size: .9375rem;
  font-weight: 500;
  color: var(--wp-text, #1a1a1a);
  text-decoration: none;
  font-family: var(--wp-sans);
  transition: background .15s, color .15s;
  border-left: 3px solid transparent;
}
.wp-mega-menu__cat-item:hover,
.wp-mega-menu__cat-item.active {
  background: var(--wp-surface, #f5f3ef);
  color: var(--wp-gold-text, #8e7409);
  border-left-color: var(--wp-gold, #b8960c);
}
.wp-mega-menu__cat-item svg { opacity: .3; flex-shrink: 0; }
.wp-mega-menu__cat-item.active svg { opacity: .6; }

/* Middle column: subcategories */
.wp-mega-menu__sub-cats {
  padding: 24px 32px;
}
.wp-mega-menu__sub-panel {
  display: none;
}
.wp-mega-menu__sub-panel.active { display: block; }
.wp-mega-menu__links {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2;
  column-gap: 24px;
}
.wp-mega-menu__links li {
  margin-bottom: 8px;
  break-inside: avoid;
}
.wp-mega-menu__links li a {
  font-size: .8125rem;
  color: var(--wp-text-2, #5c5650);
  text-decoration: none;
  transition: color .2s;
  font-family: var(--wp-sans);
}
.wp-mega-menu__links li a:hover { color: var(--wp-gold-text, #8e7409); }
.wp-mega-menu__empty {
  font-size: .8125rem;
  color: var(--wp-text-3, #8a837c);
  font-style: italic;
}

/* Right column: category image */
.wp-mega-menu__image {
  border-left: 1px solid var(--wp-border-light, #eae6df);
  overflow: hidden;
}
.wp-mega-menu__image-panel {
  display: none;
  height: 100%;
}
.wp-mega-menu__image-panel.active { display: block; }
.wp-mega-menu__image-panel a {
  display: block;
  height: 100%;
}
.wp-mega-menu__image-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--wp-ease);
}
.wp-mega-menu__image-panel a:hover img { transform: scale(1.04); }

/* ============ CTA BUTTON ============ */
.wp-header__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--wp-cta, #1a1a1a);
  color: var(--wp-white, #ffffff);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: var(--wp-r-sm, 6px);
  text-decoration: none;
  transition: background .2s, transform .15s;
  flex-shrink: 0;
  font-family: var(--wp-sans);
}
.wp-header__cta:hover {
  background: var(--wp-cta-hover, #333);
  transform: translateY(-1px);
}
.wp-header__cta svg { width: 15px; height: 15px; }


/* ============ HEADER ICONS ============ */
.wp-header__icons {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
  margin-right: 4px;
}
.wp-header__icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background .2s;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  position: relative;
}
.wp-header__icon-btn:hover { background: var(--wp-surface, #f5f3ef); }
.wp-header__icon-btn:hover svg { color: var(--wp-text, #1a1a1a); }
.wp-header__icon-btn svg { width: 20px; height: 20px; color: var(--wp-text, #1a1a1a); }


/* Cart badge */
.wp-header__cart-btn .cart-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--wp-gold, #b8960c);
  color: var(--wp-white, #ffffff);
  font-size: .625rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ============ HAMBURGER ============ */
.wp-header__hamburger {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 1px solid var(--wp-border, #ddd8d0);
  border-radius: var(--wp-r-sm, 6px);
  cursor: pointer;
  padding: 8px;
  transition: border-color .2s;
}
.wp-header__hamburger:hover {
  border-color: var(--wp-text-3, #8a837c);
  background: var(--wp-surface, #f5f3ef);
}
.wp-header__hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--wp-text, #1a1a1a);
  border-radius: 1px;
  transition: transform .3s, opacity .3s;
}
/* Hamburger → X animation */
.wp-header__hamburger[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.wp-header__hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.wp-header__hamburger[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ============ MOBILE DRAWER ============ */
.wp-drawer {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
}
.wp-drawer[aria-hidden="false"] { pointer-events: auto; }

.wp-drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
  opacity: 0;
  transition: opacity .3s;
}
.wp-drawer[aria-hidden="false"] .wp-drawer__overlay { opacity: 1; }

.wp-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  max-width: 85vw;
  background: var(--wp-white, #ffffff);
  transform: translateX(100%);
  transition: transform .35s var(--wp-ease, cubic-bezier(.22,1,.36,1));
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.wp-drawer[aria-hidden="false"] .wp-drawer__panel { transform: translateX(0); }

.wp-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--wp-border-light, #eae6df);
}
.wp-drawer__logo { text-decoration: none; }
.wp-drawer__logo img { height: 36px; width: auto; }
.wp-drawer__close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: none;
  border: none;
  cursor: pointer;
  transition: background .2s;
}
.wp-drawer__close:hover { background: var(--wp-surface, #f5f3ef); }
.wp-drawer__close svg { width: 20px; height: 20px; }

/* Drawer navigation */
.wp-drawer__nav {
  flex: 1;
  padding: 16px 0;
}
.wp-drawer__menu {
  list-style: none;
  margin: 0;
  padding: 0;
}
.wp-drawer__menu li a {
  display: flex;
  align-items: center;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--wp-text, #1a1a1a);
  text-decoration: none;
  transition: background .2s;
  font-family: var(--wp-sans);
}
.wp-drawer__menu li a:hover {
  background: var(--wp-surface, #f5f3ef);
  color: var(--wp-gold-text, #8e7409);
}
.wp-drawer__menu li.current-menu-item > a {
  color: var(--wp-gold-text, #8e7409);
}
/* Submenu in drawer */
.wp-drawer__menu .sub-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}
.wp-drawer__menu .sub-menu li a {
  padding-left: 48px;
  font-size: .9375rem;
  font-weight: 400;
  color: var(--wp-text-2, #5c5650);
}

/* Drawer footer */
.wp-drawer__footer {
  padding: 24px;
  border-top: 1px solid var(--wp-border-light, #eae6df);
}
.wp-drawer__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  background: var(--wp-cta, #1a1a1a);
  color: var(--wp-white, #ffffff);
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: var(--wp-r, 8px);
  text-decoration: none;
  transition: background .2s;
  font-family: var(--wp-sans);
  margin-bottom: 16px;
}
.wp-drawer__cta:hover { background: var(--wp-cta-hover, #333); }
.wp-drawer__cta svg { width: 16px; height: 16px; }

.wp-drawer__contact {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wp-drawer__contact a {
  font-size: .8125rem;
  color: var(--wp-text-2, #5c5650);
  text-decoration: none;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .wp-header__usps { display: none; }
}
@media (max-width: 768px) {
  .wp-header__nav { display: none; }
  .wp-header__hamburger { display: flex; }
  .wp-header__main .wp-container {
    justify-content: space-between;
  }
  .wp-header__icons {
    margin-left: auto;
  }
  .wp-header__top .wp-container { justify-content: center; }
  .wp-header__contact { gap: 12px; }
  .wp-header__contact a { font-size: .75rem; }
}

/* ============ FIBOSEARCH INTEGRATION ============ */
.wp-header__search {
  display: flex;
  align-items: center;
  margin-right: 7px;
  margin-bottom: 2px;
}
/* Clean up the opened search form */
.dgwt-wcas-search-wrapp .dgwt-wcas-search-form,
.dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp {
  border: 1px solid var(--wp-border, #ddd8d0) !important;
  border-radius: var(--wp-r, 8px) !important;
  box-shadow: 0 4px 16px rgba(0,0,0,.08) !important;
  outline: none !important;
}
.dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp {
  border: none !important;
  box-shadow: none !important;
}
.dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp input[type="search"] {
  border: none !important;
  box-shadow: none !important;
  font-family: var(--wp-sans) !important;
  font-size: .875rem !important;
  padding: 12px 16px 12px 40px !important;
}
.dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp input[type="search"]:focus {
  outline: none !important;
  box-shadow: none !important;
}
.dgwt-wcas-style-pirx .dgwt-wcas-sf-wrapp button.dgwt-wcas-search-submit {
  left: 18px !important;
  top: 18px !important;
}

/* ============ SPECIFICITY OVERRIDES for menu items ============ */
.wp-header .wp-header__menu li a {
  color: var(--wp-text, #1a1a1a);
  font-size: .9375rem;
  font-weight: 500;
  font-family: var(--wp-sans);
  text-decoration: none;
  padding: 8px 16px;
  background: none;
  border: none;
}
.wp-header .wp-header__menu li a:hover {
  color: var(--wp-gold-text, #8e7409);
}
.wp-header .wp-header__menu li.current-menu-item > a,
.wp-header .wp-header__menu li.current-menu-ancestor > a {
  color: var(--wp-gold-text, #8e7409);
}
/* CTA button override */
.wp-header .wp-header__cta {
  background: var(--wp-cta, #1a1a1a);
  color: var(--wp-white, #ffffff);
  font-family: var(--wp-sans);
}
.wp-header .wp-header__cta:hover {
  background: var(--wp-cta-hover, #333);
}
/* Icon buttons */
.wp-header .wp-header__icon-btn svg {
  color: var(--wp-text, #1a1a1a);
}

/* ============ FOCUS STATES ============ */
.wp-header :focus-visible {
  outline: 2px solid var(--wp-gold, #b8960c);
  outline-offset: 2px;
}
.wp-header :focus:not(:focus-visible) {
  outline: none;
}

/* ============ SMALL SCREENS ============ */
@media (max-width: 480px) {
  :root { --wp-gutter: 20px; }
  .wp-header__logo img { height: 30px; }
  .wp-drawer__panel { width: 100%; max-width: 100vw; }
  .wp-drawer__menu li a { padding: 16px 20px; }
  .wp-drawer__menu .sub-menu li a { padding-left: 40px; }
  .wp-drawer__footer { padding: 20px; }
  .wp-header__top .wp-container { flex-wrap: wrap; }
}

/* ============ SAFE AREA (notched devices) ============ */
@supports (padding: env(safe-area-inset-right)) {
  .wp-drawer__panel {
    padding-right: env(safe-area-inset-right);
  }
  .wp-drawer__footer {
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  .wp-drawer__panel { transition: none; }
  .wp-drawer__overlay { transition: none; }
  .wp-header__menu li .sub-menu { transition: none; }
  .wp-header__hamburger span { transition: none; }
}
