/* Product Index & Card Styles */
.products-index {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.products-index h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #0f172a;
}

/* Layout: sidebar + main */
.products-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

@media (min-width: 768px) {
  .products-layout {
    flex-direction: row;
  }
}

.products-sidebar {
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .products-sidebar {
    width: 240px;
  }
}

.products-main {
  flex: 1;
  min-width: 0;
}

.products-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.products-count {
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 500;
}

/* Product Grid */
.products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 480px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Empty state */
.products-empty {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 3rem;
  text-align: center;
}

.products-empty svg {
  margin: 0 auto 1rem;
}

.products-empty p {
  color: #64748b;
  margin-bottom: 0.5rem;
}

.products-empty a {
  color: var(--cms-primary-color, #2563eb);
  text-decoration: underline;
}

/* Sidebar Filters */
.filter-sidebar {
  background: white;
  padding: 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--cms-color-border, #e2e8f0);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.filter-sidebar__title {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.filter-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.filter-group-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 0.75rem;
}

.filter-select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.875rem;
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-select:focus {
  outline: none;
  border-color: var(--cms-primary-color, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-price-inputs {
  display: flex;
  gap: 0.5rem;
}

.filter-apply-btn {
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border-radius: 8px;
}

.filter-clear-link {
  display: block;
  text-align: center;
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 500;
}

.filter-clear-link:hover {
  color: var(--cms-primary-color, #2563eb);
}

/* Product Card */
.product-card {
  background: white;
  border: 1px solid var(--cms-color-border, #e2e8f0);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card:hover {
  border-color: #cbd5e1;
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.product-card__image {
  position: relative;
  aspect-ratio: 1;
  background: #f8fafc;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.ad-image-placeholder {
  color: #cbd5e1;
}

.product-card__body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.5rem;
  line-height: 1.4;
  transition: color 0.2s;
}

.product-card:hover .product-card__title {
  color: var(--cms-primary-color, #2563eb);
}

.product-card__price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 1rem;
}

.product-card__price {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}

.product-card__status {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 6px;
}

.status-in-stock {
  background: #f0fdf4;
  color: #16a34a;
}

.status-out-of-stock {
  background: #fef2f2;
  color: #dc2626;
}

/* Product Detail Page */
.product-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

.product-main-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

@media (min-width: 768px) {
  .product-main-grid {
    grid-template-columns: 1.2fr 1fr;
  }
}

.product-gallery {
  background: #f8fafc;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid #f1f5f9;
}

.product-gallery img {
  width: 100%;
  display: block;
}

.product-info-panel {
  display: flex;
  flex-direction: column;
}

.product-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--cms-primary-color, #2563eb);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.product-info-panel h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 1rem;
  line-height: 1.1;
}

.product-info-panel .price-large {
  font-size: 2rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 2rem;
}

.buy-box {
  background: #f8fafc;
  padding: 2rem;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
}

.quantity-selector {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.qty-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.25rem;
  transition: all 0.2s;
}

.qty-btn:hover {
  border-color: var(--cms-primary-color, #2563eb);
  color: var(--cms-primary-color, #2563eb);
}

.qty-input-styled {
  width: 50px;
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
  border: none;
  background: transparent;
}

.product-description-rich {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid #f1f5f9;
  max-width: 800px;
  line-height: 1.7;
  color: #334155;
}

.product-description-rich h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}
