/**
 * WDS Custom Header - Stylesheet
 * 
 * Standalone, high-performance styling decoupled from Elementor:
 * - Floating 1440px max-width container
 * - 20px border-radius with grayish neutral background
 * - Left logo, Search button, Center menu, Right action icons
 * - Brand Accent: #3EC0BE (Teal / Turquoise)
 * - Floating AJAX Course Search Island
 * - Floating WooCommerce Cart Island (with items & View Cart button)
 * - Immersive Fullscreen Mobile Menu
 */

/* Builder AJAX confirmations share the product toast's visual language. */
.wds-ajax-cart-toast { box-sizing: border-box; position: fixed; z-index: 1100; top: calc(100px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; width: min(380px, calc(100vw - 20px)); padding: 16px 12px 16px 20px; border: 1px solid #a9dad8; border-radius: 14px; background: #fff; color: #263438; box-shadow: 0 8px 28px rgba(20,50,54,.14); font: 14px/1.5 Manrope, sans-serif; }
.wds-ajax-cart-toast > span { flex: 1; min-width: 0; }
.wds-ajax-cart-toast strong { display: block; font-weight: 600; }
.wds-ajax-cart-toast a { color: #207c7a; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.wds-ajax-cart-toast button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #415459; cursor: pointer; box-shadow: none; }
.wds-ajax-cart-toast button:hover { background: #edf8f7; }
.wds-ajax-cart-toast :is(a,button):focus-visible { outline: 2px solid #238d8b; outline-offset: 3px; }
:root {
  --wds-header-bg: #f5f6f8;             /* Slightly grayish neutral background */
  --wds-header-border: rgba(0, 0, 0, 0.07);
  --wds-header-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.04);
  --wds-header-radius: 20px;
  --wds-header-height: 72px;
  --wds-header-text: #1e293b;
  --wds-header-text-hover: #0f172a;
  --wds-header-accent: #3EC0BE;         /* WDS Brand Turquoise Accent */
  --wds-header-accent-hover: #32a8a6;
  --wds-header-transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Outer wrapper (floating layout with margin top/bottom) */
.wds-header-wrapper {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  padding: 16px 20px;
  box-sizing: border-box;
  transition: padding 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* WordPress Admin Bar offset */
.admin-bar .wds-header-wrapper {
  top: 32px;
}

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

/* Scrolled Sticky State: more compact & elevated */
.wds-header-wrapper.is-scrolled {
  padding: 10px 20px;
}

.wds-header-wrapper.is-scrolled .wds-header-container {
  min-height: 60px;
  background-color: rgba(246, 247, 249, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-color: rgba(226, 232, 240, 0.85);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.03);
}

/* Inner centered container (1440px max-width) */
.wds-header-container {
  max-width: 1440px;
  min-height: var(--wds-header-height);
  margin: 0 auto;
  background-color: var(--wds-header-bg);
  border: 1px solid var(--wds-header-border);
  border-radius: var(--wds-header-radius);
  box-shadow: var(--wds-header-shadow);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  padding: 0 28px;
  box-sizing: border-box;
  position: relative;
  transition: min-height 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.25s ease,
              box-shadow 0.25s ease,
              border-color 0.25s ease;
}

/* Columns */
.wds-header-col {
  display: flex;
  align-items: center;
}

/* --- 1. LEFT: LOGO + GROUPED COURSE TOOLS --- */
.wds-header-left {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-width: 0;
}

.wds-header-tools {
  display: flex;
  align-items: center;
  justify-self: center;
  gap: 8px;
}

.wds-header-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 1;
}

.wds-logo-img {
  max-height: 44px;
  width: auto;
  display: block;
  object-fit: contain;
}

.wds-logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--wds-header-text);
  letter-spacing: -0.02em;
}

/* ==========================================================================
   BROWSE BUTTON & MEGA-DROPDOWN
   ========================================================================== */
.wds-browse-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.wds-browse-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--wds-header-accent);
  color: #ffffff;
  border: 1px solid var(--wds-header-accent);
  border-radius: 9999px;
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background var(--wds-header-transition),
              border-color var(--wds-header-transition),
              box-shadow var(--wds-header-transition),
              transform var(--wds-header-transition);
  outline: none;
  white-space: nowrap;
}

.wds-browse-toggle:hover {
  background: var(--wds-header-accent-hover);
  border-color: var(--wds-header-accent-hover);
  box-shadow: 0 4px 14px rgba(62, 192, 190, 0.35);
  transform: translateY(-1px);
}

.wds-browse-toggle:active {
  transform: translateY(0);
}

.wds-browse-toggle.is-active {
  background: var(--wds-header-accent-hover);
  box-shadow: 0 0 0 3px rgba(62, 192, 190, 0.25);
}

.wds-browse-icon {
  display: block;
}

.wds-browse-arrow {
  display: block;
  transition: transform var(--wds-header-transition);
}

.wds-browse-toggle.is-active .wds-browse-arrow {
  transform: rotate(180deg);
}

/* Floating Mega Dropdown */
.wds-browse-dropdown {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  width: 700px;
  max-width: calc(100vw - 40px);
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 20px;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.16);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.wds-browse-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.wds-browse-panel {
  display: flex;
  flex-direction: column;
}

.wds-browse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 12px;
  border-bottom: 1px solid #f1f5f9;
}

