:root {
  --aladin-primary: #522f70;
  --aladin-primary-contrast: #f6f3fa;
  --aladin-secondary: #fc6488;
  --aladin-tertiary: #f9b94d;
  --aladin-dark: #1a1525;
  --aladin-light: #f7f4fc;
  --aladin-muted: #82759b;
  --aladin-card-bg: #ffffff;
  --aladin-border: rgba(130, 117, 155, 0.15);
  --aladin-radius-lg: 28px;
  --aladin-radius-md: 18px;
  --aladin-radius-sm: 12px;
  --aladin-shadow-soft: 0 20px 45px rgba(82, 47, 112, 0.12);
  --aladin-gradient: linear-gradient(125deg, #522f70 0%, #fc6488 50%, #f9b94d 100%);
}

body {
  font-family: "Poppins", "Inter", sans-serif;
  background: radial-gradient(circle at 15% 10%, rgba(249, 185, 77, 0.12), rgba(82, 47, 112, 0) 55%),
              radial-gradient(circle at 85% 0%, rgba(252, 100, 136, 0.18), rgba(82, 47, 112, 0) 45%),
              var(--aladin-light);
  color: var(--aladin-dark);
}

a { color: inherit; }

.text-gradient {
  background: var(--aladin-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* =========================
   Buttons
========================= */
.btn-primary {
  background-color: #fc6488;
  border: none;
  color: var(--aladin-primary-contrast);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  box-shadow: 0 12px 24px rgba(82, 47, 112, 0.18);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #522f70;
  transform: translateY(-3px);
  box-shadow: 0 18px 32px rgba(82, 47, 112, 0.28);
  color: var(--aladin-primary-contrast);
}

.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.65);
  color: #fff;
}
.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.btn-outline-secondary {
  border-color: rgba(82, 47, 112, 0.35);
  color: var(--aladin-primary);
}
.btn-outline-secondary:hover {
  background: rgba(82, 47, 112, 0.08);
  border-color: transparent;
  color: var(--aladin-primary);
}

/* =========================
   Header
========================= */
header {
  backdrop-filter: blur(18px);
  background: #522f70;
}

/* header sticky top priority */
header.header-nav{
  position: sticky;
  top: 0;
  z-index: 2000;
}

/* remove hard margins on header elements */
#searchBar,
header .input-group,
header .profile-chip { margin-left: 0 !important; }

/* header layout */
.header-nav .header-top { gap: 12px; }
.header-left img { max-width: 70px; height: auto; }
.header-center { min-width: 0; }

/* Search */
.search-wrapper { position: relative; width: 100%; display: flex; align-items: center; }
.search-input {
  width: 100%;
  border-radius: 8px !important;
  border-right: none !important;
  padding-right: 52px !important;
}
.search-btn {
  position: absolute;
  right: 6px;
  top: 15%;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 14px;
  z-index: 2;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-wrapper:hover .search-input {
  border-color: var(--mdb-primary) !important;
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* icons sizing */
.profile-chip,
#cartBtn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}

/* profile */
header .profile-chip {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
}
header .profile-chip i:hover { color: #fc6488; }
header .profile-chip:hover { background: rgba(82, 47, 112, 0.15); }

/* cart */
#cartBtn{
  font-size: 1.5rem;
  background: none;
  border: none;
  padding: 0;
  display: grid;
  place-items: center;
}
#cartBtn i{ color: #fff; }
#cartBtn i:hover{ color: #fc6488; }

/* mobile search icon */
.m-s-icon{
  background: none;
  border: none;
}

/* mobile: keep top row compact */
@media (max-width: 576px) {
  .header-left img { max-width: 60px; }
  .search-btn{ top: 15% !important; }
}

/* =========================
   Category Nav (FINAL)
   - Desktop: overflow visible + wrap
   - Mobile: horizontal scroll + fixed overlay dropdown
========================= */

/* base */
[data-category-nav]{
  gap: .50rem;
}

/* pills */
.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1.35rem;
  border-radius: var(--aladin-radius-lg);
  background: rgba(82, 47, 112, 0.08);
  color: var(--aladin-card-bg);
  font-weight: 600;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  white-space: nowrap;
}
[data-category-nav] .category-pill:hover { color: #fc6488; }

/* dropdown items */
[data-category-nav] .dropdown-item:hover { background: rgba(82, 47, 112, 0.08); }
[data-category-nav] .dropdown-item { cursor: pointer; }

/* ===== Desktop ===== */
@media (min-width: 992px){
  /* IMPORTANT: bootstrap "overflow-auto" class কে override করবে */
  [data-category-nav]{
    overflow: visible !important;
    flex-wrap: wrap !important;
    white-space: normal !important;
  }

  [data-category-nav] .dropdown{
    position: relative;
    flex: 0 0 auto;
  }

  [data-category-nav] .dropdown-menu{
    min-width: 220px;
    border-radius: var(--aladin-radius-md);

    position: absolute !important;
    top: 100%;
    left: 0;

    display: none;
    z-index: 999999 !important;
    margin-top: .25rem;

    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  /* hover open */
  [data-category-nav] .dropdown:hover > .dropdown-menu{
    display: block !important;
  }

  /* ✅ click open (FIX) */
  [data-category-nav] .dropdown.active > .dropdown-menu{
    display: block !important;
  }
}

/* ===== Mobile ===== */
@media (max-width: 991.98px){
  [data-category-nav]{
    overflow-x: auto !important;
    overflow-y: visible !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap !important;
  }

  [data-category-nav]::-webkit-scrollbar{ height: 0; }
  [data-category-nav]{ scrollbar-width: none; }

  [data-category-nav] .dropdown{
    position: relative;
    flex: 0 0 auto;
  }

  /* fixed overlay dropdown */
  [data-category-nav] .dropdown-menu{
    min-width: 220px;
    border-radius: var(--aladin-radius-md);

    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    top: 110px !important;
    width: auto !important;

    max-height: 60vh;
    overflow-y: auto;

    z-index: 999999 !important;
    display: none;
  }

  [data-category-nav] .dropdown.active > .dropdown-menu{
    display: block !important;
  }
}

@media (max-width: 576px) {
  .category-pill{ background: #75757526; }
}

/* =========================
   Hero section
========================= */
.hero-section { margin-top: 48px; }

.hero-spotlight {
  background: radial-gradient(circle at 20% 20%, rgba(249, 185, 77, 0.15), rgba(82, 47, 112, 0) 55%),
              radial-gradient(circle at 80% 0%, rgba(252, 100, 136, 0.2), rgba(82, 47, 112, 0) 45%),
              linear-gradient(135deg, rgba(82, 47, 112, 0.9) 0%, rgba(82, 47, 112, 0.75) 45%, rgba(252, 100, 136, 0.75) 80%);
  border-radius: var(--aladin-radius-lg);
  padding: clamp(2.5rem, 4vw, 4.5rem);
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--aladin-shadow-soft);
}
.hero-spotlight::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 30%, rgba(249, 185, 77, 0.22), transparent 45%);
  pointer-events: none;
}
.hero-spotlight .hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  background: rgba(249, 185, 77, 0.18);
  color: #fff6dc;
  backdrop-filter: blur(12px);
  margin-bottom: 1.5rem;
}
.hero-spotlight .cta-actions .btn { min-width: 160px; }

/* =========================
   Feature cards
========================= */
.feature-stat {
  backdrop-filter: blur(12px);
  background: rgba(247, 244, 252, 0.65);
  border-radius: var(--aladin-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--aladin-shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.feature-stat h4 { color: var(--aladin-primary); font-weight: 700; }

.icon-wrap {
  background: rgba(255, 255, 255, 0.85);
  color: var(--aladin-primary);
  box-shadow: 0 10px 20px rgba(82, 47, 112, 0.12);
}

/* =========================
   Product card
========================= */
.product-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.product-section-header h3 { font-weight: 700; color: var(--aladin-primary); }

.view-all-link {
  color: var(--aladin-secondary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.view-all-link i { transform: translateX(0); transition: transform 0.2s ease; }
.view-all-link:hover i { transform: translateX(4px); }

.product-card {
  background: var(--aladin-card-bg);
  border-radius: 0.5rem;
  border: 1px solid var(--aladin-border);
  overflow: hidden;
  position: relative;
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}
.product-card:hover { transform: translateY(-6px); box-shadow: var(--aladin-shadow-soft); }
.product-card .card-img-top { height: 240px; object-fit: cover; }
.product-card .badge {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* wishlist */
.wishlist-toggle {
  position: absolute;
  right: 0px;
  width: 40px;
  height: 40px;
  border-radius: 50% !important;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  color: #522f70;
  transition: color 0.2s ease;
  box-shadow: none;
  z-index: 3;
}
.wishlist-toggle i {
  color: currentColor;
  pointer-events: none;
  font-size: 1rem;
  transition: color 0.2s ease;
}
.wishlist-toggle.active { color: #fc6488; }

/* banners */
.banner-ad { height: 300px !important; object-fit: fill !important; }

/* =========================
   Footer
========================= */
footer {
  background: #1d102a;
  color: #ddd0eb;
  position: relative;
  overflow: hidden;
}
footer::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: rgba(252, 100, 136, 0.08);
  top: -180px;
  right: -140px;
}
footer a { color: rgba(255, 255, 255, 0.75); transition: color 0.2s ease; }
footer a:hover { color: #fff; }
footer .newsletter-input {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #fff;
}
footer .newsletter-input::placeholder { color: rgba(255, 255, 255, 0.65); }

/* =========================
   Search Suggestions
========================= */
.search-suggestions { border: 1px solid var(--aladin-border); }
.search-suggestions .suggestion-item {
  transition: all 0.2s ease;
  cursor: pointer;
}
.search-suggestions .suggestion-item:hover,
.search-suggestions .suggestion-item.active {
  background: var(--aladin-light) !important;
  transform: translateX(4px);
}
.search-suggestions mark {
  background: var(--aladin-tertiary);
  color: var(--aladin-dark);
  padding: 2px 4px;
  border-radius: 4px;
}

/* =========================
   Cart Preview
========================= */
span.card-badge-pill.badge.rounded-pill.bg-warning.position-absolute.top-0.start-100 {
  transform: translate(-70%,-20%)!important;
  font-size: x-small !important;
}

#cartPreview { animation: slideDown 0.3s ease; }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
#cartPreviewItems img { border: 2px solid var(--aladin-border); }

/* Desktop default */
#cartPreview{
  width: 350px;
  max-height: 500px;
  overflow-y: auto;
}

/* Mobile fix */
@media (max-width: 576px){
  #cartPreview{
    width: min(350px, 92vw);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }
  header nav .container{
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
  .dropdown-menu-end{
    right: 8px !important;
    left: auto !important;
  }
}

/* =========================
   HERO CAROUSEL – FINAL (FIXED)
========================= */
.hero-carousel-section .carousel-inner > .carousel-item {
  display: none;
  float: left;
  width: 100%;
  margin-right: -100%;
  backface-visibility: hidden;
  transition: transform .6s ease-in-out;
}
.hero-carousel-section .carousel-inner > .carousel-item.active,
.hero-carousel-section .carousel-inner > .carousel-item-next,
.hero-carousel-section .carousel-inner > .carousel-item-prev {
  display: block;
}

.hero-carousel-section .carousel-item {
  position: relative;
  width: 100%;
  overflow: hidden;
  aspect-ratio: 1976 / 688;
}

.hero-carousel-section .carousel-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-position: center;
}

@media (min-width: 769px) {
  .hero-carousel-section .carousel-item img { object-fit: cover; }
}
@media (max-width: 768px) {
  .hero-carousel-section .carousel-item img { object-fit: cover; }
}

.hero-carousel-section .carousel-control-prev,
.hero-carousel-section .carousel-control-next {
  z-index: 3;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.25);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  backdrop-filter: blur(8px);
}

/* =========================
   Responsive refinements
========================= */
@media (max-width: 1200px) {
  .hero-spotlight { padding: 2.5rem; }
  .product-card .card-img-top { height: 220px; }
}

@media (max-width: 992px) {
  header .d-flex.flex-column { gap: 1.25rem; }
  .product-section-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .banner-ad { height: 240px !important; }
}

@media (max-width: 768px) {
  .product-card .card-img-top { height: 200px; }
  .wishlist-toggle { width: 36px; height: 36px; }
}

@media (max-width: 576px) {
  .hero-spotlight { text-align: center; }
  .feature-stat { width: 100%; text-align: center; }
  .product-card { border-radius: 0.45rem; }
  .wishlist-toggle { top: 8px; right: 8px; }

  .product-title {
    font-size: 1rem !important;
    line-height: 1.2 !important;
    max-height: 2.4rem !important;
    overflow: hidden !important;
  }

  .card-badge-pill{
    transform: translate(-70%,-20%)!important;
    font-size: x-small !important;
  }
}

@media (max-width: 480px) {
  .view-all-link { font-size: 0.9rem; }
  .product-card .card-img-top { height: 180px; }
  .category-pill { font-size: 0.8rem; padding: 0.4rem 0.8rem; }
}

/* =========================
   CART: prevent text overflow on mobile
========================= */
.cart-item,
.cart-product,
.cart-row,
.cart-item-row {
  align-items: flex-start;
}

/* flex child must be allowed to shrink */
.cart-item .details,
.cart-product .details,
.cart-item .cart-details,
.cart-item .info,
.cart-item .content,
.cart-item .right {
  min-width: 0 !important;
}

/* product title wrap + break */
.cart-item .product-title,
.cart-item .product-name,
.cart-item h5,
.cart-item h6,
.cart-item a {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

/* ensure image doesn't push layout */
.cart-item img {
  flex: 0 0 auto;
  max-width: 72px;
  height: auto;
}

/* price area align + wrap safe */
.cart-item .price,
.cart-item .total,
.cart-item .amount {
  white-space: nowrap;
}

/* cart main flex child shrink allow */
.cart-item .flex-grow-1{
  min-width: 0;
}

/* title wrap + break */
.cart-item h5{
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: x-small;
}

/* actions wrap control */
.cart-actions{
  min-width: 0;
}

/* Mobile layout */
@media (max-width: 576px){
  .cart-actions{
    gap: .5rem !important;
  }

  .cart-actions .input-group{
    width: 110px !important;
    flex: 0 0 auto;
  }

  .cart-actions .fw-bold{
    margin-left: auto;
    white-space: nowrap;
  }
}

.cart-item img{
  width: 72px;
  height: 72px;
  object-fit: cover;
  flex: 0 0 auto;
}
