/* ============================================================
   SahiDerma — Products Page
   Design: Premium dark-mode clinical e-commerce
   ============================================================ */

/* ---- Page Wrapper ---- */
.products-page-wrapper {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  min-height: 100vh;
  padding: 30px 0 100px;
}

/* ============================================================
   HERO SLIDER (MINIMAL & PREMIUM)
   ============================================================ */
.hero-slider {
  position: relative;
  width: 100%;
  height: 500px;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 40px;
  background: #f8fafc;
}

/* ---- Slides ---- */
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  display: flex;
  align-items: flex-end;
  /* Position button at bottom */
  justify-content: flex-start;
  /* Position button at left */
  padding: 40px;
  /* Space from edges */
  z-index: 1;
}

.hero-slide.hero-slide--active {
  opacity: 1;
  z-index: 2;
}

.clickable-banner {
  cursor: pointer;
}

.slide-img-only {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 0;
  transition: transform 0.8s ease, filter 0.5s ease;
}

.hero-slide:hover .slide-img-only {
  transform: scale(1.03);
  filter: brightness(1.05);
}

/* ---- Removed Buy Now Button ---- */
.slide-buy-now-btn {
  display: none;
}

/* ---- Buy Now Button (Bottom-Left) ---- */
.slide-buy-now-btn {
  position: relative;
  z-index: 5;
  padding: 14px 36px;
  background: linear-gradient(135deg, #ff2e88, #ff6bb3);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 25px rgba(255, 46, 136, 0.35);
}

.slide-buy-now-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 35px rgba(255, 46, 136, 0.5);
}

/* ---- Controls ---- */
.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: #0f172a;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.slider-arrow:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.1);
  color: #ff2e88;
}

.slider-prev {
  left: 20px;
}

.slider-next {
  right: 20px;
}

/* ---- Dots ---- */
.slider-dots {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 10px;
}

.slider-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.slider-dot.active {
  background: #ff2e88;
  transform: scale(1.3);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hero-slider {
    height: 400px;
    margin-bottom: 25px;
  }

  .hero-slide {
    padding: 25px;
  }

  .slide-buy-now-btn {
    padding: 12px 30px;
    font-size: 0.9rem;
  }

  .slider-arrow {
    display: none;
    /* Hide arrows on mobile for cleaner look */
  }
}

@media (max-width: 480px) {
  .hero-slider {
    height: 300px;
    border-radius: 12px;
  }
}

/* ---- Page Header ---- */
.products-header {
  padding: 10px 0 0;
}

.products-header h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: #fff !important;
  /* Override global h1 color: var(--dark) */
  line-height: 1.2 !important;
  /* Override any inherited line-height */
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.products-header p {
  font-size: 1.05rem;
  color: #94a3b8;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ---- Shop Tools Bar ---- */
.shop-tools-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 24px;
  margin-bottom: 28px;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: #0f172a;
  border: none;
  padding: 10px 20px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.tool-btn:hover {
  background: #f1f5f9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.tools-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---- Sort Dropdown ---- */
.sort-wrapper {
  position: relative;
}

.sort-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 210px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  padding: 10px;
  z-index: 500;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.25s ease;
}

.sort-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.sort-option {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #374151;
}

.sort-option:hover,
.sort-option.selected {
  background: #fff1f6;
  color: #ff2d8d;
  font-weight: 600;
}

/* ---- Active Filter Tags ---- */
.active-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  min-height: 0;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 45, 141, 0.15);
  color: #ff2d8d;
  border: 1px solid rgba(255, 45, 141, 0.3);
  padding: 5px 12px;
  border-radius: 30px;
  font-size: 0.82rem;
  font-weight: 600;
}

