/* Base */
html { scroll-behavior: smooth; overflow-x: hidden; }
body { font-family: 'Inter', sans-serif; overflow-x: hidden; max-width: 100vw; }

/* Prevent any child from breaking viewport */
img, video, svg, canvas, iframe { max-width: 100%; }
* { box-sizing: border-box; }

/* Announcement bar */
.announcement-bar { transition: transform .3s ease, opacity .3s ease; }
.announcement-bar.hidden-bar { transform: translateY(-100%); opacity: 0; pointer-events: none; }

/* Header sticky shadow + auto-hide on scroll down */
.header { transition: transform .3s ease, box-shadow .2s ease; }
.header.is-scrolled { box-shadow: 0 4px 20px rgba(0,0,0,.06); }
.header.is-hidden { transform: translateY(-100%); }

/* Header icons: always visible on all sizes */
.header .flex > button,
.header .flex > a,
.header .flex > div > button,
.header .flex > div > a {
  min-height: 44px;
  min-width: 44px;
}

/* Mobile header auto-fit: prevent overflow and white stripe */
@media (max-width: 640px) {
  .header .container { padding-left: 0.5rem; padding-right: 0.5rem; }
  .header .flex { gap: 0.25rem; }
  .header img[alt="ARABIA PERFUMES"] {
    height: 44px !important;
    max-height: 44px !important;
    max-width: 150px !important;
  }
  .header .flex > button,
  .header .flex > a,
  .header .flex > div > button,
  .header .flex > div > a {
    min-height: 38px;
    min-width: 38px;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }
  .header .flex > button i,
  .header .flex > a i,
  .header .flex > div > button i,
  .header .flex > div > a i {
    width: 1.25rem;
    height: 1.25rem;
  }
  .header .flex > button span,
  .header .flex > a span,
  .header .flex > div > button span,
  .header .flex > div > a span {
    font-size: 0.55rem;
  }
}
@media (min-width: 641px) and (max-width: 1023px) {
  .header img[alt="ARABIA PERFUMES"] {
    height: 56px !important;
    max-height: 56px !important;
  }
}

/* Mega menu */
.mega-menu { pointer-events: none; }
.group:hover .mega-menu { pointer-events: auto; }

/* Top nav hover: stronger visible color */
nav.bg-black ul li a {
  transition: color .15s ease, transform .15s ease;
}
nav.bg-black ul li a:hover {
  color: var(--gold) !important;
  transform: translateY(-1px);
}
nav.bg-black ul li a.text-\[var\(--gold\)\]:hover {
  color: #fff !important;
}
/* Submenu links */
.mega-menu ul li a:hover,
nav.bg-black .group div ul li a:hover {
  color: var(--gold) !important;
  background-color: rgba(212, 162, 79, .08);
  border-radius: 4px;
}

/* Line clamp */
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Product panels */
.product-panel { display: none; }
.product-panel.active { display: block; animation: fadeIn .25s ease; }

