/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 50;
  transition: background var(--transition-normal), padding var(--transition-normal);
  padding: 1rem 0;
}

.site-header.is-scrolled {
  background: var(--color-black-80);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-white-5);
  padding: 0.5rem 0;
}

.header-topbar-wrap {
  transition: max-height 0.3s ease, opacity 0.3s ease;
  max-height: 60px;
  overflow: hidden;
  opacity: 1;
}
.header-topbar-wrap.is-hidden {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.header-topbar {
  border-bottom: 1px solid var(--color-white-5);
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--color-gray-400);
  font-weight: 500;
}

.header-topbar .topbar-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header-topbar .topbar-right {
  display: flex;
  gap: 1rem;
}

.header-topbar .topbar-right a,
.header-topbar .topbar-right button {
  color: var(--color-gray-400);
  transition: color var(--transition-fast);
}

.header-topbar .topbar-right a:hover,
.header-topbar .topbar-right button:hover {
  color: var(--color-white);
}

.topbar-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--color-white-60);
  animation: pulse 2s infinite;
}

.topbar-divider {
  width: 1px;
  height: 1rem;
  background: var(--color-white-10);
}

/* Language Switcher */
.ff-lang-switch {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.ff-lang-flag {
  font-size: 0.875rem;
  line-height: 1;
  text-decoration: none;
  opacity: 0.35;
  transition: opacity 0.2s;
  cursor: pointer;
}

.ff-lang-flag:hover {
  opacity: 0.7;
}

.ff-lang-flag.ff-lang-active {
  opacity: 1;
}

/* Trust Badges Inline */
.trust-badges-inline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--color-gray-500);
}

.trust-badges-inline .trust-badge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.trust-badges-inline .trust-stars {
  color: var(--color-yellow-500);
  display: flex;
  gap: 1px;
}

/* Header Main Row */
.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo img {
  height: 2rem;
  width: auto;
  object-fit: contain;
}

@media (min-width: 768px) {
  .header-logo img {
    height: 2.5rem;
  }
}

/* Desktop Nav */
.header-nav {
  display: none;
  align-items: center;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .header-nav {
    display: flex;
  }
}

.header-nav a,
.header-nav button {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-gray-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color var(--transition-fast);
}

.header-nav a:hover,
.header-nav button:hover {
  color: var(--brand-accent);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

@media (min-width: 768px) {
  .header-actions {
    gap: 1.5rem;
  }
}

.header-action-btn {
  color: var(--color-gray-400);
  padding: 0.5rem;
  border-radius: 50%;
  transition: color var(--transition-fast), background var(--transition-fast);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-action-btn:hover {
  color: var(--color-white);
  background: var(--color-white-5);
}

.header-action-btn svg {
  width: 22px;
  height: 22px;
}

.cart-count {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  background: var(--color-white);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-menu-btn {
  display: flex;
}

@media (min-width: 1024px) {
  .mobile-menu-btn {
    display: none;
  }
}

.desktop-only {
  display: none !important;
}

@media (min-width: 768px) {
  .desktop-only {
    display: flex !important;
  }
}

.lg-only {
  display: none !important;
}

@media (min-width: 1024px) {
  .lg-only {
    display: block !important;
  }
}

.lg-hide {
  display: block;
}

@media (min-width: 1024px) {
  .lg-hide {
    display: none;
  }
}

/* ==========================================================================
   MEGA MENU
   ========================================================================== */
.mega-menu-wrap {
  position: relative;
}

.mega-menu {
  position: fixed;
  top: auto;
  left: 50%;
  transform: translateX(-50%) translateY(-0.5rem);
  padding-top: 0.25rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  z-index: 60;
}

.mega-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.mega-menu-inner {
  background: var(--brand-gray);
  border: 1px solid var(--color-white-10);
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
  padding: 2rem;
  width: 95vw;
  max-width: 1200px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.5rem;
}

.mega-menu-col h3 {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-white);
  border-bottom: 1px solid var(--color-white-5);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.mega-menu-col h3 a {
  transition: color var(--transition-fast);
}

.mega-menu-col h3 a:hover {
  color: var(--brand-accent);
}

.mega-menu-col ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mega-menu-col li a {
  font-size: 0.75rem;
  color: var(--color-white-80);
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color var(--transition-fast);
}

.mega-menu-col li a:hover {
  color: var(--brand-accent);
}

.mega-menu-col li a .cat-count {
  font-size: 9px;
  color: var(--color-gray-600);
}

.mega-menu-col li a:hover .cat-count {
  color: rgba(209,213,219,0.5);
}

.mega-menu-col .subcategories {
  margin-left: 0.5rem;
  margin-top: 0.25rem;
  padding-left: 0.5rem;
  border-left: 1px solid var(--color-white-10);
}

.mega-menu-col .subcategories li a {
  font-size: 11px;
  color: var(--color-gray-500);
  padding: 0;
}

.mega-menu-footer {
  grid-column: 1 / -1;
  border-top: 1px solid var(--color-white-5);
  margin-top: 1rem;
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mega-menu-footer a {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-accent);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  transition: color var(--transition-fast);
}

.mega-menu-footer a:hover {
  color: var(--color-white);
}

.mega-menu-footer span {
  font-size: 10px;
  color: var(--color-gray-500);
}

/* ==========================================================================
   SEARCH OVERLAY
   ========================================================================== */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  display: none;
  flex-direction: column;
  animation: fadeIn 0.3s ease;
}

.search-overlay.is-open {
  display: flex;
}

.search-overlay-header {
  display: flex;
  justify-content: flex-end;
  padding: 2rem;
}

.search-overlay-close {
  padding: 0.75rem;
  background: var(--color-white-5);
  border-radius: 50%;
  color: var(--color-white);
  transition: background var(--transition-fast);
}

.search-overlay-close:hover {
  background: var(--color-white-10);
}

.search-overlay-close svg {
  width: 32px;
  height: 32px;
}

.search-overlay-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  margin-top: -5rem;
}

.search-overlay-label {
  font-size: 10px;
  color: var(--color-gray-500);
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-align: center;
}

.search-form-overlay {
  width: 100%;
  max-width: 48rem;
  position: relative;
}

.search-form-overlay input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--color-white-10);
  padding: 1.5rem 6rem 1.5rem 0;
  font-size: 1.5rem;
  color: var(--color-white);
  outline: none;
  transition: border-color var(--transition-normal);
  font-family: var(--font-sans);
}

