/* ========================================
   DRIFT — Shop Page Styles (Redesigned)
   ======================================== */

/* === Main Container Padding === */
.shop-main-container {
  padding-top: 110px; /* Space for the sticky navbar */
  min-height: 80vh;
}

/* === Shop Toolbar === */
.shop-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1.5px solid var(--border-soft);
  margin-bottom: 24px;
}

.filter-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  padding: 6px 0;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.filter-toggle-btn:hover {
  opacity: 0.7;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* Toolbar inline search */
.toolbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-secondary, #f5f5f5);
  border: 1.5px solid transparent;
  border-radius: 8px;
  padding: 4px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  flex: 1;
  margin: 0 20px;
}

.toolbar-search:focus-within {
  border-color: var(--text-primary, #111);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
  background: #fff;
}

.toolbar-search svg {
  flex-shrink: 0;
  opacity: 0.4;
}

.toolbar-search-input {
  border: none;
  background: none;
  outline: none;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--text-primary, #111);
  width: 100%;
  min-width: 0;
}

.toolbar-search-input::placeholder {
  color: #aaa;
}

.toolbar-search-clear {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #999;
  line-height: 1;
  padding: 0;
  display: none;
  flex-shrink: 0;
}

.toolbar-search-clear:hover {
  color: #333;
}



.results-info-count {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* Grid Layout Selectors */
.grid-selectors {
  display: flex;
  align-items: center;
  gap: 12px;
}

.grid-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  opacity: 0.25;
  transition: all 0.2s ease;
  padding: 4px;
}

.grid-btn:hover {
  opacity: 0.6;
}

.grid-btn.active {
  opacity: 1;
}

.grid-btn span {
  display: inline-block;
  width: 2px;
  height: 12px;
  background-color: currentColor;
}

/* Sort By Select */
.sort-by-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.sort-icon {
  color: var(--text-primary);
  pointer-events: none;
}

.sort-select {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  outline: none;
  padding-right: 20px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%231a1a1a' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  margin: 0;
  white-space: nowrap;
}

/* === Layout Content === */
.shop-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  padding-bottom: 64px;
}

/* === Flat Sidebar Filters === */
.filter-sidebar {
  position: sticky;
  top: 120px;
  align-self: start;
  border-right: 1.5px solid var(--border-soft);
  padding-right: 32px;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}

/* Hide scrollbars for a clean look */
.filter-sidebar::-webkit-scrollbar {
  width: 0;
}

.filter-group {
  margin-bottom: 28px;
}

.filter-group-header {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  margin-bottom: 14px;
}

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

/* Checkbox Styling */
.filter-checkbox-option {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
  line-height: 1.3;
}

.filter-checkbox-option:hover {
  color: var(--text-primary);
}

.filter-checkbox-option input[type="checkbox"] {
  display: none;
}

.custom-checkbox {
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 3px;
  display: inline-block;
  position: relative;
  flex-shrink: 0;
  background: #ffffff;
  transition: all 0.2s ease;
}

.filter-checkbox-option input[type="checkbox"]:checked + .custom-checkbox {
  background: var(--text-primary);
  border-color: var(--text-primary);
}

.filter-checkbox-option input[type="checkbox"]:checked + .custom-checkbox::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.filter-checkbox-option .count {
  font-size: 11px;
  color: var(--text-secondary);
  margin-left: auto;
  opacity: 0.65;
  font-weight: 500;
}

/* Show More Button */
.show-more-btn {
  background: none;
  border: none;
  padding: 6px 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  margin-top: 6px;
  transition: color 0.2s ease;
}

.show-more-btn:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

/* === Price Range Slider === */
.price-slider-wrapper {
  padding-top: 4px;
}

.price-slider-container {
  position: relative;
  height: 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
}

.slider-track {
  position: absolute;
  height: 3px;
  background: var(--border-soft);
  border-radius: 2px;
  width: 100%;
  z-index: 1;
}

.price-slider-container input[type="range"] {
  position: absolute;
  width: 100%;
  height: 100%;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
  outline: none;
  z-index: 2;
}

/* Webkit Thumbs */
.price-slider-container input[type="range"]::-webkit-slider-thumb {
  height: 14px;
  width: 14px;
  border-radius: 50%;
  background: #1A1A1A;
  border: 1.5px solid #ffffff;
  cursor: pointer;
  pointer-events: auto;
  -webkit-appearance: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 0.1s ease;
}

.price-slider-container input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Firefox Thumbs */
.price-slider-container input[type="range"]::-moz-range-thumb {
  height: 14px;
  width: 14px;
  border-radius: 50%;
  background: #1A1A1A;
  border: 1.5px solid #ffffff;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 0.1s ease;
}

.price-slider-container input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.2);
}

