:root {
  --bg: #0b0f17;
  --panel: #080a11;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: rgba(255, 255, 255, .08);
  --accent: #ff3d6e;
}

body.light-theme {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --text: #0f172a;  
  --muted: #475569;
  --border: rgba(15, 23, 42, .10);
}

html {
  min-height: 100vh;
  margin: 0;
}

body {
  background: var(--bg) !important;
  color: var(--text) !important;
  font-family: "Bell MT", serif;
  min-height: 100vh;
  margin: 0;
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
  width: 100%;
}

/* NAVBAR */
.navbar {
  position: sticky;
  top: 0;
  z-index: 999;
  background: rgba(11, 15, 23, .85) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 10px 0 !important;
  transition: transform 0.3s ease-in-out;
}

body.light-theme .navbar {
  background: rgba(255, 255, 255, .9) !important;
}

.brand-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.brand-logo-nm {
  height: 28px;
  width: auto;
  object-fit: contain;
  transform: scale(2.2);
  transform-origin: left center;
  margin-left: -5px;
  transition: all .3s ease;
}

.main-logo-static {
    height: 38px !important;
    width: auto !important;
    object-fit: contain !important;
    display: block !important;
    max-height: 100% !important;
    transition: none !important;
}

/* Strict Navbar Brand alignment */
.navbar-brand {
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    height: 38px !important;
}

/* Default (Dark Theme) Logo Visibility */
.logo-light {
  display: none !important;
}
.logo-dark {
  display: block !important;
}

/* Light Theme Logo Visibility */
body.light-theme .logo-dark {
  display: none !important;
}
body.light-theme .logo-light {
  display: block !important;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

@media (max-width: 576px) {
  .brand-logo {
    height: 32px;
  }

  .brand-logo-nm {
    transform: scale(2);
    margin-left: -10px;
  }

  .navbar-actions {
    gap: 8px;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
  }

  .cart-btn-nav {
    padding: 4px 10px !important;
  }
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, .12) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  text-decoration: none !important;
  transition: all .2s ease;
  padding: 0;
  line-height: 1;
}

body.light-theme .icon-btn {
  background: rgba(0, 0, 0, .04) !important;
}

/* Search Placeholder Theme Colors */
.search-input-themed::placeholder {
  color: var(--text) !important;
  opacity: 0.8 !important;
}

.search-input-themed::-webkit-input-placeholder {
  color: var(--text) !important;
  opacity: 0.8 !important;
}

.search-input-themed::-moz-placeholder {
  color: var(--text) !important;
  opacity: 0.8 !important;
}

.search-input-themed:-ms-input-placeholder {
  color: var(--text) !important;
  opacity: 0.8 !important;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, .1) !important;
  transform: translateY(-2px);
}

/* FILTER */
.filter-section {
  padding: 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 997;
  background: rgba(11, 15, 23, .85) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: top 0.3s ease-in-out;
}

body.light-theme .filter-section {
  background: rgba(255, 255, 255, .9) !important;
}

.back-btn {
  color: var(--text);
  opacity: 0.8;
  font-weight: 500;
  font-size: 0.95rem; 
  transition: all 0.3s ease;
  white-space: nowrap;
  padding-left: 15px;
}

.back-btn:hover {
  opacity: 1;
  color: var(--accent);
}

@media (max-width: 576px) {
  .back-btn {
    font-size: 0.8rem;
    padding-left: 10px;
  }

  .back-btn i {
    font-size: 1rem;
  }
}

.filter-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-right: 15px;
}

.filter-scroll::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.filter-btn:hover {
  background: var(--panel);
}

.filter-btn.active {
  background: #d4af37;
  color: #1a1a1c;
  border-color: #d4af37;
  transform: translateY(-2px);
  text-decoration: none;
}

/* CATEGORY HERO BANNER */
.category-hero {
  position: relative;
  height: 200px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.category-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.category-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.4) 100%);
  z-index: 1;
}

.category-hero-inner {
  position: relative;
  z-index: 2;
  color: #fff;
}

.category-badge {
  display: inline-block;
  background: #d4af37;
  color: #1a1a1c;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.category-hero-title {
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 6px 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.category-hero-sub {
  font-size: 0.95rem;
  opacity: 0.8;
  margin: 0;
}

@media (max-width: 576px) {
  .category-hero {
    height: 150px;
  }

  .category-hero-title {
    font-size: 1.4rem;
  }
}

@media (min-width: 992px) {
  .category-hero {
    height: 240px;
  }

  .category-hero-title {
    font-size: 2.5rem;
  }
}

/* WATERFALL SUB FILTERS */
.sub-filter-container {
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  width: 100%;
  animation: slideDownFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

body.light-theme .sub-filter-container {
  background: rgba(0, 0, 0, 0.02);
}

.size-btn {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: var(--text);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: normal;
    word-break: break-word;
}

.sub-filter-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none !important;
}

.sub-filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #666;
  color: white;
}

