/* products.css - Product Listing Styles */

.main-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 30px;
  padding: 20px 0;
}

/* ===== BREADCRUMB NAVIGATION ===== */

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 14px;
  flex-wrap: wrap;
}

.breadcrumb-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: opacity 0.2s;
}

.breadcrumb-link:hover {
  opacity: 0.7;
}

.breadcrumb-sep {
  color: var(--text-muted);
  font-size: 16px;
}

.breadcrumb-current {
  color: var(--text);
  font-weight: 600;
}

/* Back button */
.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text);
  transition: all 0.2s;
  flex-shrink: 0;
  text-decoration: none;
}

.back-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 4px 12px rgba(99,102,241,0.15);
}

/* ===== CATEGORY ICONS ===== */

.category-slider-wrapper {
  position: relative;
  margin-bottom: 30px;
}



.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  color: var(--text);
  transition: all 0.2s;
  opacity: 1;
  pointer-events: auto;
}

.slider-btn.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) scale(0.8);
}

.slider-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 6px 16px rgba(99,102,241,0.2);
}

.slider-btn.prev {
  left: -22px;
}

.slider-btn.next {
  right: -22px;
}

.category-icons-row {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-behavior: smooth;
  /* Hide scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-icons-row::-webkit-scrollbar {
  display: none;
}

.cat-icon-item {
  flex: 0 0 100px;
  text-align: center;
  cursor: pointer;
}

.cat-icon-item .icon-circle {
  width: 70px;
  height: 70px;
  background: var(--white);
  border-radius: 50%;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  overflow: hidden;
  transition: all 0.25s ease;
}

.cat-icon-item:hover .icon-circle {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Active/selected subcategory circle */
.cat-icon-item.active .icon-circle {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.25), 0 4px 12px rgba(99,102,241,0.15);
}

.cat-icon-item.active span {
  color: var(--accent);
  font-weight: 700;
}

/* Placeholder circle (no image) */
.icon-circle-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 22px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
}

.cat-icon-item .icon-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.cat-icon-item span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

/* ===== LISTING CONTROLS ===== */

.listing-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 25px;
}

.found-count {
  font-size: 14px;
  color: var(--text-muted);
}

.sorting {
  display: flex;
  gap: 15px;
  align-items: center;
}

.sorting select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
}

.view-switch {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.view-switch button {
  background: var(--white);
  border: none;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text-muted);
}

.view-switch button.active {
  background: #f1f5f9;
  color: var(--primary);
}

/* ===== PRODUCT CARD ===== */

.card-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 2;
}

.action-btn {
  background: rgba(255,255,255,0.8);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: 0.2s;
}

.action-btn:hover {
  color: var(--error);
  background: #fff;
}

/* Wishlist active state */
.wishlist-btn.active {
  color: var(--error);
  background: #fff;
}

.card-meta {
  margin-bottom: 15px;
}

.rating {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
  color: #fbbf24;
  font-size: 13px;
}

.rating .reviews {
  color: var(--text-muted);
  margin-left: 5px;
}

.delivery-today {
  font-size: 12px;
  color: #10b981;
  font-weight: 500;
}

/* Sidebar Filters */
.filters-sidebar {
  background: var(--white);
  padding: 20px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  height: fit-content;
  position: sticky;
  top: 20px;
  z-index: 100;
}

.filter-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9998;
}
.filter-overlay.active {
  display: block;
}


.filter-section {
  margin-bottom: 24px;
}

.filter-section h4 {
  font-size: 16px;
  margin-bottom: 12px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
}

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

.filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.filter-item input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

/* ===== PRICE FILTER ===== */

.price-filter-block {
  margin-top: 5px;
}

.price-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.price-inputs input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  text-align: center;
  transition: border-color 0.2s;
}

.price-inputs input:focus {
  border-color: var(--accent);
}

.price-sep {
  color: var(--text-muted);
  font-size: 14px;
}

.price-slider-track {
  position: relative;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  margin: 0 6px 16px;
}

.price-slider-range {
  position: absolute;
  top: 0;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}

.price-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  top: -7px;
  width: 100%;
  height: 20px;
  background: transparent;
  pointer-events: none;
  margin: 0;
  padding: 0;
}

.price-slider-thumb::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  pointer-events: all;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.price-slider-thumb::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  pointer-events: all;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.filter-apply-btn {
  width: 100%;
  padding: 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.filter-apply-btn:hover {
  background: var(--accent-hover);
}

/* Product Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--white);
  border-radius: 12px;
  padding: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

.img-wrap {
  position: relative;
  aspect-ratio: 1;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.card-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  z-index: 10;
}

.badge {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  letter-spacing: 0.5px;
  display: inline-block;
}

.badge.top { background: #ffbe0b; color: #000; }
.badge.sale { background: var(--error); color: #fff; }

.product-card h3 {
  font-size: 15px;
  line-height: 1.4;
  margin-bottom: 8px;
  height: 42px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  color: var(--text);
  font-weight: 500;
}

.product-card h3:hover {
  color: var(--accent);
}

.status {
  font-size: 12px;
  color: var(--success);
  margin-bottom: 8px;
}

.price-block {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.old-price {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-bottom: 2px;
}

.price {
  font-size: 20px;
  font-weight: 800;
  color: var(--error);
}

.buy-btn {
  background: var(--accent);
  color: var(--white);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: 0.2s;
}

.buy-btn:hover {
  background: var(--accent-hover);
}

@media (max-width: 992px) {
  .category-slider-wrapper {
    margin-bottom: 0px;
  }
  .main-layout {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 5px 0;
  }
  .mobile-filter-btn {
    display: flex !important;
  }
  .filters-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 300px;
    height: 100vh;
    border-radius: 0;
    z-index: 9999;
    overflow-y: auto;
    transition: left 0.3s;
    margin: 0;
  }
  .filters-sidebar.open {
    left: 0;
  }
  .close-sidebar-btn {
    display: block !important;
  }
}

@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .section-header {
    margin-bottom: 10px !important;
  }
  .product-card {
    padding: 10px;
  }
  .product-card h3 {
    font-size: 13px;
    line-height: 1.4;
    height: 38px;
    margin-bottom: 6px;
  }
  .price {
    font-size: 16px;
  }
  .old-price {
    font-size: 12px;
  }
  .buy-btn {
    width: 32px;
    height: 32px;
  }
  .cat-icon-item {
    flex: 0 0 85px;
  }
  .cat-icon-item .icon-circle {
    width: 60px;
    height: 60px;
  }
  .cat-icon-item .icon-circle img {
    width: 100%;
    height: 100%;
  }
  .listing-controls {
    flex-wrap: wrap;
    gap: 15px;
  }
  .sorting {
    width: 100%;
    justify-content: space-between;
  }
  /* Fix badge/heart overlap */
  .card-badges {
    top: 6px;
    left: 6px;
    max-width: 55%;
    gap: 4px;
  }
  .badge {
    padding: 3px 6px;
    font-size: 8px; /* Slightly smaller for mobile */
    letter-spacing: 0.2px;
  }
  .card-actions {
    top: 6px;
    right: 6px;
    z-index: 15;
  }
  .action-btn {
    width: 28px;
    height: 28px;
  }
  .action-btn svg {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 1024px) {
  .slider-btn {
    display: none !important; /* Touch swipe works best here */
  }
}

