/* Sale Filter Plugin - Frontend Styles */

.sfp-sale-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Header and Categories in one row for desktop */
.sfp-header-with-categories {
  display: flex;
  align-items: flex-start;
  gap: 40px;
  margin-bottom: 40px;
}

.sfp-header-text {
  flex-shrink: 0;
  min-width: 300px;
}

.sfp-title {
  font-size: 48px;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 0 0 16px 0;
  color: #1a1a1a;
  line-height: 1.2;
}

.sfp-description {
  font-size: 16px;
  color: #666;
  line-height: 1.6;
  max-width: 600px;
  margin: 0;
}

/* Categories Section */
.sfp-categories-wrapper {
  position: relative;
  flex: 1;
  min-width: 0;
}

.sfp-categories-container {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sfp-categories-container::-webkit-scrollbar {
  display: none;
}

.sfp-categories {
  display: flex;
  gap: 12px;
  padding: 4px 0;
  min-width: min-content;
}

/* Reduced box size to fit 8-10 boxes on desktop */
.sfp-category-box {
  flex-shrink: 0;
  background: #a67b7b;
  color: #fff;
  border: none;
  padding: 16px 20px;
  min-width: 100px;
  max-width: 140px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sfp-category-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sfp-category-box.active {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.sfp-category-box[data-category="all"] {
  background: #3a3a3a;
}

/* Scroll Buttons */
.sfp-scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  padding: 0;
}

.sfp-scroll-btn:hover {
  background: #f5f5f5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sfp-scroll-btn svg {
  width: 20px;
  height: 20px;
  color: #666;
}

.sfp-scroll-btn:hover svg {
  color: #333;
}

.sfp-scroll-btn.hidden {
  display: none;
}

.sfp-scroll-left {
  left: -22px;
}

.sfp-scroll-right {
  right: -22px;
}

/* Filters Bar */
.sfp-filters-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding: 16px 0;
  border-bottom: 1px solid #e5e5e5;
}

.sfp-results-count {
  font-size: 16px;
  color: #666;
}

.sfp-sort-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sfp-sort-container label {
  font-size: 14px;
  color: #666;
  margin: 0;
}

.sfp-sort-select {
  padding: 8px 32px 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

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

.sfp-product-card {
  background: #fff;
  transition: all 0.3s ease;
  cursor: pointer;
}

.sfp-product-card:hover {
  transform: translateY(-4px);
}

.sfp-product-image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #f5f5f5;
  margin-bottom: 16px;
}

.sfp-product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.sfp-color-dots {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: flex;
  gap: 6px;
}

.sfp-color-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #666;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Product Info */
.sfp-product-info {
  padding: 0 4px;
}

.sfp-product-title {
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 8px 0;
  color: #1a1a1a;
  line-height: 1.4;
}

.sfp-product-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.sfp-product-title a:hover {
  color: #a67b7b;
}

.sfp-product-pricing {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.sfp-original-price {
  font-size: 14px;
  color: #999;
  text-decoration: line-through;
}

.sfp-sale-price {
  font-size: 18px;
  font-weight: 600;
  color: #d9534f;
}

.sfp-discount {
  font-size: 13px;
  color: #d9534f;
}

.sfp-product-colors {
  font-size: 13px;
  color: #666;
}

.sfp-no-products {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  font-size: 18px;
  color: #999;
}

/* Tablet */
@media (max-width: 1024px) {
  /* Stack header and categories on tablet */
  .sfp-header-with-categories {
    flex-direction: column;
    gap: 30px;
  }

  .sfp-header-text {
    min-width: 100%;
  }

  .sfp-products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  .sfp-title {
    font-size: 40px;
  }

  /* Adjusted tablet category box sizing */
  .sfp-category-box {
    min-width: 110px;
    max-width: 150px;
    padding: 16px 20px;
    font-size: 14px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .sfp-sale-section {
    padding: 30px 16px;
  }

  /* Stack header and categories on mobile */
  .sfp-header-with-categories {
    flex-direction: column;
    gap: 24px;
  }

  .sfp-header-text {
    min-width: 100%;
  }

  .sfp-title {
    font-size: 32px;
  }

  .sfp-description {
    font-size: 14px;
  }

  .sfp-products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  /* Constrained mobile category boxes to fit 2-3 per screen */
  .sfp-categories-wrapper {
    width: 100%;
    overflow: hidden;
  }

  .sfp-category-box {
    min-width: 100px;
    max-width: 130px;
    padding: 14px 16px;
    font-size: 13px;
  }

  .sfp-filters-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .sfp-sort-container {
    width: 100%;
    justify-content: space-between;
  }

  .sfp-sort-select {
    flex: 1;
  }

  .sfp-scroll-left {
    left: -8px;
  }

  .sfp-scroll-right {
    right: -8px;
  }

  .sfp-scroll-btn {
    width: 36px;
    height: 36px;
  }

  .sfp-scroll-btn svg {
    width: 16px;
    height: 16px;
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .sfp-title {
    font-size: 28px;
  }

  /* Further constrained small mobile category boxes */
  .sfp-category-box {
    min-width: 90px;
    max-width: 110px;
    padding: 12px 14px;
    font-size: 12px;
  }

  .sfp-product-title {
    font-size: 14px;
  }

  .sfp-sale-price {
    font-size: 16px;
  }
}

/* Loading State */
.sfp-products-grid.loading {
  opacity: 0.5;
  pointer-events: none;
}
