/* ==========================================================================
   Sri Lakshmi Fashion (SLF) - Screen 9: Search Results Page Styles
   Brand Identity: Deep Burgundy (#720120), Royal Gold (#cca352),
   Warm Ivory (#faf7f2), Playfair Display & Plus Jakarta Sans.
   ========================================================================== */

/* Page Container */
.search-results-page {
  background-color: var(--color-bg-page, #faf7f2);
  min-height: 80vh;
  padding-bottom: 60px;
}

.search-container {
  max-width: var(--container-max-width, 1440px);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   1. BREADCRUMBS & TOP SEARCH HEADER
   ========================================================================== */
.search-breadcrumbs-wrap {
  padding: 18px 0 10px 0;
}

.search-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #777777;
}

.search-breadcrumbs a {
  color: #777777;
  text-decoration: none;
  transition: color 0.2s ease;
}

.search-breadcrumbs a:hover {
  color: var(--color-primary, #720120);
}

.search-breadcrumbs .crumb-sep {
  font-size: 11px;
  color: #aaa;
}

.search-breadcrumbs .crumb-current {
  color: var(--color-primary, #720120);
  font-weight: 600;
}

/* Search Header Row (Heading, Result Count, Sort By) */
.search-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 4px;
}

.search-heading-block {
  flex: 1;
}

.search-main-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--color-primary, #720120);
  margin: 0 0 6px 0;
  line-height: 1.2;
}

.search-main-title span {
  font-style: normal;
}

.search-result-count-text {
  font-size: 14px;
  color: #666666;
  margin: 0;
  font-weight: 400;
}

/* Sort Dropdown */
.search-sort-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.search-sort-label {
  font-size: 13.5px;
  font-weight: 600;
  color: #333333;
}

.search-sort-select {
  appearance: none;
  background: #ffffff url("data:image/svg+xml;utf8,<svg fill='%23666' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>") no-repeat right 10px center;
  border: 1px solid #dcd1c2;
  border-radius: 8px;
  padding: 8px 36px 8px 14px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  color: #222222;
  cursor: pointer;
  outline: none;
  background-color: #ffffff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-sort-select:focus {
  border-color: var(--color-primary, #720120);
  box-shadow: 0 0 0 3px rgba(114, 1, 32, 0.08);
}

/* ==========================================================================
   2. RELATED-SEARCHES CHIPS ROW
   ========================================================================== */
.related-searches-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 8px 0;
  overflow: hidden;
}

.related-label {
  font-size: 13px;
  font-weight: 700;
  color: #444444;
  white-space: nowrap;
  flex-shrink: 0;
}

.related-chips-track {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px 0;
}

.related-chips-track::-webkit-scrollbar {
  display: none;
}

.related-chip {
  background: #ffffff;
  border: 1px solid #e2d7c8;
  border-radius: 30px;
  padding: 6px 16px;
  font-size: 12.5px;
  font-weight: 500;
  color: #444444;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
}

.related-chip:hover {
  border-color: var(--color-primary, #720120);
  color: var(--color-primary, #720120);
  background: #fffbfa;
  transform: translateY(-1px);
}

.related-chip-scroll-btn {
  background: #ffffff;
  border: 1px solid #e2d7c8;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.related-chip-scroll-btn:hover {
  background: #faf7f2;
  color: var(--color-primary, #720120);
}

/* ==========================================================================
   3. TWO-COLUMN LAYOUT: SIDEBAR + PRODUCT GRID
   ========================================================================== */
.search-content-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  align-items: start;
}

/* Filter Sidebar (Desktop) */
.filter-sidebar {
  background: #ffffff;
  border: 1px solid #ebd9be;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  position: sticky;
  top: 90px;
}

.filter-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid #f0e6d8;
  margin-bottom: 16px;
}

.filter-main-title {
  font-size: 17px;
  font-weight: 700;
  color: #222222;
  margin: 0;
}

.filter-clear-all-btn {
  background: transparent;
  border: none;
  color: var(--color-primary, #720120);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: text-decoration 0.2s;
}

.filter-clear-all-btn:hover {
  text-decoration: underline;
}

/* Accordion Filter Sections */
.filter-section {
  border-bottom: 1px solid #f2e9dc;
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.filter-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.filter-section-title-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
  padding: 0 0 10px 0;
  font-size: 14px;
  font-weight: 700;
  color: #222222;
  cursor: pointer;
  text-align: left;
}

.filter-section-chevron {
  font-size: 12px;
  color: #888888;
  transition: transform 0.25s ease;
}

.filter-section.collapsed .filter-section-chevron {
  transform: rotate(-90deg);
}

.filter-section.collapsed .filter-section-content {
  display: none;
}

.filter-section-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Custom Checkbox Row */
.filter-checkbox-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #444444;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}

.filter-checkbox-label:hover {
  color: var(--color-primary, #720120);
}

.filter-checkbox-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-checkbox-left input[type="checkbox"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid #c7b9a7;
  border-radius: 3px;
  outline: none;
  background: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  position: relative;
}

.filter-checkbox-left input[type="checkbox"]:checked {
  background-color: var(--color-primary, #720120);
  border-color: var(--color-primary, #720120);
}

.filter-checkbox-left input[type="checkbox"]:checked::after {
  content: '✓';
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.filter-count-badge {
  font-size: 11.5px;
  color: #888888;
}

/* Price Range Dual Slider & Text */
.price-range-display-text {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-primary, #720120);
  margin-bottom: 8px;
}

.price-range-slider-wrap {
  position: relative;
  margin: 10px 0 6px 0;
}

.price-range-slider {
  width: 100%;
  accent-color: var(--color-primary, #720120);
  cursor: pointer;
}

.price-range-scale-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #888888;
}

/* 12 Swatch Colour Grid */
.color-swatches-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding-top: 4px;
}

.filter-color-swatch-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  cursor: pointer;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.filter-color-swatch-dot:hover {
  transform: scale(1.15);
}

.filter-color-swatch-dot.active {
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--color-primary, #720120);
}

/* ==========================================================================
   4. PRODUCT GRID & CARDS
   ========================================================================== */
.products-grid-column {
  min-width: 0;
}

.search-products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.search-product-card {
  background: #ffffff;
  border: 1px solid #ebd9be;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  position: relative;
}

.search-product-card:hover {
  border-color: #cca352;
  box-shadow: 0 8px 24px rgba(114, 1, 32, 0.08);
  transform: translateY(-3px);
}

/* Card Image Box */
.card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  background-color: #faf7f2;
  overflow: hidden;
  cursor: pointer;
}

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

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

/* Product Badges */
.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 20px;
  z-index: 2;
  pointer-events: none;
}

.badge-bestseller {
  background: #c59b27;
  color: #ffffff;
}

.badge-new {
  background: var(--color-primary, #720120);
  color: #ffffff;
}

/* Wishlist Heart Button */
.card-wishlist-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #666;
  z-index: 3;
  transition: all 0.2s ease;
}

.card-wishlist-btn:hover {
  background: #ffffff;
  transform: scale(1.1);
  color: var(--color-primary, #720120);
}

.card-wishlist-btn.active {
  color: #e11d48;
}

.card-wishlist-btn.active svg {
  fill: #e11d48;
}

/* Card Details */
.card-details-box {
  padding: 12px 14px 14px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: #222222;
  line-height: 1.35;
  margin: 0 0 8px 0;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 35px;
  transition: color 0.2s ease;
}

.card-title:hover {
  color: var(--color-primary, #720120);
}

/* Color Swatches on Card */
.card-swatches-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.card-swatch-circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

/* Price Row */
.card-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 6px;
}

.card-curr-price {
  font-size: 15px;
  font-weight: 800;
  color: var(--color-primary, #720120);
}

.card-orig-price {
  font-size: 12px;
  color: #888888;
  text-decoration: line-through;
}

.card-discount-tag {
  font-size: 11px;
  font-weight: 700;
  color: #dc2626;
  background: #fee2e2;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: auto;
}

/* Rating Row */
.card-rating-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.card-stars {
  color: #f59e0b;
  letter-spacing: -1px;
  font-size: 13px;
}

.card-review-count {
  color: #888888;
  font-size: 11.5px;
}

/* ==========================================================================
   5. LOADING SKELETONS & EMPTY STATES
   ========================================================================== */
.skeleton-card {
  background: #ffffff;
  border: 1px solid #ebd9be;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4 / 6;
  position: relative;
}

.skeleton-shimmer {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #f0ede6 25%, #f8f6f0 50%, #f0ede6 75%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.5s infinite;
}

@keyframes skeletonPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty State */
.search-empty-state {
  display: none;
  text-align: center;
  padding: 60px 20px;
  background: #ffffff;
  border: 1px solid #ebd9be;
  border-radius: 12px;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
  color: #c59b27;
}

.empty-state-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary, #720120);
  margin-bottom: 8px;
}

.empty-state-subtext {
  font-size: 14px;
  color: #666;
  max-width: 420px;
  margin: 0 auto 20px auto;
}

.empty-state-btn {
  background: var(--color-primary, #720120);
  color: #ffffff;
  border: none;
  border-radius: 30px;
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.empty-state-btn:hover {
  background: #550117;
}

/* ==========================================================================
   6. SERVER-SIDE PAGINATION CONTROLS
   ========================================================================== */
.search-pagination-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}

.page-btn {
  background: #ffffff;
  border: 1px solid #ebd9be;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #444444;
  cursor: pointer;
  transition: all 0.2s ease;
}

.page-btn:hover {
  border-color: var(--color-primary, #720120);
  color: var(--color-primary, #720120);
}

.page-btn.active {
  background: var(--color-primary, #720120);
  border-color: var(--color-primary, #720120);
  color: #ffffff;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==========================================================================
   7. MOBILE SPECIFIC CONTROLS & DRAWER
   ========================================================================== */
.mobile-search-controls-bar {
  display: none;
}

.mobile-search-input-pill {
  display: none;
}

/* Mobile Filter Drawer Modal */
.mobile-filter-drawer-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.mobile-filter-drawer-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 85vh;
  background: #ffffff;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
}

.mobile-filter-drawer-overlay.open {
  display: block;
}

.mobile-filter-drawer-overlay.open .mobile-filter-drawer-panel {
  transform: translateY(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid #eee;
}

.mobile-drawer-title {
  font-size: 18px;
  font-weight: 700;
  color: #222;
  margin: 0;
}

.mobile-drawer-close-btn {
  background: transparent;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #666;
}

.mobile-drawer-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.mobile-drawer-footer {
  padding: 14px 20px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 12px;
  background: #ffffff;
}

.mobile-drawer-apply-btn {
  flex: 1;
  background: var(--color-primary, #720120);
  color: #ffffff;
  border: none;
  border-radius: 30px;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.mobile-drawer-clear-btn {
  background: #f5f5f5;
  color: #333;
  border: none;
  border-radius: 30px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

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

@media (max-width: 860px) {
  .search-content-grid {
    grid-template-columns: 1fr;
  }

  .filter-sidebar {
    display: none;
  }

  /* Show Mobile Search Input Bar matching Reference */
  .mobile-search-input-pill {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #dcd1c2;
    border-radius: 30px;
    padding: 6px 6px 6px 16px;
    margin: 12px 0 16px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  }

  .mobile-search-field {
    border: none;
    outline: none;
    flex: 1;
    font-size: 14px;
    font-family: inherit;
    color: #222;
  }

  .mobile-search-clear-btn {
    background: transparent;
    border: none;
    color: #999;
    font-size: 16px;
    padding: 0 8px;
    cursor: pointer;
  }

  .mobile-search-submit-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-primary, #720120);
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
  }

  /* Mobile Heading & Buttons Row */
  .search-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .search-main-title {
    font-size: 24px;
  }

  .search-sort-wrap {
    display: none;
  }

  /* Two Mobile Action Buttons (Sort & Filter) matching Reference */
  .mobile-search-controls-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-top: 6px;
  }

  .mobile-sort-btn,
  .mobile-filter-btn {
    flex: 1;
    background: #ffffff;
    border: 1px solid #dcd1c2;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #333333;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
  }

  .mobile-sort-btn span,
  .mobile-filter-btn span {
    font-size: 14px;
  }

  /* Mobile 2-Column Product Grid */
  .search-products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .card-details-box {
    padding: 10px;
  }

  .card-title {
    font-size: 12px;
    height: 32px;
    margin-bottom: 6px;
  }

  .card-curr-price {
    font-size: 13.5px;
  }

  .card-orig-price {
    font-size: 11px;
  }

  .card-discount-tag {
    font-size: 10px;
    padding: 1px 4px;
  }
}
