/* ==========================================================================
   CHUYÊN GIA ĐÈN - LUXURY FACET SEARCH & PRODUCT FILTERING SYSTEM
   Dimensions:
   1. Cao độ trần yêu cầu (Ceiling Height)
   2. Dải tải trọng tĩnh khung đèn (Static Load Weight)
   3. Chất liệu tinh thể pha lê (Crystal Material)
   4. Trường phái thẩm mỹ nội thất thực tế (Interior Architectural Style)
   ========================================================================== */

:root {
  --facet-gold: #dfb962;
  --facet-gold-light: #f5d77f;
  --facet-gold-dark: #c49a45;
  --facet-bg-card: #141417;
  --facet-bg-elevated: #1a1a1f;
  --facet-border: rgba(201, 168, 76, 0.22);
  --facet-border-hover: rgba(201, 168, 76, 0.5);
  --facet-text-muted: rgba(255, 255, 255, 0.65);
}

/* --- Layout Container: Sidebar + Content --- */
.shop-layout-wrapper {
  background: #0d0d0e;
  padding: 35px 0 80px;
}

.shop-layout-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 32px;
  align-items: flex-start;
  position: relative;
}

/* --- Desktop Facet Sidebar --- */
.shop-facet-sidebar {
  width: 320px;
  flex-shrink: 0;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  background: var(--facet-bg-card);
  border: 1px solid var(--facet-border);
  border-radius: 16px;
  padding: 22px 20px 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 168, 76, 0.35) transparent;
  transition: all 0.3s ease;
}

.shop-facet-sidebar::-webkit-scrollbar {
  width: 5px;
}
.shop-facet-sidebar::-webkit-scrollbar-thumb {
  background: rgba(201, 168, 76, 0.35);
  border-radius: 10px;
}

/* Sidebar Header */
.facet-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.facet-sidebar-header__title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-serif, "Cinzel", serif);
  font-size: 16.5px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.facet-sidebar-header__title svg {
  color: var(--facet-gold);
  flex-shrink: 0;
}

.facet-btn-clear-all {
  background: transparent;
  border: 1px solid rgba(201, 168, 76, 0.3);
  color: var(--facet-gold);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.facet-btn-clear-all:hover {
  background: rgba(201, 168, 76, 0.15);
  border-color: var(--facet-gold);
  color: #fff;
}

/* Facet Group / Accordion */
.facet-group {
  margin-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 18px;
}

.facet-group:last-child {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.facet-group__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  padding: 6px 0;
}

.facet-group__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: #f0e6d2;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.facet-group__title svg {
  color: var(--facet-gold);
  width: 15px;
  height: 15px;
}

.facet-group__toggle-icon {
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
  transition: transform 0.25s ease;
}

.facet-group.collapsed .facet-group__toggle-icon {
  transform: rotate(-90deg);
}

.facet-group.collapsed .facet-group__options {
  display: none;
}

.facet-group__subtitle {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.45);
  margin: 2px 0 10px 0;
  line-height: 1.4;
}

.facet-group__options {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 6px;
}

/* Individual Facet Option Item */
.facet-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.facet-option:hover {
  background: rgba(201, 168, 76, 0.06);
  border-color: rgba(201, 168, 76, 0.2);
}

.facet-option.active {
  background: rgba(201, 168, 76, 0.12);
  border-color: rgba(201, 168, 76, 0.5);
  box-shadow: 0 2px 10px rgba(201, 168, 76, 0.1);
}

/* Custom Luxury Checkbox */
.facet-checkbox {
  position: relative;
  width: 17px;
  height: 17px;
  margin-top: 2px;
  flex-shrink: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  background: #18181c;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.facet-option:hover .facet-checkbox {
  border-color: var(--facet-gold);
}

.facet-option.active .facet-checkbox {
  background: linear-gradient(135deg, var(--facet-gold-light) 0%, var(--facet-gold) 100%);
  border-color: var(--facet-gold);
}

.facet-checkbox svg {
  width: 11px;
  height: 11px;
  color: #0d0d0e;
  stroke-width: 3.5;
  display: none;
}

.facet-option.active .facet-checkbox svg {
  display: block;
}

/* Option Label & Subtext */
.facet-option__content {
  flex: 1;
  min-width: 0;
}

.facet-option__main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.facet-option__name {
  font-size: 13px;
  font-weight: 600;
  color: #e8e3d9;
  line-height: 1.35;
  transition: color 0.2s;
}

.facet-option.active .facet-option__name {
  color: var(--facet-gold-light);
  font-weight: 700;
}

.facet-option__count {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 6px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  transition: all 0.2s;
}

.facet-option.active .facet-option__count {
  color: #0d0d0e;
  background: var(--facet-gold);
  border-color: var(--facet-gold);
  font-weight: 700;
}

.facet-option__desc {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.48);
  margin-top: 2px;
  line-height: 1.35;
}

/* Sidebar Engineering Support Banner */
.facet-sidebar-advisory {
  margin-top: 22px;
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.12) 0%, rgba(20, 20, 24, 0.95) 100%);
  border: 1px dashed rgba(201, 168, 76, 0.4);
  border-radius: 12px;
  padding: 14px 14px;
  text-align: center;
}

