/**
 * WEPSHOP Premium Header CSS (Dynamic Version)
 * Primary Color: Navy (#10113B) - From Logo Text
 * Accent Color: Burgundy (#8F192C) - From Logo Icon
 * Direction: RTL
 */

/* ── Reset & Base ──────────────────────────────────────── */
.wep-header-sticky *,
.wep-mobile-header *,
.wep-bottom-nav * { box-sizing: border-box; }

:root {
  --wep-blue:        #10113B;
  --wep-blue-dark:   #0A0B26;
  --wep-blue-light:  #F0F1F7;
  --wep-red:         #8F192C;
  --wep-red-dark:    #731423;
  --wep-red-bg:      #FDF2F3;
  --wep-navy:        #10113B;
  --wep-gray-50:     #F9FAFB;
  --wep-gray-100:    #F3F4F6;
  --wep-gray-200:    #E5E7EB;
  --wep-gray-400:    #9CA3AF;
  --wep-gray-500:    #6B7280;
  --wep-gray-600:    #4B5563;
  --wep-gray-700:    #374151;
  --wep-shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --wep-shadow-md:   0 4px 16px rgba(0,0,0,.10);
  --wep-shadow-lg:   0 8px 32px rgba(0,0,0,.13);
  --wep-r-sm:        6px;
  --wep-r-md:        10px;
  --wep-r-full:      999px;
  --wep-t:           all .22s cubic-bezier(.4,0,.2,1);
}

/* Ensure bottom space on mobile for App Navigation */
body.wepshop-bottom-nav-active {
  padding-bottom: 0;
}
@media (max-width: 900px) {
  body.wepshop-bottom-nav-active {
    padding-bottom: 75px !important;
  }
}

/* ── Sticky Wrapper ──────────────────────────────────── */
.wep-header-sticky {
  position: sticky; top: 0; z-index: 9999;
  box-shadow: var(--wep-shadow-md);
  transition: box-shadow .3s;
}
.wep-header-sticky.scrolled { box-shadow: var(--wep-shadow-lg); }
.wep-header-sticky.scrolled .wep-topbar {
  height: 0; overflow: hidden; opacity: 0;
  padding-top: 0; padding-bottom: 0;
  transition: height .28s, opacity .2s, padding .28s;
}

/* ── Container ───────────────────────────────────────── */
.wep-container {
  max-width: 1280px; margin: 0 auto;
  padding-right: 24px; padding-left: 24px;
  width: 100%;
}