.product-tab.active { color: #000; border-color: #000; }

/* Drawers & modals common */
.drawer-open, .modal-open { overflow: hidden; }

#mobile-menu.invisible,
#cart-drawer.invisible,
#login-modal.invisible,
#search-drawer.invisible { visibility: hidden; }

#mobile-menu:not(.invisible),
#cart-drawer:not(.invisible),
#login-modal:not(.invisible),
#search-drawer:not(.invisible) { visibility: visible; }

#mobile-menu.open > div:last-child,
#cart-drawer.open > div:last-child { transform: translateX(0); }

#search-drawer.open > div:last-child { transform: translateY(0); }

#login-modal.open > div:last-child { transform: scale(1); opacity: 1; }

#mobile-menu.open > .mobile-overlay,
#cart-drawer.open > .cart-overlay,
#login-modal.open > .login-overlay,
#search-drawer.open > .search-overlay { opacity: 1; }

/* Swiper custom */
.hero-swiper .swiper-pagination-bullet { background: rgba(255,255,255,.6); opacity: 1; }
.hero-swiper .swiper-pagination-bullet-active { background: #fff; }

.categories-swiper .swiper-slide { width: auto; }

.brands-swiper .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  filter: grayscale(100%);
  opacity: .8;
  transition: filter .2s, opacity .2s;
}
.brands-swiper .swiper-slide:hover { filter: grayscale(0%); opacity: 1; }

.testimonials-swiper .swiper-pagination-bullet-active { background: #000; }

/* Product card */
.product-card { transition: transform .2s ease; }
.product-card:hover { transform: translateY(-4px); }

/* Hover image: real or CSS simulated box */
.hover-image-wrap::before,
.hover-box::before {
  content: '';
  position: absolute;
  inset: 18% 20% 14% 18%;
  background: linear-gradient(135deg, rgba(212, 162, 79, 0.06), rgba(0, 0, 0, 0.02));
  border-radius: 6px;
  opacity: 0;
  transition: opacity .5s ease;
  z-index: 0;
}
.product-card:hover .hover-image-wrap::before,
.product-card:hover .hover-box::before { opacity: 1; }
.hover-box img {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 18px 30px rgba(0,0,0,.18));
}
.hover-real { z-index: 1; }
.main-img { z-index: 1; }

/* Main catalog subtle gray-white background */
#catalogo {
  background-color: #f4f4f5;
}
#catalogo .container {
  background-color: transparent;
}
#catalogo .product-panel {
  background-color: #ffffff;
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 4px 24px rgba(0,0,0,.04);
}
@media (min-width: 768px) {
  #catalogo .product-panel {
    padding: 1.5rem;
    border-radius: 1.25rem;
  }
}
#catalogo .product-panel .catalog-grid {
  padding-bottom: 0.5rem;
}
#catalogo .product-tab {
  transition: all .2s ease;
}
#catalogo .product-tab:hover {
  background-color: rgba(255,255,255,.22);
  box-shadow: 0 2px 12px rgba(255,255,255,.12);
}
#catalogo .product-tab.active {
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Brand ticker (single-row auto-scrolling marquee, draggable) */
.brand-ticker {
  width: 100%;
  overflow: hidden;
  cursor: grab;
  user-select: none;
}
.brand-ticker:active { cursor: grabbing; }
.brand-ticker-track {
  display: flex;
  width: max-content;
  will-change: transform;
}
.brand-ticker-track.animate-marquee {
  animation: marquee 45s linear infinite;
}
.brand-ticker.is-dragging .brand-ticker-track.animate-marquee,
.brand-ticker:hover .brand-ticker-track.animate-marquee {
  animation-play-state: paused;
}
.brand-ticker-item {
  width: 260px;
}
@media (min-width: 768px) {
  .brand-ticker-item { width: 300px; }
}
/* Prevent drag image ghost */
.brand-ticker-item img {
  pointer-events: none;
  -webkit-user-drag: none;
}
/* Duplicate content for seamless loop */
.brand-ticker-track::after {
  content: '';
  display: block;
  width: 0;
}

.animate-on-scroll {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .6s ease, transform .6s ease;
}
.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Form focus */
input:focus, button:focus { outline: none; }

/* Scrollbar (subtle) */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }

/* Hero canvas / video */
.hero-swiper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 300px;
  max-height: 90vh;
  background: #050505;
}
.hero-swiper .swiper-wrapper,
.hero-swiper .swiper-slide { height: 100%; }
.hero-swiper .swiper-slide {
  min-height: auto;
  background: #050505;
  overflow: hidden;
}
.hero-video-canvas,
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #050505;
  object-fit: cover;
}

/* More breathable layout defaults */
main section + section { margin-top: 0; }
.section-heading { letter-spacing: -0.01em; }

/* More breathable layout defaults */
main section + section { margin-top: 0; }
.section-heading { letter-spacing: -0.01em; }