.filter-tag i {
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.filter-tag i:hover {
  opacity: 1;
}

/* ---- Products Grid ---- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* ---- Product Card ---- */
.product-card {
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

/* ---- Product Image Area ---- */
.product-top {
  position: relative;
  padding-top: 100%;
  /* 1:1 aspect ratio */
  overflow: hidden;
  background: #f8fafc;
}

.product-image-wrap {
  position: absolute;
  inset: 0;
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.product-card:hover .product-img {
  transform: scale(1.05);
}

/* ---- Quick View Overlay ---- */
.quick-view-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  cursor: pointer;
}

.product-card:hover .quick-view-overlay {
  opacity: 1;
}

.quick-view-overlay span {
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  background: rgba(255, 45, 141, 0.9);
  padding: 10px 20px;
  border-radius: 30px;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

/* ---- Product Badge ---- */
.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  background: linear-gradient(135deg, #ff2d8d, #9C27B0);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 30px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ---- Wishlist Button ---- */
.wishlist-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  width: 36px;
  height: 36px;
  background: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wishlist-icon:hover {
  background: #fff1f6;
  color: #ff2d8d;
  transform: scale(1.1);
}

.wishlist-icon.active {
  color: #ff2d8d;
}

/* ---- Product Content ---- */
.product-content {
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-skin-type {
  font-size: 0.8rem;
  color: #ff2d8d;
  font-weight: 500;
  margin-bottom: 12px;
}

.product-price-box {
  margin-bottom: 14px;
  margin-top: auto;
}

.price-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}

/* ---- Add to Cart Button ---- */
.btn-buy-full {
  width: 100%;
  padding: 11px 16px;
  background: linear-gradient(135deg, #ff2d8d, #9C27B0);
  color: #fff;
  border: none;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-buy-full:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 45, 141, 0.4);
}

/* ---- Empty State ---- */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: #64748b;
}

.empty-state i {
  font-size: 4rem;
  color: #334155;
  margin-bottom: 20px;
}

.empty-state h3 {
  font-size: 1.4rem;
  color: #94a3b8;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.95rem;
  color: #64748b;
}

/* ============================================================
   QUICK VIEW MODAL
   ============================================================ */
.qv-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.qv-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.qv-modal {
  background: #fff;
  border-radius: 20px;
  max-width: 900px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  position: relative;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
  transform: translateY(30px);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.qv-modal-overlay.active .qv-modal {
  transform: translateY(0);
}

.qv-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f1f5f9;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  color: #475569;
  transition: all 0.2s;
}

.qv-close:hover {
  background: #ff2d8d;
  color: #fff;
}

/* Quick View Left */
.qv-left {
  display: flex;
  gap: 12px;
  padding: 30px;
  background: #f8fafc;
}

.qv-thumbnails {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qv-thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s;
}

.qv-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.qv-thumb.active {
  border-color: #ff2d8d;
}

.qv-main-img-wrap {
  flex: 1;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.qv-img-main {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Quick View Right */
.qv-right {
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.qv-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #ff2d8d;
  background: #fff1f6;
  padding: 4px 12px;
  border-radius: 30px;
  width: fit-content;
}

.qv-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.3;
}

.qv-price-wrap {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.qv-price {
  font-size: 1.8rem;
  font-weight: 800;
  color: #0f172a;
}

.qv-mrp-text {
  font-size: 0.78rem;
  color: #94a3b8;
}

.qv-desc {
  font-size: 0.9rem;
  color: #64748b;
  line-height: 1.7;
  flex: 1;
}

.qv-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.qv-btn-cart {
  flex: 1;
  padding: 13px 20px;
  background: linear-gradient(135deg, #ff2d8d, #9C27B0);
  color: #fff;
  border: none;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.qv-btn-cart:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 45, 141, 0.4);
}

.qv-wishlist {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #f1f5f9;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.25s;
}

.qv-wishlist:hover {
  background: #fff1f6;
  color: #ff2d8d;
}

/* ============================================================
   FILTER SIDEBAR
   ============================================================ */
.filter-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 4000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.filter-overlay.active {
  opacity: 1;
  visibility: visible;
}

.filter-sidebar {
  position: fixed;
  top: 0;
  left: -340px;
  width: 320px;
  height: 100vh;
  background: #fff;
  z-index: 5000;
  display: flex;
  flex-direction: column;
  transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 30px rgba(0, 0, 0, 0.15);
}

.filter-sidebar.open {
  left: 0;
}

.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #f0f0f0;
}

.filter-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-header h3 i {
  color: #ff2d8d;
}

.close-sidebar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f1f5f9;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #475569;
  transition: all 0.2s;
}

.close-sidebar:hover {
  background: #ff2d8d;
  color: #fff;
}

.filter-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.filter-group {
  border-bottom: 1px solid #f1f5f9;
}

.filter-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  cursor: pointer;
  user-select: none;
}

.filter-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
}

.filter-title-wrap i {
  color: #94a3b8;
  font-size: 0.8rem;
  transition: transform 0.3s;
}

.filter-group.active .filter-title-wrap i {
  transform: rotate(180deg);
}

.filter-options-content {
  display: none;
  padding: 6px 24px 16px;
  flex-direction: column;
  gap: 6px;
}

.filter-group.active .filter-options-content {
  display: flex;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 0;
}

.filter-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #ff2d8d;
  cursor: pointer;
}

