/* ===========================================
   Vilches Menu Drawer — Parfois style
   Hamburger always visible; clean side drawer.
   =========================================== */

/* Hide existing megamenu — replaced by drawer */
.ApMegamenu,
.leo-megamenu,
.box-header3 .col-menu,
.box-header3 .navbar {
  display: none !important;
}

/* ---- Hamburger trigger — fallback fixed position (before JS moves it) ---- */
.vilches-menu-trigger {
  position: fixed;
  top: 70px;
  left: 35px;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  z-index: 9990;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.3s ease, background 0.2s ease;
}

/* After JS moves trigger inside header: position absolute, perfectly centered */
.vilches-menu-trigger--inheader {
  position: absolute !important;
  top: 50% !important;
  left: 30px !important;
  transform: translateY(-50%);
}

.vilches-menu-trigger:hover {
  background: rgba(255, 255, 255, 0.15);
}

.vilches-menu-trigger i {
  font-size: 28px;
}

/* On non-index pages, trigger is black (white header always) */
body:not(#index) .vilches-menu-trigger {
  color: #1a1a1a;
}

body:not(#index) .vilches-menu-trigger:hover,
body.header-scrolled .vilches-menu-trigger:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* When header has scrolled and is white, trigger turns black */
body.header-scrolled .vilches-menu-trigger {
  color: #1a1a1a;
}

/* ---- Force header background based on real scroll position (not theme class) ---- */
body#index:not(.header-scrolled) #header,
body#index:not(.header-scrolled) #header.navbar-fixed-top {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0) 100%) !important;
  box-shadow: none !important;
}

body#index.header-scrolled #header {
  background: #fff !important;
}

/* Text/icon shadow on transparent header for extra readability over bright images */
body#index:not(.header-scrolled) .col-info i,
body#index:not(.header-scrolled) .h-logo img,
body#index:not(.header-scrolled) .vilches-menu-trigger i,
body#index:not(.header-scrolled) .vilches-header-search i,
body#index:not(.header-scrolled) .vilches-header-search input {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* ---- Logo: keep original (white) on transparent, black filter on scrolled ---- */
body#index:not(.header-scrolled) .h-logo img,
body#index:not(.header-scrolled) .h-logo.vilches-logo--moved img {
  filter: none !important;
}

body#index.header-scrolled .h-logo img,
body#index.header-scrolled .h-logo.vilches-logo--moved img {
  filter: brightness(0) !important;
}

/* Other pages: always solid white header, black logo */
body:not(#index) #header {
  background: #fff !important;
}

body:not(#index) .h-logo img {
  filter: brightness(0) !important;
}

/* ---- Cart icon size — match account & wishlist icons (20px) ---- */
.col-info .leo-blockcart .ti-shopping-cart,
.col-info .blockcart .ti-shopping-cart,
.col-info i.ti-shopping-cart {
  font-size: 20px !important;
}

/* ---- Right-side icons (account / wishlist / cart) white on transparent header ---- */
body#index:not(.header-scrolled) .col-info,
body#index:not(.header-scrolled) .col-info a,
body#index:not(.header-scrolled) .col-info i,
body#index:not(.header-scrolled) .col-info span,
body#index:not(.header-scrolled) .leo-blockcart .header,
body#index:not(.header-scrolled) .leo-blockcart .header a,
body#index:not(.header-scrolled) .leo-blockcart i,
body#index:not(.header-scrolled) .popup-over a.popup-title,
body#index:not(.header-scrolled) .wislish-button a,
body#index:not(.header-scrolled) .wislish-button i {
  color: #fff !important;
}

/* ---- Logo moved by JS to header inner: glued to hamburger ---- */
.h-logo.vilches-logo--moved {
  position: absolute !important;
  top: 50% !important;
  left: 90px !important; /* hamburger right edge (30+40) + 20px gap */
  transform: translateY(-50%) !important;
  margin: 0 !important;
  padding: 0 !important;
  z-index: 5;
}

.h-logo.vilches-logo--moved img {
  display: block !important;
  margin: 0 !important;
  max-height: 60px;
  width: auto !important;
}

/* Hide the original empty .col-logo wrapper */
.col-logo:empty,
.col-logo:not(:has(.h-logo)) {
  display: none !important;
}

.col-logo .h-logo,
.box-top .h-logo,
.box-vogatop2 .h-logo,
.box-header3 .h-logo,
.h-logo {
  position: static !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  transform: none !important;
  text-align: left !important;
  margin: 0 !important;
  padding: 0 !important;
  display: inline-block !important;
  width: auto !important;
  max-width: none !important;
}

.col-logo .h-logo a,
.col-logo .h-logo img {
  margin: 0 !important;
  display: block !important;
  position: static !important;
}

