/* ===========================
   Shop Page — Modern Design
   =========================== */

/* Shop Layout */
.shop-layout {
  padding: 32px 0;
}

/* ── Filter Sidebar ── */
.filter-panel {
  background: white;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  border: none;
  position: sticky;
  top: 90px;
}

.filter-panel .filter-heading {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filter-panel .form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.filter-panel .form-select {
  border-radius: 12px;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  font-size: 0.9rem;
  background-color: var(--surface-color);
  transition: var(--transition);
}

.filter-panel .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.btn-reset-filter {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 6px 14px;
  background: white;
  transition: var(--transition);
}

.btn-reset-filter:hover {
  color: var(--primary-color);
  border-color: var(--primary-color);
  background-color: #eff6ff;
}

/* ── Search Bar ── */
.shop-search {
  background: white;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  padding: 4px;
  transition: var(--transition);
}

.shop-search:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.shop-search .input-group-text {
  background: transparent;
  border: none;
  padding-left: 14px;
}

.shop-search .form-control {
  border: none;
  box-shadow: none;
  font-size: 0.9rem;
  padding: 10px 12px;
}

.shop-search .form-control:focus {
  box-shadow: none;
}

/* ── Product Cards ── */
.product-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  border: none;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
  transform: translateY(-4px);
}

.product-card .product-img-wrap {
  background: var(--surface-color);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 220px;
  position: relative;
  overflow: hidden;
}

.product-card .product-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
}

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

/* Discount badge */
.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #ef4444;
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  z-index: 2;
}

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

.product-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-name a {
  color: inherit;
  text-decoration: none;
}

.product-name a:hover {
  color: var(--primary-color);
}

.product-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 4px;
}

.product-price-original {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: line-through;
  margin-left: 8px;
  font-weight: 400;
}

.product-stock {
  font-size: 0.8rem;
  font-weight: 500;
}

.product-stock.in-stock {
  color: #22c55e;
}

.product-stock.out-of-stock {
  color: #ef4444;
}

/* Product actions */
.product-actions {
  padding: 0 20px 20px;
  display: flex;
  gap: 8px;
}

.btn-add-cart {
  flex: 1;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-add-cart:hover {
  background: var(--primary-hover);
  color: white;
}

.btn-add-cart:disabled,
.btn-add-cart.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.btn-wishlist {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: white;
  color: var(--text-secondary);
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-wishlist:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: #fef2f2;
}

/* Out of stock card */
.product-card.is-out-of-stock {
  opacity: 0.55;
}

.product-card.is-out-of-stock .btn-add-cart {
  pointer-events: none;
}

/* ── Empty State ── */
.shop-empty-state {
  text-align: center;
  padding: 60px 20px;
}

.shop-empty-state i {
  font-size: 3rem;
  color: #cbd5e1;
  margin-bottom: 16px;
}

.shop-empty-state p {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* ── Result Count ── */
.result-count {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── Slider Overrides ── */
.filter-panel #price-slider .noUi-connect {
  background: var(--primary-color);
}

.filter-panel .noUi-horizontal .noUi-handle {
  background-color: var(--primary-color);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  border: none;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.filter-panel .noUi-handle:before,
.filter-panel .noUi-handle:after {
  display: none;
}

/* ── Mobile Filter Toggle Button ── */
.btn-filter-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-color);
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
}

.btn-filter-toggle:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-filter-toggle i {
  font-size: 1rem;
}

/* ── Close Button (inside drawer) ── */
.btn-close-filter {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--surface-color);
  border-radius: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.btn-close-filter:hover {
  background: #e2e8f0;
  color: var(--text-color);
}

/* ── Backdrop Overlay ── */
.filter-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1040;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.filter-backdrop.is-visible {
  display: block;
  opacity: 1;
}

/* ── Responsive ── */
@media (max-width: 991px) {
  /* Off-canvas drawer */
  .filter-col {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    z-index: 1050;
    padding: 0;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    background: white;
  }

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

  .filter-col .filter-panel {
    border-radius: 0;
    box-shadow: none;
    position: static;
    min-height: 100vh;
    padding: 24px;
  }
}

@media (max-width: 767px) {
  .shop-layout {
    padding: 16px 0;
  }

  .product-card .product-img-wrap {
    height: 180px;
    padding: 16px;
  }

  .product-info {
    padding: 16px;
  }

  .product-actions {
    padding: 0 16px 16px;
  }
}

/* Body scroll lock when drawer is open */
body.filter-drawer-open {
  overflow: hidden;
}