.wds-browse-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.wds-browse-close {
  background: transparent;
  border: none;
  outline: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.wds-browse-close:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.wds-browse-body {
  display: flex;
  min-height: 380px;
  max-height: 440px;
}

/* Left Column: Categories List */
.wds-browse-col-cats {
  flex: 0 0 260px;
  width: 260px;
  border-right: 1px solid #f1f5f9;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 8px;
}

.wds-browse-cat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wds-browse-cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  color: #334155;
  transition: background 0.15s ease, color 0.15s ease;
  user-select: none;
}

.wds-browse-cat-item:hover,
.wds-browse-cat-item.is-active {
  background: var(--wds-header-accent);
  color: #ffffff;
  font-weight: 600;
}

.wds-browse-cat-count {
  font-size: 0.75rem;
  background: #f1f5f9;
  color: #64748b;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

.wds-browse-cat-item:hover .wds-browse-cat-count,
.wds-browse-cat-item.is-active .wds-browse-cat-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Right Column: Products Preview */
.wds-browse-col-preview {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 18px;
}

.wds-browse-back-btn {
  display: none;
}

.wds-browse-preview-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.wds-browse-loading,
.wds-browse-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 240px;
  color: #64748b;
  font-size: 0.92rem;
  text-align: center;
}

.wds-browse-product-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wds-browse-product-item {
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.wds-browse-product-item:hover {
  background: #ffffff;
  border-color: rgba(62, 192, 190, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transform: translateX(2px);
}

.wds-browse-product-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  text-decoration: none;
  color: inherit;
}

.wds-browse-prod-img-wrap {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  background: #e2e8f0;
}

.wds-browse-prod-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wds-browse-prod-meta {
  flex: 1 1 auto;
  min-width: 0;
}

.wds-browse-prod-title {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wds-browse-prod-price {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--wds-header-accent);
  margin-top: 2px;
}

.wds-browse-prod-arrow {
  flex: 0 0 auto;
  color: #94a3b8;
  transition: color 0.15s ease, transform 0.15s ease;
}

.wds-browse-product-item:hover .wds-browse-prod-arrow {
  color: var(--wds-header-accent);
  transform: translateX(3px);
}

.wds-browse-view-all-wrap {
  margin-top: 14px;
  padding-top: 10px;
  padding-bottom: 16px;
  border-top: 1px solid #f1f5f9;
}

.wds-browse-view-all {
  display: block;
  width: 100%;
  padding: 10px;
  background: var(--wds-header-accent);
  color: #ffffff;
  border-radius: 12px;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  transition: background 0.15s ease, transform 0.15s ease;
  box-sizing: border-box;
}

.wds-browse-view-all:hover {
  background: var(--wds-header-accent-hover);
  color: #ffffff;
  transform: translateY(-1px);
}

/* Search Trigger Pill Button (beside logo) */
.wds-header-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 9999px;
  color: #475569;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: background var(--wds-header-transition),
              color var(--wds-header-transition),
              border-color var(--wds-header-transition),
              transform var(--wds-header-transition);
  outline: none;
  white-space: nowrap;
}