/* Price Inputs (FROM/TO Boxes) */
.price-inputs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.price-input-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 47%;
}

.price-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.input-currency-wrapper {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-soft);
  border-radius: 3px;
  padding: 6px 8px;
  background: #ffffff;
  transition: border-color 0.2s ease;
}

.input-currency-wrapper:focus-within {
  border-color: var(--text-primary);
}

.currency-prefix {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: 6px;
  user-select: none;
}

.input-currency-wrapper input {
  width: 100%;
  border: none;
  outline: none;
  background: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  padding: 0;
}

/* Remove spin buttons from number inputs */
.input-currency-wrapper input::-webkit-outer-spin-button,
.input-currency-wrapper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.input-currency-wrapper input[type=number] {
  -moz-appearance: textfield;
}

/* === Products Content === */
.shop-content {
  position: relative;
}

/* === Product Grid === */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px 20px;
}

/* Grid Columns Configuration */
.product-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.product-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.product-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.product-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }

/* === Product Card Redesign === */
.product-card {
  background: transparent;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}

.card-image {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-soft);
  border-radius: 0;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover .card-image {
  border-color: var(--text-primary);
}

/* Sold Out Image Overlay */
.card-image.sold-out-overlay::after {
  content: 'OUT OF STOCK';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  z-index: 5;
  pointer-events: none;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* Red Sale Badge - Flush Top-Left */
.badge-sale-solid {
  position: absolute;
  top: 0;
  left: 0;
  background: #FF0000;
  color: #FFFFFF;
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.05em;
  padding: 5px 12px;
  text-transform: uppercase;
  z-index: 3;
}

/* Wishlist Button - Square White Button Top-Right */
.card-wishlist-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 4;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  padding: 0;
}

.card-wishlist-btn svg {
  width: 16px;
  height: 16px;
  stroke: var(--text-primary);
  fill: none;
  transition: transform 0.2s ease, fill 0.2s ease, stroke 0.2s ease;
}

.card-wishlist-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}

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

/* Pink Discount Badge - Overlaid Bottom-Left */
.badge-discount-amount {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: #FFEAEA;
  color: #E53E3E;
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 9px;
  padding: 3px 8px;
  border-radius: 20px;
  border: none;
  z-index: 3;
}

/* Card Details (Below Image) */
.card-info {
  padding: 12px 0 4px;
  background: transparent;
  text-align: left;
}

.card-brand-label {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #8E8E93;
  letter-spacing: 0.02em;
  margin-bottom: 2px;
}

.card-title-label {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-price-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.price-active {
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.price-original {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #8E8E93;
  text-decoration: line-through;
}

/* === Empty State === */
.empty-shop {
  text-align: center;
  padding: 96px 24px;
}

.empty-shop h3 {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.empty-shop p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* === Pagination === */
.pagination-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 48px 0;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 6px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border-soft);
  background: #ffffff;
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.pagination-btn.active {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: #FFFFFF;
}

.pagination-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* === Responsive Rules === */
@media (max-width: 1024px) {
  .product-grid.cols-5 {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 900px) {
  .shop-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .filter-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    max-height: 100vh;
    background: #ffffff;
    z-index: 1000;
    padding: 80px 24px 40px;
    border-right: 1px solid var(--border-soft);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 4px 0 20px rgba(0,0,0,0.08);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .filter-sidebar.open {
    transform: translateX(0);
  }

  /* Mobile: search on top row, filter+sort on bottom row */
  .shop-toolbar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .toolbar-search {
    order: -1;          /* push to first row */
    flex: 1 1 100%;     /* full width */
    margin: 0 4px;
    max-width: 100%;
  }

  .filter-toggle-btn {
    order: 0;
  }

  .toolbar-right {
    order: 1;
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-left: 0;
  }

  .grid-selectors {
    display: none; /* Hide column layout options on mobile */
  }

  .product-grid,
  .product-grid.cols-3,
  .product-grid.cols-4,
  .product-grid.cols-5 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .shop-main-container {
    padding-top: 80px;
  }

  .product-grid {
    gap: 16px 12px;
  }

  .card-info {
    padding: 8px 0 2px;
  }

  .card-title-label {
    font-size: 12.5px;
    margin-bottom: 4px;
  }

  .card-brand-label {
    font-size: 10px;
  }

  .price-active {
    font-size: 12.5px;
  }

  .price-original {
    font-size: 11px;
  }



  .badge-sale-solid {
    font-size: 9px;
    padding: 4px 8px;
  }

  .card-wishlist-btn {
    width: 28px;
    height: 28px;
    top: 8px;
    right: 8px;
  }

  .card-wishlist-btn svg {
    width: 14px;
    height: 14px;
  }
}