.option-label {
  font-size: 0.88rem;
  color: #374151;
}

.count {
  margin-left: auto;
  font-size: 0.78rem;
  color: #94a3b8;
}

/* ---- Price Slider ---- */
.price-slider-wrap {
  width: 100%;
}

.premium-range {
  width: 100%;
  accent-color: #ff2d8d;
  cursor: pointer;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: #64748b;
  margin-top: 8px;
}

.active-val {
  color: #ff2d8d;
  font-weight: 700;
}

/* ---- Filter Footer ---- */
.filter-footer {
  padding: 16px 24px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  gap: 12px;
}

.clear-btn {
  flex: 1;
  padding: 11px;
  border: 2px solid #e2e8f0;
  border-radius: 30px;
  background: transparent;
  font-weight: 700;
  font-size: 0.88rem;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
}

.clear-btn:hover {
  border-color: #ff2d8d;
  color: #ff2d8d;
}

.apply-btn {
  flex: 1;
  padding: 11px;
  background: linear-gradient(135deg, #ff2d8d, #9C27B0);
  color: #fff;
  border: none;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.3s;
}

.apply-btn:hover {
  box-shadow: 0 4px 14px rgba(255, 45, 141, 0.4);
  transform: translateY(-1px);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .qv-modal {
    grid-template-columns: 1fr;
    max-height: 90vh;
    overflow-y: auto;
  }

  .qv-left {
    padding: 24px;
  }

  .qv-right {
    padding: 24px;
  }
}

@media (max-width: 576px) {
  .products-grid {
    grid-template-columns: 1fr;
  }

  .products-header h1 {
    font-size: 2rem;
  }

/* ============================================================
   MOBILE RESPONSIVENESS (PRODUCTS)
   ============================================================ */

@media (max-width: 991px) {
  .products-header h1 {
    font-size: 2.2rem;
  }
}

@media (max-width: 768px) {
  .products-page-wrapper {
    padding: 10px 0 60px;
  }

  .shop-tools-bar {
    flex-direction: column;
    gap: 15px;
    padding: 16px;
    align-items: stretch;
  }

  .tools-right {
    justify-content: space-between;
  }

  .tool-btn {
    flex: 1;
    justify-content: center;
  }

  .sort-dropdown {
    width: 100%;
    left: 0;
    right: 0;
  }

  .ps-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
  }

  .ps-card {
    border-radius: 12px;
  }

  .ps-content {
    padding: 12px;
  }

  .ps-title {
    font-size: 0.95rem;
    margin-bottom: 4px;
  }

  .ps-price {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .ps-grid {
    grid-template-columns: repeat(2, 1fr); /* Force 2 columns on very small screens for compact look */
    gap: 12px;
  }
  
  .ps-badge {
    font-size: 0.65rem;
    padding: 4px 8px;
  }
}