.facet-sidebar-advisory h5,
.facet-sidebar-advisory .facet-sidebar-advisory__title {
  font-size: 12px;
  font-weight: 700;
  color: var(--facet-gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 6px 0;
}

.facet-sidebar-advisory p {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.45;
  margin: 0 0 10px 0;
}

.facet-sidebar-advisory a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--facet-gold);
  color: #0d0d0e;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.2s;
  width: 100%;
}

.facet-sidebar-advisory a:hover {
  background: var(--facet-gold-light);
  transform: translateY(-1px);
}

/* --- Main Content Area --- */
.shop-content-area {
  flex: 1;
  min-width: 0;
}

/* Active Filters Pills Strip */
.active-facets-bar {
  background: #141417;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.active-facets-bar__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--facet-gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: 4px;
}

.active-facet-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(201, 168, 76, 0.14);
  border: 1px solid rgba(201, 168, 76, 0.45);
  color: #f7eed7;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.2s;
}

.active-facet-pill:hover {
  background: rgba(201, 168, 76, 0.25);
  border-color: var(--facet-gold);
  color: #fff;
}

.active-facet-pill .remove-icon {
  font-size: 14px;
  line-height: 1;
  color: var(--facet-gold);
  margin-left: 2px;
}

.active-facets-clear-all {
  color: rgba(255, 255, 255, 0.55);
  font-size: 11.5px;
  text-decoration: underline;
  cursor: pointer;
  margin-left: auto;
  transition: color 0.2s;
}

.active-facets-clear-all:hover {
  color: #fff;
}

/* Product Cards Grid inside Layout */
.shop-grid-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  transition: opacity 0.25s ease;
}

.shop-grid-inner.loading {
  opacity: 0.5;
  pointer-events: none;
}

/* Technical Specification Tags on Product Cards */
.product-specs-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 12px;
  min-height: 24px;
}

.spec-pill {
  font-size: 10px;
  font-weight: 600;
  padding: 2.5px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.72);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.spec-pill svg {
  width: 10px;
  height: 10px;
  color: var(--facet-gold);
  flex-shrink: 0;
}

.spec-pill.highlighted {
  background: rgba(201, 168, 76, 0.16);
  border-color: rgba(201, 168, 76, 0.45);
  color: var(--facet-gold-light);
  font-weight: 700;
}

/* --- Mobile Floating Filter Trigger Bar --- */
.shop-mobile-filter-bar {
  display: none;
  position: sticky;
  top: 60px;
  z-index: 90;
  background: rgba(12, 13, 16, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(223, 185, 98, 0.25);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.5);
  padding: 10px 16px;
  margin-bottom: 16px;
}

.mobile-filter-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  max-width: 1280px;
  margin: 0 auto;
}

.btn-open-facet-drawer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(223, 185, 98, 0.18) 0%, rgba(20, 21, 26, 0.9) 100%);
  border: 1px solid rgba(223, 185, 98, 0.45);
  color: #F8E298;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.btn-open-facet-drawer:hover {
  background: linear-gradient(135deg, #F8E298 0%, #DFB962 100%);
  color: #0A0B0E;
  border-color: #DFB962;
  box-shadow: 0 6px 20px rgba(223, 185, 98, 0.4);
}

.btn-open-facet-drawer svg {
  color: var(--facet-gold);
  transition: transform 0.25s;
}
.btn-open-facet-drawer:hover svg {
  color: #0A0B0E;
  transform: scale(1.1);
}

.facet-active-badge-num {
  background: var(--facet-gold);
  color: #0d0d0e;
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 10px;
}

.mobile-filter-stats {
  font-size: 13px;
  color: rgba(240, 240, 245, 0.72);
}
.mobile-filter-stats strong {
  color: #F8E298;
  font-weight: 700;
}

.mobile-filter-stats strong {
  color: var(--facet-gold);
}

/* --- Mobile Drawer / Bottom Sheet Modal --- */
.shop-facet-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000001;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.shop-facet-drawer-overlay.active {
  display: block;
  opacity: 1;
}

.shop-facet-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 90%;
  max-width: 420px;
  height: 100%;
  background: #121215;
  border-left: 1px solid var(--facet-border);
  z-index: 1000002;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8);
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.shop-facet-drawer.active {
  right: 0;
}

.facet-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #17171c;
}

.facet-drawer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-serif, "Cinzel", serif);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
}

.facet-drawer-title svg {
  color: var(--facet-gold);
}

.facet-drawer-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}

.facet-drawer-close:hover {
  color: #fff;
}

.facet-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  scrollbar-width: thin;
}

.facet-drawer-footer {
  padding: 16px 20px max(18px, env(safe-area-inset-bottom));
  background: #17171c;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 10px;
  position: relative;
  z-index: 10;
}

.btn-drawer-reset {
  flex: 1;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-drawer-reset:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
}