.wds-header-search-btn:hover {
  background: #ffffff;
  color: var(--wds-header-text-hover);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

.wds-header-search-btn:active {
  transform: translateY(0);
}

.wds-header-search-btn.is-active {
  background: #ffffff;
  color: var(--wds-header-accent);
  border-color: var(--wds-header-accent);
  box-shadow: 0 2px 10px rgba(62, 192, 190, 0.15);
}

/* --- 2. CENTER: NAVIGATION BETWEEN COURSE TOOLS AND ACCOUNT --- */
.wds-header-center {
  display: flex;
  align-items: center;
  pointer-events: auto;
  z-index: 10;
}

.wds-nav-wrap {
  display: flex;
  align-items: center;
}

.wds-nav-menu {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.wds-nav-menu > li {
  position: relative;
  margin: 0;
  padding: 0;
}

/* Search Icon inside Desktop Menu */
.wds-nav-item-search {
  display: flex;
  align-items: center;
  margin-left: 2px;
}

.wds-nav-search-icon-btn {
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--wds-header-text);
  transition: color var(--wds-header-transition), background var(--wds-header-transition), transform var(--wds-header-transition);
}

.wds-nav-search-icon-btn:hover,
.wds-nav-search-icon-btn.is-active {
  color: var(--wds-header-accent);
  background: #f1f5f9;
  transform: scale(1.05);
}

.wds-nav-menu > li > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--wds-header-text);
  text-decoration: none;
  padding: 10px 0;
  transition: color var(--wds-header-transition);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wds-nav-arrow {
  display: inline-block;
  transition: transform var(--wds-header-transition);
  opacity: 0.7;
}

.wds-nav-menu > li:hover > a .wds-nav-arrow {
  transform: rotate(180deg);
  opacity: 1;
}

.wds-nav-menu > li > a:hover,
.wds-nav-menu > li.current-menu-item > a,
.wds-nav-menu > li.current-page-ancestor > a {
  color: var(--wds-header-accent);
}

/* Submenu dropdown */
.wds-nav-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 190px;
  background: #ffffff;
  border: 1px solid var(--wds-header-border);
  border-radius: 14px;
  box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.1);
  list-style: none;
  padding: 8px 6px;
  margin: 8px 0 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--wds-header-transition),
              transform var(--wds-header-transition),
              visibility var(--wds-header-transition);
  z-index: 100;
}

.wds-nav-menu > li:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.wds-nav-menu .sub-menu li {
  margin: 0;
  padding: 0;
}

.wds-nav-menu .sub-menu li a {
  display: block;
  padding: 10px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}

.wds-nav-menu .sub-menu li a:hover,
.wds-nav-menu .sub-menu li.current-menu-item a {
  background: #f1f5f9;
  color: var(--wds-header-accent);
}

/* --- 3. RIGHT: ACCOUNT + CART + HAMBURGER --- */
.wds-header-right {
  flex: 0 0 auto;
  justify-self: end;
  gap: 12px;
}

.wds-header-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: transparent;
  color: var(--wds-header-text);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background var(--wds-header-transition),
              color var(--wds-header-transition),
              transform var(--wds-header-transition);
  outline: none;
}

.wds-header-action:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--wds-header-text-hover);
  transform: translateY(-1px);
}

.wds-header-action:active {
  transform: translateY(0);
}

.wds-header-action.is-active {
  background: #ffffff;
  color: var(--wds-header-accent);
  box-shadow: 0 0 0 2px rgba(62, 192, 190, 0.3);
}

/* Mobile search toggle in header is hidden on desktop */
.wds-mobile-search-toggle {
  display: none;
}

.wds-header-action .wds-icon {
  display: block;
}

/* Dynamic WooCommerce Cart Badge */
.wds-cart-count {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #94a3b8;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-sizing: border-box;
  transition: background 0.2s ease, transform 0.2s ease;
}

.wds-cart-count.has-items {
  background: var(--wds-header-accent);
  animation: wdsCartBounce 0.3s ease;
}