@media (min-width: 768px) {
  .search-form-overlay input {
    font-size: 2.25rem;
  }
}

.search-form-overlay input::placeholder {
  color: var(--color-gray-700);
}

.search-form-overlay input:focus {
  border-color: var(--brand-accent);
}

.search-form-actions {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-form-actions button {
  color: var(--color-white);
  transition: color var(--transition-fast);
}

.search-form-actions button:hover {
  color: var(--brand-accent);
}

.search-tags {
  margin-top: 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.search-tags-label {
  width: 100%;
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-gray-600);
  margin-bottom: 0.5rem;
}

.search-tag {
  padding: 0.5rem 1rem;
  background: var(--color-white-5);
  border: 1px solid var(--color-white-5);
  border-radius: 9999px;
  font-size: 0.875rem;
  color: var(--color-gray-400);
  transition: all var(--transition-fast);
}

.search-tag:hover {
  background: var(--color-white-10);
  color: var(--color-white);
}

/* ==========================================================================
   MOBILE SIDEBAR
   ========================================================================== */

/* When sidebar is open, raise header z-index so sidebar escapes its stacking context */
body.mobile-sidebar-open .site-header {
  z-index: 9999;
}

/* Backdrop overlay */
.mobile-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-sidebar-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

/* Sidebar panel */
.mobile-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  max-width: 85vw;
  z-index: 9999;
  background: #0c0c0c;
  border-left: 1px solid var(--color-white-10);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.mobile-sidebar.is-open {
  transform: translateX(0);
}

@media (min-width: 1024px) {
  .mobile-sidebar,
  .mobile-sidebar-backdrop {
    display: none !important;
  }
}

/* Sidebar header */
.mobile-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.25rem;
  border-bottom: 1px solid var(--color-white-5);
  flex-shrink: 0;
}

.mobile-sidebar-logo img {
  height: 1.75rem;
  width: auto;
}

.mobile-sidebar-close {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  background: var(--color-white-5);
  color: var(--color-gray-400);
  transition: all var(--transition-fast);
}

.mobile-sidebar-close:hover {
  background: var(--color-white-10);
  color: var(--color-white);
}

.mobile-sidebar-close svg {
  width: 20px;
  height: 20px;
}

/* Sidebar body (scrollable) */
.mobile-sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0;
  -webkit-overflow-scrolling: touch;
}