.btn-drawer-apply {
  flex: 2;
  padding: 11px 16px;
  background: linear-gradient(135deg, var(--facet-gold-light) 0%, var(--facet-gold-dark) 100%);
  border: none;
  color: #0d0d0e;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(201, 168, 76, 0.3);
  transition: all 0.2s;
}

.btn-drawer-apply:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(201, 168, 76, 0.5);
}

/* --- Responsive Breakpoints --- */
@media (max-width: 1150px) {
  .shop-facet-sidebar {
    width: 280px;
  }
  .shop-grid-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 900px) {
  .shop-facet-sidebar {
    display: none; /* Hidden on tablet & mobile; replaced by drawer */
  }
  .shop-layout-container {
    display: block;
    padding: 0 16px;
  }
  .shop-mobile-filter-bar {
    display: block;
  }
  .shop-grid-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}

@media (max-width: 580px) {
  .shop-layout-wrapper {
    padding: 20px 0 60px;
  }
  .shop-grid-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .product-specs-list {
    display: none; /* Hide small tags on ultra small mobile to save space, or show 1-2 pills */
  }
  .facet-drawer-footer {
    padding: 12px 16px;
  }
}

/* AJAX Loading State & Category Count Badges */
.filter-btn__count {
  display: inline-block;
  background: rgba(201, 168, 76, 0.16);
  color: var(--facet-gold-light, #f5d77f);
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 12px;
  margin-left: 6px;
  font-weight: 600;
  vertical-align: middle;
  border: 1px solid rgba(201, 168, 76, 0.25);
  transition: all 0.2s ease;
}
.filter-btn.active .filter-btn__count {
  background: rgba(201, 168, 76, 0.35);
  color: #fff;
  border-color: var(--facet-gold, #dfb962);
}
.shop-grid-inner {
  transition: opacity 0.25s ease, filter 0.25s ease;
}
.shop-grid-inner.loading {
  opacity: 0.45;
  filter: blur(1.5px);
  pointer-events: none;
}
.facet-option--empty {
  display: none !important;
}

/* --- Instant Load More Component (Maison Luxury Aesthetic) --- */
.shop-loadmore-wrapper {
  grid-column: 1 / -1;
  text-align: center;
  margin: 52px auto 36px auto;
  max-width: 480px;
  width: 100%;
  padding: 26px 28px;
  background: linear-gradient(180deg, rgba(23, 23, 28, 0.85) 0%, rgba(14, 14, 17, 0.95) 100%);
  border: 1px solid rgba(201, 168, 76, 0.22);
  border-radius: 18px;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.shop-loadmore-wrapper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18%;
  right: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(223, 185, 98, 0.55), transparent);
}

.shop-loadmore-status {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.shop-loadmore-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(220, 220, 230, 0.75);
  letter-spacing: 0.3px;
  font-family: var(--font-sans, 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif);
}

.loadmore-label,
.loadmore-unit {
  color: rgba(220, 220, 230, 0.75);
  font-weight: 400;
}

.loadmore-counter {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 3px 12px;
  background: rgba(201, 168, 76, 0.08);
  border: 1px solid rgba(201, 168, 76, 0.28);
  border-radius: 20px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}

.loadmore-counter #displayedCount {
  color: #dfb962;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
  letter-spacing: 0.5px;
}

.loadmore-counter .counter-sep {
  color: rgba(201, 168, 76, 0.4);
  font-size: 13px;
  font-weight: 300;
}

.loadmore-counter .counter-total {
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-serif, 'Playfair Display', Georgia, serif);
  letter-spacing: 0.5px;
}

.shop-progress-bar {
  width: 100%;
  max-width: 240px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
  position: relative;
}

.shop-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #b89547 0%, #dfb962 55%, #f7e6ab 100%);
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 0 0 10px rgba(223, 185, 98, 0.5);
}

.btn-shop-loadmore {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 34px;
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.14) 0%, rgba(223, 185, 98, 0.22) 100%);
  border: 1px solid rgba(201, 168, 76, 0.5);
  border-radius: 30px;
  color: #f7e6ab;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  user-select: none;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.btn-shop-loadmore:hover {
  background: linear-gradient(135deg, #c5a869 0%, #dfb962 100%);
  border-color: #dfb962;
  color: #0b0b0e;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(201, 168, 76, 0.4);
}

.btn-shop-loadmore svg {
  transition: transform 0.25s ease;
  stroke: currentColor;
}

.btn-shop-loadmore:hover svg {
  transform: translateY(2px);
}

.btn-shop-loadmore:active {
  transform: translateY(0);
}

@media (max-width: 576px) {
  .shop-loadmore-wrapper {
    margin: 40px 12px 24px 12px;
    padding: 22px 18px;
    width: auto;
  }
  .shop-loadmore-text {
    font-size: 13px;
    gap: 6px;
  }
  .loadmore-counter {
    padding: 2px 10px;
  }
  .loadmore-counter #displayedCount,
  .loadmore-counter .counter-total {
    font-size: 15px;
  }
  .btn-shop-loadmore {
    width: 100%;
    padding: 12px 20px;
    font-size: 13px;
  }
}