.sub-filter-btn.active {
  background: #d4af37;
  border-color: #d4af37;
  color: #1a1a1c;
  /* box-shadow: 0 0 10px rgba(230, 179, 179, 0.3); */
    text-decoration: none !important;

}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* PRODUCT */
.product-section {
  margin-top: 20px;
  padding: 8px;
}

/* PRODUCT COLUMNS */
.product-col {
  width: 50% !important;
  padding: 4px;
}

/* CARD */
.card-custom {
  background: var(--panel);
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: 0.3s;
  color: var(--text);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card-custom:hover {
  transform: translateY(-6px);
  border-color: #333;
}

.card-custom img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top center;
  transition: opacity 0.3s ease;
}

/* IMAGE CAROUSEL NAV */
.image-container {
  overflow: hidden;
  position: relative;
}

.carousel-nav-btns {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card-custom:hover .carousel-nav-btns {
  opacity: 1;
}

.nav-btn {
  width: 30px !important;
  height: 30px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.8) !important;
  border: none !important;
  color: #000 !important;
  display: grid;
  place-items: center;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, background 0.2s !important;
}

.nav-btn:hover {
  background: #fff !important;
  transform: scale(1.1);
}

.nav-btn i {
  font-size: 14px;
}

/* PRODUCT INFO */
.product-info {
  padding: 10px;
}

.product-info h6,
.product-sub,
.product-price {
  color: var(--text);
}

.product-info h6 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.price-container {
  display: flex;
  align-items: center;
  gap: 6px;
}

.product-price {
  font-weight: 600;
  font-size: 15px;
}

.original-price {
  font-size: 12px;
  color: #888;
  text-decoration: line-through;
  font-weight: 400;
}

.rating {
  font-size: 13px;
  color: #ffc107;
}

/* ACTIONS */
.card-actions {
  display: flex;
  justify-content: space-between;
  padding: 5px 10px;
}

.card-actions button {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.card-actions button:hover {
  background: var(--panel);
}

/* BUY NOW */
.buyNowBtn {
  width: 90%;
  margin: auto auto 12px auto;
  display: block;
  background: var(--text);
  color: var(--bg);
  border: none;
  padding: 8px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
}

/* MODAL */
.dark-modal {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
}

.modal-sizes {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.size-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 8px;
}

.size-btn.active {
  background: var(--text);
  color: var(--bg);
}

#qtyInput {
  width: 100%;
  margin-top: 6px;
  padding: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
}

/* LAPTOP & DESKTOP STYLES MIN-WIDTH: 992px */
@media(min-width:992px) {
  .navbar {
    padding: 10px 24px;
  }

  .brand-logo {
    height: 62px;
  }

  #searchInput {
    width: 180px;
  }

  .product-section {
    padding: 0px;
  }

  .product-col {
    width: 25% !important;
    padding: calc(var(--bs-gutter-x) * 0.5);
  }

  .card-custom img {
    height: auto;
  }

  .product-info {
    padding: 12px;
  }

  .product-info h6 {
    white-space: normal;
    overflow: visible;
  }

  .product-sub {
    font-size: 12px;
  }

  .price-row {
    margin-top: 6px;
  }

  .product-price {
    font-size: 16px;
  }

  .card-actions {
    padding: 10px 12px;
  }

  .card-actions button {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  .buyNowBtn {
    font-size: 14px;
    padding: 8px;
    margin-bottom: 14px;
  }
}

/* ==========================================================
   FILTER SYSTEM STYLES
   ========================================================== */

/* Filter Toggle Button (in category bar) */
.filter-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 30px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.filter-toggle-btn:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: #d4af37;
  color: #d4af37;
}

.filter-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #d4af37;
  color: #1a1a1c;
  font-size: 11px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  line-height: 1;
}

/* Active Filter Chips Bar */
.active-chips-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  padding: 10px 16px !important;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 12px;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: #d4af37;
  border-radius: 30px;
  font-size: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.filter-chip:hover {
  background: rgba(212, 175, 55, 0.22);
  color: #d4af37;
  text-decoration: none;
}

.filter-chip-clear {
  background: rgba(255, 61, 110, 0.1);
  border-color: rgba(255, 61, 110, 0.3);
  color: var(--accent);
}

.filter-chip-clear:hover {
  background: rgba(255, 61, 110, 0.2);
  color: var(--accent);
}

/* ── Filter Offcanvas Sidebar ─────────────────────────────── */
.filter-offcanvas {
  width: 320px !important;
  background: #0d1018 !important;
  border-right: 1px solid var(--border) !important;
  color: var(--text) !important;
}

body.light-theme .filter-offcanvas {
  background: #fff !important;
}

.filter-offcanvas .offcanvas-header {
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
}

.filter-offcanvas .offcanvas-title {
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
}

