/**
 * Bongoto WooCommerce – Header Styles
 * File: assets/css/wc-addon-header.css
 *
 * Features:
 * - Multi-level hover dropdown menus (L1→L2→L3)
 * - Smooth transitions and shadows
 * - Mobile-friendly drawer fallback
 * - Works for .bt-header--pro variants only (2–5)
 */

/* ===============================
   Base Header Layout
================================= */
.bt-header--pro {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: relative;
  z-index: 1000;
}

.bt-header--pro .bt-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
}

.bt-header--pro.bt-header--sticky {
  position: sticky;
  top: 0;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* ===============================
   Navigation: Primary Menu
================================= */
.bt-header--pro .bt-nav {
  position: relative;
  overflow: visible;
}

.bt-header--pro .bt-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
}

.bt-header--pro .bt-menu-list > li {
  position: relative;
}

.bt-header--pro .bt-menu-list a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 10px 8px;
  color: #0f172a;
  text-decoration: none;
  font-weight: 500;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}

.bt-header--pro .bt-menu-list a:hover {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.05);
}

/* caret icon for items having submenu */
.bt-header--pro .menu-item-has-children > a::after {
  content: "▾";
  font-size: 0.75rem;
  opacity: 0.7;
  transform: translateY(-1px);
}

/* ===============================
   Dropdown Menu Levels
================================= */

/* Level 1 dropdown */
.bt-header--pro .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  padding: 8px 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.18s ease;
  z-index: 9999;
}

/* Show on hover */
.bt-header--pro li:hover > .sub-menu,
.bt-header--pro li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Level 2/3 flyouts */
.bt-header--pro .sub-menu .sub-menu {
  top: 0;
  left: 100%;
  margin-left: 6px;
  border-radius: 8px;
  transform: translateX(10px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.18s ease;
}

/* Show flyout on hover */
.bt-header--pro .sub-menu li:hover > .sub-menu,
.bt-header--pro .sub-menu li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

/* Menu items inside dropdown */
.bt-header--pro .sub-menu li {
  position: relative;
}

.bt-header--pro .sub-menu a {
  display: block;
  padding: 8px 12px;
  color: #0f172a;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.bt-header--pro .sub-menu a:hover {
  background: #f3f4f6;
  color: #2563eb;
}

/* ===============================
   Actions (Cart, Account, Search, Upload)
================================= */
.bt-header--pro .bt-header-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.bt-header--pro .bt-icon-btn {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  background: #f3f4f6;
  color: #0f172a;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s;
}
.bt-header--pro .bt-icon-btn:hover {
  background: #e5e7eb;
}

/* CTA Button */
.bt-header--pro .bt-cta-btn {
  background: #2563eb;
  color: #fff;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease;
}
.bt-header--pro .bt-cta-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

/* ===============================
   Drawer (Mobile)
================================= */
.bt-header--pro .bt-menu-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
}
.bt-header--pro .bt-menu-toggle:hover {
  background: #f3f4f6;
}

@media (max-width: 768px) {
  .bt-header--pro .bt-menu-toggle {
    display: flex;
  }
  .bt-header--pro .bt-nav {
    display: none;
  }
  .bt-header--pro .bt-header-right {
    gap: 0.4rem;
  }
}

/* Drawer panel */
.bt-header--pro .bt-drawer {
  display: none;
  position: fixed;
  inset: 0 auto 0 0;
  width: 80vw;
  max-width: 320px;
  background: #fff;
  box-shadow: 8px 0 24px rgba(0, 0, 0, 0.15);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  z-index: 1100;
}

.bt-header--pro .bt-drawer.is-open {
  transform: translateX(0);
}

.bt-header--pro .bt-drawer-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  overflow-y: auto;
}

.bt-header--pro .bt-drawer-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bt-header--pro .bt-drawer-menu li a {
  display: block;
  padding: 10px 0;
  text-decoration: none;
  color: #0f172a;
  font-weight: 500;
}
.bt-header--pro .bt-drawer-menu li a:hover {
  color: #2563eb;
}

.bt-header--pro .bt-drawer-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  background: transparent;
  font-size: 26px;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.bt-header--pro .bt-drawer-close:hover {
  transform: rotate(90deg);
}

/* Only show drawer on mobile */
@media (max-width: 768px) {
  .bt-header--pro .bt-drawer {
    display: block;
  }
}

/* ===============================
   Accessibility & Hover polish
================================= */
.bt-header--pro li:focus-within > a {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.bt-header--pro .sub-menu a:focus {
  background: #f3f4f6;
  color: #2563eb;
}

/* ===============================
   Animations for Dropdown
================================= */
@keyframes btFadeIn {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}
.bt-header--pro .sub-menu li:hover > .sub-menu {
  animation: btFadeIn 0.2s ease both;
}