/* Nav link rows */
.mobile-sidebar-nav {
  padding: 0 0.5rem;
}

.mobile-sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 0.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-white);
  border-radius: 0.75rem;
  transition: background var(--transition-fast), color var(--transition-fast);
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.mobile-sidebar-link:hover,
.mobile-sidebar-link:active {
  background: var(--color-white-5);
}

.mobile-sidebar-link > svg:first-child {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--color-gray-500);
}

.mobile-sidebar-link > span:not(.mobile-sidebar-chevron) {
  flex: 1;
}

.mobile-sidebar-link > svg:last-child {
  width: 14px;
  height: 14px;
  color: var(--color-gray-700);
  flex-shrink: 0;
}

/* Chevron rotation for accordion */
.mobile-sidebar-chevron {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  transition: transform 0.25s ease, background 0.2s ease;
}

.mobile-sidebar-chevron:hover {
  background: rgba(255, 255, 255, 0.12);
}

.mobile-sidebar-chevron svg {
  width: 14px;
  height: 14px;
  color: var(--color-gray-400);
}

.mobile-sidebar-chevron.is-expanded {
  transform: rotate(180deg);
  background: rgba(255, 255, 255, 0.1);
}

/* Divider between nav groups */
.mobile-sidebar-divider {
  height: 1px;
  background: var(--color-white-5);
  margin: 0.5rem 1.25rem;
}

/* Category accordion inside sidebar */
.mobile-sidebar-accordion .mobile-cat-children {
  display: none;
  padding: 0 0 0.25rem;
}

.mobile-sidebar-accordion .mobile-cat-children.is-open {
  display: block;
}

.mobile-sidebar-subgroup {
  margin: 0;
}

/* Mobile Category Accordion */
.mobile-cat-header {
  display: flex;
  align-items: center;
  min-height: 44px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.mobile-cat-header a {
  flex: 1;
  padding: 0.75rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-white);
  transition: color var(--transition-fast);
}

.mobile-cat-header a:hover {
  color: var(--brand-accent);
}

.mobile-cat-toggle {
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gray-600);
  border-left: 1px solid rgba(255, 255, 255, 0.03);
  transition: background var(--transition-fast), color var(--transition-fast);
  border-radius: 0 0.5rem 0.5rem 0;
}

.mobile-cat-toggle:hover {
  background: var(--color-white-5);
  color: var(--brand-accent);
}

.mobile-cat-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform 0.25s ease;
}

.mobile-cat-toggle.is-expanded svg {
  transform: rotate(180deg);
}

.mobile-cat-children {
  background: rgba(255, 255, 255, 0.02);
  display: none;
  border-radius: 0 0 0.5rem 0.5rem;
}

.mobile-cat-children.is-open {
  display: block;
}

.mobile-cat-children a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 0.75rem 0.625rem 1.5rem;
  font-size: 0.8125rem;
  color: var(--color-gray-400);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  transition: color var(--transition-fast);
}

.mobile-cat-children a:hover {
  color: var(--color-white);
}

.mobile-cat-children .cat-count {
  font-size: 10px;
  color: var(--color-gray-700);
  background: var(--color-white-5);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
}
/* Sidebar footer */
.mobile-sidebar-footer {
  flex-shrink: 0;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--color-white-5);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mobile-sidebar-phone {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--brand-accent);
  font-weight: 600;
  font-size: 0.875rem;
  transition: color var(--transition-fast);
}

.mobile-sidebar-phone:hover {
  color: var(--color-white);
}

.mobile-sidebar-phone svg {
  width: 16px;
  height: 16px;
}

.mobile-sidebar-trust {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* WhatsApp button in sidebar */
.mobile-sidebar-whatsapp {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  background: rgba(37, 211, 102, 0.1);
  border: 1px solid rgba(37, 211, 102, 0.2);
  border-radius: 0.75rem;
  color: #25D366;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all var(--transition-fast);
}

.mobile-sidebar-whatsapp:hover {
  background: rgba(37, 211, 102, 0.2);
  border-color: rgba(37, 211, 102, 0.4);
}

.mobile-sidebar-whatsapp svg {
  flex-shrink: 0;
}

/* Footer bottom row: trust + lang side by side */
.mobile-sidebar-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.mobile-sidebar-footer-row .ff-lang-switch {
  gap: 0.5rem;
}

.mobile-sidebar-footer-row .ff-lang-flag {
  font-size: 1.25rem;
}