.filter-offcanvas .offcanvas-body {
  padding: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

/* Filter Groups */
.filter-group {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.filter-group:last-of-type {
  border-bottom: none;
}

.filter-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
  margin-bottom: 12px;
}

/* Filter Option Chips (inside offcanvas) */
.filter-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-opt-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 20px;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.filter-opt-chip input {
  display: none; /* hide the actual radio/checkbox */
}

.filter-opt-chip:hover {
  border-color: #d4af37;
  color: var(--text);
}

.filter-opt-chip.active {
  background: rgba(212, 175, 55, 0.18);
  border-color: #d4af37;
  color: #d4af37;
  font-weight: 600;
}

/* Price Slider */
.price-display {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}

.price-slider-track {
  position: relative;
  height: 28px;
  display: flex;
  align-items: center;
}

.price-range {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.12);
  border-radius: 4px;
  outline: none;
  pointer-events: none;
}

.price-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d4af37;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 0 6px rgba(212,175,55,0.4);
}

.price-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d4af37;
  cursor: pointer;
  pointer-events: auto;
  border: none;
}

/* New Arrivals Toggle */
.filter-new-toggle {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  user-select: none;
}

.filter-new-toggle input {
  display: none;
}

.toggle-track {
  position: relative;
  width: 40px;
  height: 22px;
  background: rgba(255,255,255,0.1);
  border-radius: 11px;
  border: 1px solid var(--border);
  transition: background 0.25s;
  flex-shrink: 0;
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--muted);
  border-radius: 50%;
  transition: transform 0.25s, background 0.25s;
}

.filter-new-toggle input:checked + .toggle-track {
  background: rgba(212, 175, 55, 0.3);
  border-color: #d4af37;
}

.filter-new-toggle input:checked + .toggle-track .toggle-thumb {
  transform: translateX(18px);
  background: #d4af37;
}

/* Filter Action Buttons */
.filter-actions {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  background: #0d1018;
}

body.light-theme .filter-actions {
  background: #fff;
}

.filter-clear-btn {
  flex: 1;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
  padding: 9px 0;
  text-decoration: none;
  transition: all 0.2s;
}

.filter-clear-btn:hover {
  color: var(--text);
  border-color: var(--text);
}

.filter-apply-btn {
  flex: 2;
  background: #d4af37;
  color: #1a1a1c;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 0;
  transition: all 0.2s;
}

.filter-apply-btn:hover {
  background: #e0be4a;
  transform: translateY(-1px);
}

/* ==========================================================
   INFINITE SCROLL — SKELETON CARDS & END BANNER
   ========================================================== */

/* ── Shimmer keyframe ── */
@keyframes shimmer-sweep {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}

.shimmer-animate {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.11) 40%,
    rgba(255, 255, 255, 0.04) 100%
  );
  background-size: 1200px 100%;
  animation: shimmer-sweep 1.5s ease-in-out infinite;
}

body.light-theme .shimmer-animate {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.05) 0%,
    rgba(0, 0, 0, 0.13) 40%,
    rgba(0, 0, 0, 0.05) 100%
  );
  background-size: 1200px 100%;
  animation: shimmer-sweep 1.5s ease-in-out infinite;
}

/* ── Skeleton column (same breakpoints as .product-col) ── */
.skeleton-col {
  width: 50% !important;
  padding: 4px;
}

@media (min-width: 992px) {
  .skeleton-col {
    width: 25% !important;
    padding: calc(var(--bs-gutter-x) * 0.5);
  }
}

/* ── Skeleton card shell ── */
.skeleton-card {
  background: var(--panel);
  border-radius: 14px;
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ── Image area (3 : 4 portrait, same as real card) ── */
.skeleton-img {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 0;
  flex-shrink: 0;
}

/* ── Info body ── */
.skeleton-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

/* ── Generic shimmer line ── */
.skeleton-line {
  height: 13px;
  width: 82%;
  border-radius: 6px;
}

.skeleton-line.short {
  width: 55%;
  height: 11px;
}

/* ── Price row (mirrors .price-row) ── */
.skeleton-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}

.skeleton-line.price {
  height: 15px;
  width: 42%;
}

.skeleton-line.rating-chip {
  height: 13px;
  width: 22%;
}

/* ── Card actions row (mirrors .card-actions) ── */
.skeleton-actions-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0 0;
}

.skeleton-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

@media (min-width: 992px) {
  .skeleton-action-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }
}

/* ── Buy Now button (mirrors .buyNowBtn) ── */
.skeleton-buynow {
  height: 34px;
  width: 90%;
  margin: 0 auto 4px;
  border-radius: 10px;
}

/* ── Scroll sentinel (invisible trigger) ── */
#scrollSentinel {
  height: 1px;
  width: 100%;
  display: block;
}

/* ── End-of-feed banner ── */
.infinite-end-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 32px 16px 40px;
  color: var(--muted);
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  animation: fadeInUpBanner 0.55s ease forwards;
}

.end-banner-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.end-banner-text {
  white-space: nowrap;
  flex-shrink: 0;
}

.end-banner-text .bi-check-circle-fill {
  color: #d4af37;
}

@keyframes fadeInUpBanner {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