/* Mobile bottom nav for quick actions */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .hero-swiper { min-height: 260px; }
  .mega-menu { display: none; }

  .header .container:first-child > .flex {
    min-height: 56px;
  }

  .header .flex > button,
  .header .flex > a,
  .header .flex > div > button,
  .header .flex > div > a {
    min-height: 44px;
    min-width: 44px;
  }

  /* Hero text mobile */
  .hero-swiper .max-w-lg {
    max-width: 100%;
    padding: 0 0.25rem;
  }
  .hero-swiper h2 { font-size: 1.5rem !important; }
  .hero-swiper p { font-size: 0.875rem !important; }
  .hero-swiper a { font-size: 0.875rem !important; padding: 0.625rem 1rem !important; }
  .hero-swiper span.inline-block { font-size: 0.65rem !important; padding: 0.25rem 0.5rem !important; }


  /* Catalog tabs */
  .inline-flex.flex-wrap.justify-center.gap-1.md\:gap-2 {
    padding: 0.375rem;
    border-radius: 9999px;
  }
  .product-tab {
    padding: 0.5rem 0.875rem !important;
    font-size: 0.8125rem !important;
  }

  /* Catalog grid spacing */
  .catalog-grid {
    gap: 1rem !important;
  }
  .product-card h3 {
    font-size: 0.8125rem;
  }
  .product-card .text-sm {
    font-size: 0.75rem;
  }

  /* Testimonials */
  .testimonials-swiper .swiper-slide { padding: 1rem; }

  /* Blog cards */
  section.bg-white .grid > article .p-5 { padding: 1rem; }
  section.bg-white .grid > article h3 { font-size: 0.9375rem; }
  section.bg-white .grid > article p { font-size: 0.8125rem; }

  /* Footer compact */
  footer.pt-16 { padding-top: 2rem; }
  footer h4 { font-size: 0.8125rem; }

  /* Floating buttons */
  .fixed.bottom-5.right-5 { bottom: 1rem; right: 1rem; padding: 0.75rem; }

  /* Mobile bottom nav */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: #fff;
    border-top: 1px solid #f3f4f6;
    justify-content: space-around;
    align-items: center;
    padding: 0.375rem 0;
  }
  .mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    font-size: 0.6rem;
    color: #6b7280;
    padding: 0.25rem 0.75rem;
    min-height: 44px;
    justify-content: center;
  }
  .mobile-bottom-nav a.active,
  .mobile-bottom-nav a:hover { color: #000; }
  .mobile-bottom-nav i { width: 1.25rem; height: 1.25rem; }
  body { padding-bottom: 58px; }
}

@media (min-width: 769px) {
  .hero-swiper { min-height: 420px; }
}

/* Cart drawer: always-visible checkout button */
#cart-drawer.open > div:last-child {
  /* leave room for the fixed checkout button at the bottom */
  padding-bottom: 5rem;
}
#cart-drawer #checkout-btn {
  position: fixed;
  left: auto;
  right: 1.5rem;
  bottom: 1rem;
  width: calc(100% - 3rem);
  max-width: 26rem;
  z-index: 9999;
  box-shadow: 0 -4px 20px rgba(0,0,0,.15);
  background-color: #000 !important;
  color: #fff !important;
}
#cart-drawer #checkout-btn:hover,
#cart-drawer #checkout-btn:focus {
  background-color: #22c55e !important; /* verde WhatsApp */
  color: #fff !important;
}
/* On mobile the drawer is full-width and the bottom nav is hidden while open */
@media (max-width: 640px) {
  #cart-drawer.open > div:last-child {
    padding-bottom: calc(6rem + env(safe-area-inset-bottom, 0px));
  }
  #cart-drawer #checkout-btn {
    left: 1rem;
    right: 1rem;
    width: auto;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  }
  body.drawer-open .mobile-bottom-nav {
    display: none !important;
  }
}

/* Cart item image fallback */
#cart-items img {
  object-fit: contain;
}