/* ══════════════════════════════════════════════════════
   TOP BAR
══════════════════════════════════════════════════════ */
.wep-topbar {
  background: var(--wep-navy);
  color: rgba(255,255,255,.85);
  font-size: 12.5px; font-weight: 500;
  height: 38px;
  display: flex; align-items: center;
  transition: height .28s, opacity .2s;
  overflow: hidden;
}
.wep-topbar .wep-container {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.wep-topbar-message { display: flex; align-items: center; gap: 8px; flex: 1; overflow: hidden; }
.wep-topbar-msgs { position: relative; height: 38px; flex: 1; overflow: hidden; }
.wep-topbar-msgs span {
  position: absolute; right: 0; left: 0; height: 38px;
  display: flex; align-items: center; white-space: nowrap; opacity: 0;
  animation: wepMsgRotate 12s infinite;
}
.wep-topbar-msgs span:nth-child(1) { animation-delay: 0s; }
.wep-topbar-msgs span:nth-child(2) { animation-delay: 4s; }
.wep-topbar-msgs span:nth-child(3) { animation-delay: 8s; }
@keyframes wepMsgRotate {
  0%   { opacity:0; transform:translateY(8px); }
  8%   { opacity:1; transform:translateY(0); }
  30%  { opacity:1; transform:translateY(0); }
  38%  { opacity:0; transform:translateY(-8px); }
  100% { opacity:0; }
}

.wep-topbar-links { display: flex; align-items: center; flex-shrink: 0; }
ul.wep-top-nav-list { display: flex; list-style: none; margin: 0; padding: 0; }
.wep-topbar-links a,
ul.wep-top-nav-list li a,
.wep-topbar-links button {
  display: flex; align-items: center; gap: 5px;
  color: rgba(255,255,255,.8); font-size: 12.5px; font-weight: 500;
  padding: 0 13px; height: 38px;
  border-right: 1px solid rgba(255,255,255,.12);
  transition: var(--wep-t); white-space: nowrap;
  background: none; border-top: none; border-bottom: none; border-left: none; cursor: pointer;
  font-family: inherit; text-decoration: none;
}
ul.wep-top-nav-list li:first-child a { border-right: none; }
.wep-topbar-links > a:first-child,
.wep-topbar-links > button:first-child { border-right: none; }
ul.wep-top-nav-list li a:hover,
.wep-topbar-links a:hover,
.wep-topbar-links button:hover { color: #fff; background: rgba(255,255,255,.08); }


/* ══════════════════════════════════════════════════════
   MAIN HEADER
══════════════════════════════════════════════════════ */
.wep-main-header {
  background: #fff; padding: 14px 0; border-bottom: 1px solid var(--wep-gray-100);
}
.wep-main-header .wep-container { display: flex; align-items: center; gap: 20px; }

/* Logo */
.wep-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.wep-logo img { width: auto; max-height: 52px; }
.wep-logo-icon {
  width: 44px; height: 44px; border-radius: var(--wep-r-md);
  background: var(--wep-blue);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(16,17,59,.2); flex-shrink: 0;
}
.wep-logo-icon svg { width: 24px; height: 24px; }
.wep-logo-text { display: flex; flex-direction: column; line-height: 1; }
.wep-logo-name { font-size: 20px; font-weight: 800; color: var(--wep-blue); letter-spacing: -.02em; }
.wep-logo-sub  { font-size: 9.5px; font-weight: 500; color: var(--wep-gray-400); letter-spacing: .07em; margin-top: 3px; }

/* Search Form */
.wep-search-wrap { flex: 1; min-width: 0; position: relative; }
.wep-search-form {
  display: flex; align-items: stretch;
  border: 2px solid var(--wep-blue);
  border-radius: var(--wep-r-full);
  background: #fff; box-shadow: 0 2px 12px rgba(16,17,59,.08);
  transition: var(--wep-t); overflow: visible;
}
.wep-search-form:focus-within {
  border-color: var(--wep-red); /* Highlight burgundy on focus */
  box-shadow: 0 4px 20px rgba(143,25,44,.15);
}
.wep-search-cat {
  background: var(--wep-blue-light); border-left: 1px solid var(--wep-gray-200);
  display: flex; align-items: center; padding: 0 4px 0 2px; flex-shrink: 0;
  border-radius: 0 var(--wep-r-full) var(--wep-r-full) 0;
}
.wep-search-cat select {
  appearance: none; border: none; background: transparent;
  font-family: inherit; font-size: 13px; font-weight: 600; color: var(--wep-blue-dark);
  padding: 0 28px 0 12px; cursor: pointer; height: 100%; min-width: 120px; max-width: 160px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%2310113B' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 8px center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wep-search-cat select:focus { outline: none; }
.wep-search-input-area { flex: 1; position: relative; }
.wep-search-input {
  width: 100%; height: 50px; border: none; outline: none;
  font-family: inherit; font-size: 14.5px; color: #111; direction: rtl;
  padding: 0 18px; background: transparent;
}
.wep-search-btn {
  background: var(--wep-blue); color: #fff;
  border: none; padding: 0 26px; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 700;
  display: flex; align-items: center; gap: 7px;
  transition: var(--wep-t); flex-shrink: 0;
  border-radius: var(--wep-r-full) 0 0 var(--wep-r-full);
}
.wep-search-btn:hover { background: var(--wep-red); }
.wep-search-btn svg { width: 18px; height: 18px; }

/* Action buttons */
.wep-header-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.wep-action-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 12px; border-radius: var(--wep-r-md); cursor: pointer;
  transition: var(--wep-t); color: var(--wep-gray-700);
  border: 1.5px solid transparent; background: none; font-family: inherit; text-decoration: none;
  position: relative;
}
.wep-action-btn:hover {
  background: var(--wep-blue-light); color: var(--wep-red);
  border-color: rgba(143,25,44,.1);
}
.wep-action-btn svg { width: 22px; height: 22px; }
.wep-action-btn span { font-size: 11px; font-weight: 600; white-space: nowrap; }

/* Cart badge */
.wep-cart-badge {
  position: absolute; top: 4px; left: 4px;
  min-width: 18px; height: 18px;
  background: var(--wep-red); color: #fff;
  font-size: 10px; font-weight: 800; border-radius: var(--wep-r-full);
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(143,25,44,.4);
}

/* Account dropdown */
.wep-account-wrap { position: relative; }
.wep-account-dd {
  position: absolute; top: calc(100% + 10px); left: 0;
  min-width: 200px; background: #fff;
  border: 1px solid var(--wep-gray-200); border-top: 2px solid var(--wep-blue);
  border-radius: 0 0 var(--wep-r-md) var(--wep-r-md);
  box-shadow: var(--wep-shadow-lg); padding: 6px 0;
  display: none; z-index: 600;
}
.wep-account-wrap:hover .wep-account-dd,
.wep-account-wrap:focus-within .wep-account-dd { display: block; }
.wep-account-dd a {
  display: block; padding: 10px 16px; font-size: 13.5px; color: var(--wep-gray-700);
  transition: var(--wep-t); text-decoration: none;
}
.wep-account-dd a:hover { background: var(--wep-gray-50); color: var(--wep-red); }


/* ══════════════════════════════════════════════════════
   NAVIGATION BAR
══════════════════════════════════════════════════════ */
.wep-navbar { background: #fff; border-top: 1px solid var(--wep-gray-100); }
.wep-navbar .wep-container { display: flex; align-items: stretch; }

/* Mega Menu Toggle */
.wep-cats-wrap { position: relative; flex-shrink: 0; }
.wep-cats-btn {
  display: flex; align-items: center; gap: 9px;
  background: var(--wep-blue); color: #fff;
  font-size: 14px; font-weight: 700;
  padding: 0 20px; height: 48px; cursor: pointer;
  border: none; font-family: inherit; white-space: nowrap; transition: var(--wep-t);
}
.wep-cats-btn:hover { background: var(--wep-red); }
.wep-cats-btn svg.wep-bars { width: 17px; height: 17px; }
.wep-cats-btn svg.wep-chev { width: 13px; height: 13px; margin-right: auto; margin-left: 0; transition: transform .22s; }
.wep-cats-btn[aria-expanded="true"] svg.wep-chev { transform: rotate(180deg); }

/* Mega Menu (WP Nav Output) */
.wep-mega-menu {
  position: absolute; top: 100%; right: 0;
  width: 260px; background: #fff;
  border: 1px solid var(--wep-gray-200); border-top: 3px solid var(--wep-blue);
  border-radius: 0 0 var(--wep-r-md) var(--wep-r-md);
  box-shadow: var(--wep-shadow-lg); z-index: 700;
  display: none; padding: 6px 0;
}
.wep-cats-wrap:hover .wep-mega-menu,
.wep-mega-menu.open { display: block; }
ul.wep-mega-nav-list { list-style: none; margin: 0; padding: 0; }
ul.wep-mega-nav-list > li { position: static; } /* For flyout positioning if needed */
ul.wep-mega-nav-list > li > a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 20px; font-size: 14px; color: var(--wep-gray-700);
  transition: var(--wep-t); text-decoration: none;
  font-weight: 600;
}
ul.wep-mega-nav-list > li > a:hover {
  background: var(--wep-blue-light); color: var(--wep-red); padding-right: 24px;
}
/* Multi-level support for desktop mega menu */
ul.wep-mega-nav-list li.menu-item-has-children > a::after {
  content: '›'; font-size: 16px; opacity: 0.5; margin-right: auto;
}
ul.wep-mega-nav-list .sub-menu {
  position: absolute; top: 0; right: 258px; height: 100%; width: 260px;
  background: #fdfdfd; border-right: 1px solid var(--wep-gray-100);
  border-left: 1px solid var(--wep-gray-200);
  border-bottom: 1px solid var(--wep-gray-200);
  box-shadow: var(--wep-shadow-lg); display: none;
  list-style: none; margin: 0; padding: 10px 0;
}
ul.wep-mega-nav-list li.menu-item-has-children:hover .sub-menu { display: block; }
ul.wep-mega-nav-list .sub-menu li a {
  display: block; padding: 8px 20px; font-size: 13.5px; color: var(--wep-gray-600); text-decoration: none;
}
ul.wep-mega-nav-list .sub-menu li a:hover { color: var(--wep-red); background: var(--wep-red-bg); }

/* Primary Links (Dynamic) */
.wep-nav-links { display: flex; align-items: stretch; flex: 1; }
ul.wep-primary-nav-list { display: flex; align-items: stretch; list-style: none; margin: 0; padding: 0; }
ul.wep-primary-nav-list li { display: flex; align-items: stretch; }
ul.wep-primary-nav-list li a {
  display: flex; align-items: center; gap: 5px; padding: 0 16px; height: 48px;
  font-size: 14px; font-weight: 600; color: var(--wep-gray-700);
  white-space: nowrap; text-decoration: none; position: relative; transition: var(--wep-t);
}
ul.wep-primary-nav-list li a::after {
  content: ''; position: absolute; bottom: 0; right: 50%; left: 50%;
  height: 3px; background: var(--wep-red); transition: var(--wep-t); border-radius: 3px 3px 0 0;
}
ul.wep-primary-nav-list li a:hover { color: var(--wep-red); }
ul.wep-primary-nav-list li a:hover::after,
ul.wep-primary-nav-list li.current-menu-item a::after { right: 0; left: 0; }
ul.wep-primary-nav-list li.current-menu-item a { color: var(--wep-red); }


/* ══════════════════════════════════════════════════════
   MOBILE HEADER (Simplified)
══════════════════════════════════════════════════════ */
.wep-mobile-header {
  display: none; background: #fff;
  position: sticky; top: 0; z-index: 9999;
  box-shadow: var(--wep-shadow-sm);
}

.wep-mob-top { display: flex; align-items: center; padding: 10px 16px; gap: 10px; justify-content: center; }
.wep-mob-logo { display:flex; justify-content: center; }

.wep-mob-search { padding: 0 16px 12px; }
.wep-mob-search-form {
  display: flex; align-items: stretch;
  border: 1.5px solid var(--wep-blue); border-radius: var(--wep-r-full);
  overflow: hidden; background: #fff; box-shadow: 0 2px 8px rgba(16,17,59,.08);
}
.wep-mob-search-input {
  flex: 1; border: none; outline: none;
  font-family: inherit; font-size: 14px; direction: rtl; padding: 0 16px; height: 44px;
}
.wep-mob-search-btn {
  background: var(--wep-blue); color: #fff; border: none; padding: 0 18px;
  border-radius: var(--wep-r-full) 0 0 var(--wep-r-full); cursor: pointer;
}
.wep-mob-search-btn:hover { background: var(--wep-red); }


/* ══════════════════════════════════════════════════════
   MOBILE BOTTOM NAVIGATION (APP-LIKE)
══════════════════════════════════════════════════════ */
.wep-bottom-nav { display: none; }

@media (max-width: 900px) {
  .wep-header-sticky { display: none; }
  .wep-mobile-header { display: block; }
  
  .wep-bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0;
    background: #fff; box-shadow: 0 -4px 16px rgba(0,0,0,.08);
    height: 65px; z-index: 9999;
    align-items: center; justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .wep-bnav-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; color: var(--wep-gray-500); text-decoration: none; border: none; background: transparent; cursor: pointer;
    width: 20%; height: 100%; transition: var(--wep-t); font-family: inherit;
  }
  .wep-bnav-item svg { width: 22px; height: 22px; margin-bottom: 2px; }
  .wep-bnav-item span { font-size: 10.5px; font-weight: 700; white-space: nowrap; }
  
  .wep-bnav-item:hover, .wep-bnav-item:focus { color: var(--wep-red); }
  
  /* Offers standout button */
  .wep-bnav-offers { position: relative; }
  .wep-bnav-circle {
    width: 50px; height: 50px; border-radius: 50%;
    background: var(--wep-red); color: #fff;
    display: flex; align-items: center; justify-content: center;
    position: absolute; top: -20px;
    box-shadow: 0 4px 10px rgba(143,25,44,.35);
    border: 3px solid #fff;
  }
  .wep-bnav-circle svg { width: 20px; height: 20px; margin: 0; }
  .wep-bnav-offers span { position: relative; top: 16px; color: var(--wep-red); }

  /* Bottom Cart Badge */
  .wep-bnav-cart-wrapper .wep-bnav-icon-wrap { position: relative; }
  .wep-bnav-cart-wrapper .wep-cart-badge {
    position: absolute; top: -6px; right: -8px; left: auto;
    min-width: 16px; height: 16px; font-size: 9px;
    box-shadow: none; border: 1.5px solid #fff;
  }
}

/* ══════════════════════════════════════════════════════
   MOBILE DRAWER (Multi-level Menu)
══════════════════════════════════════════════════════ */
.wep-drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 10998; display: none; opacity: 0; transition: opacity .3s;
}
.wep-drawer-overlay.open { display: block; opacity: 1; }