@keyframes wdsCartBounce {
  0%   { transform: scale(0.8); }
  50%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* --- 4. FLOATING AJAX SEARCH ISLAND --- */
.wds-search-island {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  width: calc(100% - 40px);
  max-width: 680px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 20px;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.16);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.wds-search-island.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.wds-search-island-inner {
  padding: 16px 20px;
}

/* Search input field box */
.wds-search-input-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0 14px;
  height: 52px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.wds-search-input-box:focus-within {
  background: #ffffff;
  border-color: var(--wds-header-accent);
  box-shadow: 0 0 0 3px rgba(62, 192, 190, 0.2);
}

.wds-search-box-icon {
  color: #64748b;
  flex: 0 0 auto;
}

.wds-search-input {
  flex: 1 1 auto;
  border: none;
  background: transparent;
  outline: none;
  font-size: 1rem;
  color: #0f172a;
  padding: 0;
  height: 100%;
}

.wds-search-input::placeholder {
  color: #94a3b8;
}

.wds-search-island-close {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.wds-search-island-close:hover {
  color: #0f172a;
  background: #e2e8f0;
}

/* Results container */
.wds-search-results {
  max-height: 380px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 10px;
}

.wds-search-results:empty {
  margin-top: 0;
}

.wds-ajax-search-results {
  list-style: none;
  margin: 0;
  padding: 4px 0;
}

.wds-search-item {
  margin: 0;
  padding: 0;
}

.wds-search-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  transition: background 0.15s ease;
}

.wds-search-link:hover {
  background: #f1f5f9;
}

.wds-search-img-wrap {
  flex: 0 0 52px;
  height: 52px;
  border-radius: 10px;
  overflow: hidden;
  background: #e2e8f0;
}

.wds-search-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wds-search-meta {
  flex: 1 1 auto;
  min-width: 0;
}

.wds-search-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wds-search-price {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--wds-header-accent);
}

.wds-search-price del {
  color: #94a3b8;
  font-weight: 400;
  margin-right: 4px;
}

.wds-search-price ins {
  text-decoration: none;
}

.wds-search-arrow {
  color: #cbd5e1;
  flex: 0 0 auto;
  transition: color 0.15s ease, transform 0.15s ease;
}

.wds-search-link:hover .wds-search-arrow {
  color: var(--wds-header-accent);
  transform: translateX(3px);
}

.wds-search-empty {
  padding: 24px 16px;
  text-align: center;
  color: #64748b;
  font-size: 0.95rem;
}

/* --- 5. FLOATING WOOCOMMERCE CART ISLAND --- */
.wds-cart-island {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 20px;
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.16);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.wds-cart-island.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.wds-cart-island-inner {
  padding: 18px 20px;
}

.wds-cart-island-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 12px;
}

.wds-cart-island-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.wds-cart-items-qty {
  font-size: 0.84rem;
  color: #64748b;
  font-weight: 500;
}

/* Items List */
.wds-cart-items-list {
  list-style: none;
  margin: 0;
  padding: 0 2px;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
}

.wds-cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #f8fafc;
  width: 100%;
  box-sizing: border-box;
}

.wds-cart-item:last-child {
  border-bottom: none;
}

.wds-cart-item-img {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: #f1f5f9;
}

.wds-cart-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wds-cart-item-meta {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.wds-cart-item-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.wds-cart-item-title:hover {
  color: var(--wds-header-accent);
}

.wds-cart-item-price-qty {
  font-size: 0.84rem;
  color: #64748b;
}

.wds-cart-price {
  font-weight: 700;
  color: var(--wds-header-accent);
}

.wds-cart-remove {
  flex: 0 0 auto;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}

.wds-cart-remove:hover {
  color: #ef4444;
  background: #f1f5f9 !important;
}

.wds-cart-remove svg {
  display: block;
  width: 15px;
  height: 15px;
  stroke-width: 2.2;
}

/* Island Footer (Subtotal + Buttons) */
.wds-cart-island-footer {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
}

.wds-cart-subtotal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 0.95rem;
  color: #334155;
}

.wds-cart-subtotal strong {
  font-size: 1.05rem;
  color: #0f172a;
  font-weight: 700;
}

.wds-cart-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.wds-cart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--wds-header-transition),
              transform var(--wds-header-transition),
              opacity var(--wds-header-transition);
}

.wds-cart-btn:active {
  transform: translateY(1px);
}

.wds-cart-btn-view {
  background: var(--wds-header-accent);
  color: #ffffff;
}

.wds-cart-btn-view:hover {
  background: var(--wds-header-accent-hover);
  color: #ffffff;
}

.wds-cart-btn-checkout {
  background: #0f172a;
  color: #ffffff;
}

.wds-cart-btn-checkout:hover {
  background: #1e293b;
  color: #ffffff;
}

/* Empty State */
.wds-cart-empty-state {
  padding: 24px 16px;
  text-align: center;
}

.wds-cart-empty-icon {
  color: #94a3b8;
  margin-bottom: 10px;
}