/* Hide old leoproductsearch — replaced by our central search */
#leo_search_block_top,
.leoproductsearch-result,
.col-info .block.exclusive {
  display: none !important;
}

/* ---- Header search bar in center (injected inside header by JS) ---- */
.vilches-header-search {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 360px;
  max-width: 40vw;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #fff;
}

.vilches-header-search i {
  color: #fff;
  font-size: 18px;
  transition: color 0.3s ease;
}

.vilches-header-search input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  color: #fff;
  font-size: 14px;
  padding: 4px 0;
  transition: color 0.3s ease;
}

.vilches-header-search input::placeholder {
  color: rgba(255, 255, 255, 0.85);
  transition: color 0.3s ease;
}

/* Black on solid header */
body.header-scrolled .vilches-header-search,
body:not(#index) .vilches-header-search {
  border-bottom-color: #1a1a1a;
}

body.header-scrolled .vilches-header-search i,
body:not(#index) .vilches-header-search i,
body.header-scrolled .vilches-header-search input,
body:not(#index) .vilches-header-search input {
  color: #1a1a1a;
}

body.header-scrolled .vilches-header-search input::placeholder,
body:not(#index) .vilches-header-search input::placeholder {
  color: rgba(0, 0, 0, 0.55);
}

@media (max-width: 991px) {
  .vilches-header-search {
    display: none; /* hide on mobile to save space */
  }
}

/* ---- Overlay ---- */
.vilches-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.vilches-menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ---- Drawer ---- */
.vilches-menu-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 340px;
  max-width: 90vw;
  height: 100vh;
  background: #fff;
  z-index: 9999;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.1);
}

.vilches-menu-drawer.open {
  transform: translateX(0);
}

/* ---- Search (top of drawer, no header/logo) ---- */
.vilches-menu-search {
  padding: 30px 24px 16px;
  flex-shrink: 0;
}

.vilches-menu-search form {
  position: relative;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #e5e5e5;
  padding-bottom: 6px;
}

.vilches-menu-search i {
  color: #888;
  font-size: 18px;
  margin-right: 8px;
}

.vilches-menu-search input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: #1a1a1a;
  padding: 6px 0;
}

.vilches-menu-search input::placeholder {
  color: #888;
}

/* ---- Nav list (scrollable) ---- */
.vilches-menu-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 24px;
  display: flex;
  flex-direction: column;
}

.vilches-menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.vilches-menu-item {
  border: none;
}

.vilches-menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
}

.vilches-menu-row > a {
  flex: 1;
  display: block;
  padding: 14px 0;
  color: #1a1a1a;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.vilches-menu-row > a:hover {
  color: #555;
}

.vilches-menu-toggle {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a1a1a;
  transition: transform 0.25s ease;
}

.vilches-menu-toggle i {
  font-size: 22px;
}

.vilches-menu-item.expanded .vilches-menu-toggle {
  transform: rotate(180deg);
}

/* Sub-list */
.vilches-menu-sub {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.vilches-menu-item.expanded .vilches-menu-sub {
  max-height: 800px;
}

.vilches-menu-sub li a {
  display: block;
  padding: 10px 18px 10px 32px;
  color: #555;
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.vilches-menu-sub li a:hover {
  color: #1a1a1a;
  background: #f8f8f8;
}

/* Item with icon (Tarjeta Regalo) */
.vilches-menu-item--icon .vilches-menu-row > a {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vilches-menu-item--icon .vilches-menu-row > a i {
  font-size: 20px;
}

/* ---- Outlet button (orange) ---- */
.vilches-menu-outlet {
  display: block;
  margin: 18px 18px 16px;
  padding: 14px 0;
  background: #f17070;
  color: #fff;
  text-decoration: none;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 0;
  transition: background 0.2s;
}

.vilches-menu-outlet:hover {
  background: #e55757;
  color: #fff;
}

/* ---- Footer icons ---- */
.vilches-menu-footer {
  display: flex;
  gap: 10px;
  padding: 8px 18px 20px;
  flex-shrink: 0;
}

.vilches-menu-footer a {
  width: 44px;
  height: 44px;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a1a1a;
  text-decoration: none;
  transition: background 0.2s;
}

.vilches-menu-footer a:hover {
  background: #f5f5f5;
}

.vilches-menu-footer a i {
  font-size: 20px;
}

/* Body lock when drawer open */
body.vilches-menu-open {
  overflow: hidden;
}

/* ---- Mobile fine-tune ---- */
@media (max-width: 575px) {
  .vilches-menu-drawer {
    width: 100%;
    max-width: 100%;
  }
  .vilches-menu-trigger {
    top: 14px;
    left: 12px;
  }
}