.wep-drawer {
  position: fixed; top: auto; bottom: -100%; left: 0; right: 0;
  height: 85vh; background: #fff; border-radius: 20px 20px 0 0;
  z-index: 10999; box-shadow: var(--wep-shadow-lg);
  transition: bottom .3s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column; overflow: hidden;
}
.wep-drawer.open { bottom: 0; }
@media (min-width: 901px) { .wep-drawer { display: none; } } /* Hide on desktop */

.wep-drawer-head {
  padding: 18px 20px; border-bottom: 1px solid var(--wep-gray-100);
  display: flex; align-items: center; justify-content: space-between;
}
.wep-drawer-head strong { font-size: 16px; font-weight: 800; color: var(--wep-navy); }
.wep-drawer-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--wep-gray-100); display: flex; align-items: center; justify-content: center;
  color: var(--wep-gray-700); cursor: pointer; border: none;
}
.wep-drawer-close svg { width: 18px; height: 18px; }

.wep-drawer-body { flex: 1; overflow-y: auto; padding-bottom: 20px; }

/* Mobile Menu Output Styling */
ul.wep-mob-mega-nav { list-style: none; margin: 0; padding: 0; }
ul.wep-mob-mega-nav > li { border-bottom: 1px solid var(--wep-gray-50); }
ul.wep-mob-mega-nav a {
  display: block; padding: 14px 20px; font-size: 14.5px;
  color: var(--wep-navy); font-weight: 600; text-decoration: none;
}
/* Submenu toggle */
ul.wep-mob-mega-nav li.menu-item-has-children { position: relative; }
.wep-mob-submenu-toggle {
  position: absolute; left: 0; top: 0; width: 50px; height: 50px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; cursor: pointer;
  color: var(--wep-gray-400); transition: var(--wep-t);
}
.wep-mob-submenu-toggle.open { transform: rotate(180deg); color: var(--wep-red); }
ul.wep-mob-mega-nav .sub-menu {
  list-style: none; margin: 0; padding: 0; background: var(--wep-gray-50);
  display: none; border-top: 1px solid var(--wep-gray-100);
}
ul.wep-mob-mega-nav .sub-menu.open { display: block; }
ul.wep-mob-mega-nav .sub-menu li a {
  padding: 10px 20px 10px 30px; font-size: 13.5px; color: var(--wep-gray-600); font-weight: 500;
}
ul.wep-mob-mega-nav .sub-menu li a:before { content: '└ '; opacity: .5; margin-left: 5px; }