.wds-cart-empty-text {
  font-size: 0.95rem;
  color: #64748b;
  margin: 0 0 16px;
}

.wds-cart-btn-browse {
  width: 100%;
  background: var(--wds-header-accent);
  color: #ffffff;
}

.wds-cart-btn-browse:hover {
  background: var(--wds-header-accent-hover);
  color: #ffffff;
}

/* --- 6. MOBILE HAMBURGER BUTTON --- */
.wds-mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
}

.wds-hamburger-line {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--wds-header-text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* --- 7. FULLSCREEN MOBILE MENU (100vw x 100vh) --- */
.wds-mobile-fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #ffffff;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.wds-mobile-fullscreen.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.wds-mobile-fs-header {
  height: 72px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  flex: 0 0 auto;
}

.wds-mobile-fs-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.wds-mobile-menu-logo img {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 10px;
}

.wds-mobile-account-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  flex-shrink: 0;
  margin-top: 24px;
  padding: 12px 20px;
  border: 1px solid var(--wds-header-accent);
  border-radius: 12px;
  background: var(--wds-header-accent);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  transition: filter 0.15s ease;
}

.wds-mobile-account-btn:hover {
  color: #ffffff;
  filter: brightness(0.95);
}

.wds-mobile-account-btn:focus-visible {
  outline: 2px solid #0f172a;
  outline-offset: 3px;
}

.wds-mobile-fs-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wds-mobile-fs-search-icon-btn,
.wds-mobile-fs-close {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.wds-mobile-fs-search-icon-btn:hover,
.wds-mobile-fs-close:hover {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.wds-mobile-fs-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 24px 32px 24px;
  display: flex;
  flex-direction: column;
}

.wds-mobile-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* Strict uniform rhythm for every single item */
.wds-mobile-nav-list > li {
  margin: 0;
  padding: 0;
  min-height: 56px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
}

.wds-mobile-nav-list li > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 4px;
  font-size: 1.02rem;
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: color 0.15s ease;
  box-sizing: border-box;
  margin: 0;
}

.wds-mobile-nav-list li.current-menu-item > a,
.wds-mobile-nav-list li > a:hover {
  color: var(--wds-header-accent);
}

/* Mobile Parent with Submenu (PACKAGES) - Exact same 56px height */
.wds-mobile-parent-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 4px;
  cursor: pointer;
  user-select: none;
  box-sizing: border-box;
  margin: 0;
}

.wds-mobile-parent-label {
  font-size: 1.02rem;
  font-weight: 700;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: color 0.15s ease;
}

.wds-mobile-parent-wrap:hover .wds-mobile-parent-label {
  color: var(--wds-header-accent);
}

.wds-mobile-sub-toggle {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.wds-mobile-toggle-icon {
  display: block;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.wds-mobile-item-has-children.is-open .wds-mobile-toggle-icon {
  transform: rotate(180deg);
}

.wds-mobile-item-has-children.is-open .wds-mobile-sub-toggle {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

/* Mobile Submenu Accordion: zero height/padding when closed */
.wds-mobile-sub-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.22s ease,
              padding 0.25s ease;
}

.wds-mobile-item-has-children.is-open .wds-mobile-sub-menu {
  max-height: 220px;
  opacity: 1;
  padding: 6px 0 12px 14px;
}

.wds-mobile-sub-menu li {
  border-bottom: none;
  border-left: 2px solid #e2e8f0;
  min-height: auto;
}

.wds-mobile-sub-menu li a {
  display: block;
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: color 0.15s ease, transform 0.15s ease;
}

.wds-mobile-sub-menu li a:hover,
.wds-mobile-sub-menu li.current-menu-item a {
  color: var(--wds-header-accent);
  transform: translateX(3px);
}

/* Mobile Search Item inside Menu List */
.wds-mobile-nav-search-item {
  border-bottom: none !important;
  margin-top: 4px;
}

.wds-mobile-nav-search-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 56px;
  padding: 0 4px;
  background: transparent;
  border: none;
  outline: none;
  color: #0f172a;
  cursor: pointer;
  box-sizing: border-box;
  transition: color 0.15s ease;
}

.wds-mobile-nav-search-btn:hover {
  color: var(--wds-header-accent);
}

.wds-mobile-search-label {
  font-size: 1.02rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wds-mobile-nav-search-btn svg {
  display: block;
  stroke: currentColor;
}

@media (min-width: 1025px) {
  /* Centre the navigation in the free span from Search to Account. */
  .wds-header-container { column-gap: 24px; }
  .wds-header-left { display: flex; gap: 24px; }
  .wds-header-center { min-width: 0; justify-content: center; }
  .wds-header-tools :is(.wds-browse-toggle, .wds-header-search-btn) {
    box-sizing: border-box;
    width: 136px;
    height: 44px;
    padding: 8px 12px;
    justify-content: center;
  }
}
/* One compact desktop mode: equally sized icon tools and tighter link spacing. */
@media (min-width: 1025px) and (max-width: 1400px) {
  .wds-nav-menu { gap: 12px; }
  .wds-header-tools .wds-browse-arrow,
  .wds-header-tools .wds-browse-toggle > span,
  .wds-header-tools .wds-search-btn-label { display: none; }
  .wds-header-tools :is(.wds-browse-toggle, .wds-header-search-btn) {
    min-width: 44px;
    width: 44px;
    height: 44px;
    padding: 8px;
    justify-content: center;
  }
}
/* --- 8. RESPONSIVE BREAKPOINT (TABLET & MOBILE) --- */
@media (max-width: 1024px) {
  /* Clip horizontal overflow without creating a scroll container that traps sticky. */
  body:has(#wds-site-header) {
    overflow-x: clip;
    overflow-y: visible;
  }
  .wds-header-left { display: flex; gap: 16px; }
  .wds-header-tools .wds-header-search-btn { display: none; }
  .wds-header-wrapper {
    padding: 10px;
  }

  /* Prevent jitter on mobile scroll: keep size and paddings stable */
  .wds-header-wrapper.is-scrolled {
    padding: 10px;
  }

  .wds-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    min-height: 64px !important;
    border-radius: 16px;
  }

  .wds-header-wrapper.is-scrolled .wds-header-container {
    min-height: 64px !important;
  }

  .wds-header-center {
    display: none; /* Hide desktop nav menu & desktop search pill */
  }

  /* Show search icon button in the mobile header bar */
  .wds-mobile-search-toggle {
    display: inline-flex;
  }

  .wds-mobile-toggle {
    display: flex; /* Show hamburger button */
  }

  .wds-logo-img {
    width: 40px;
    height: 40px;
    max-height: 40px;
    object-fit: cover;
    border-radius: 9px;
  }

  .wds-header-account {
    display: none;
  }

  .wds-search-island {
    /* Search is positioned against the outer wrapper, not the inner header card. */
    box-sizing: border-box;
    width: calc(100% - 20px);
    max-width: none;
    top: calc(100% + 8px);
  }

  .wds-cart-island {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    top: calc(100% + 8px) !important;
    border-radius: 16px !important;
  }

  .wds-search-island-inner,
  .wds-cart-island-inner { padding: 10px; }
  .wds-mobile-fs-header { padding: 0 10px; }
  .wds-mobile-fs-body { padding: 10px; }

  /* Mobile Browse Dropdown Modal (Two-screen workflow) */
  .wds-browse-dropdown {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    z-index: 999999 !important;
    background: #ffffff !important;
    overflow: hidden !important;
    transform: translateY(20px);
  }

  .wds-browse-dropdown.is-open {
    transform: translateY(0);
  }

  .wds-browse-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  .wds-browse-header {
    height: 64px;
    padding: 0 10px;
    flex: 0 0 auto;
    border-bottom: 1px solid #f1f5f9;
  }

  .wds-browse-body {
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    max-height: none;
    position: relative;
    overflow: hidden;
  }

  .wds-browse-col-cats {
    width: 100%;
    flex: 1 1 auto;
    max-height: none;
    border-right: none;
    display: block;
    padding: 10px;
    overflow-y: auto;
  }

  .wds-browse-col-preview {
    display: none;
    width: 100%;
    flex: 1 1 auto;
    max-height: none;
    padding: 10px;
    overflow-y: auto;
  }

  /* Two-view mobile workflow */
  .wds-browse-panel.show-preview .wds-browse-col-cats {
    display: none;
  }

  .wds-browse-panel.show-preview .wds-browse-col-preview {
    display: flex;
    flex-direction: column;
  }

  .wds-browse-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    padding: 8px 0 12px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--wds-header-accent);
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 10px;
  }
}
