/* ============================================================
   products.css - E-commerce Product Pages Styling
   Subhvaishali Foundation - Amrut Kan Kandap Masale
   ============================================================ */

/* HERO SECTION */
.products-hero {
  padding: 140px 24px 60px;
  background: linear-gradient(135deg, #fff3e8 0%, #ffe0c7 50%, #ffd0a8 100%);
  text-align: center;
  border-bottom-left-radius: 50px;
  border-bottom-right-radius: 50px;
}

.products-hero-content h1 {
  font-size: 42px;
  font-weight: 900;
  background: linear-gradient(90deg, #ff6a00, #ff9440);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 12px;
}

.products-hero-content p {
  font-size: 18px;
  color: #444;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* MAIN CONTAINER */
.products-container {
  max-width: 1200px;
  margin: 60px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
}

/* SIDEBAR */
.products-sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.filter-section {
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
}

.filter-section h3 {
  font-size: 18px;
  font-weight: 800;
  color: #ff6a00;
  margin-bottom: 16px;
}

.filter-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-item {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: #444;
  text-decoration: none;
  transition: all 0.2s;
  border: 1.5px solid transparent;
}

.filter-item:hover {
  background: #fff4eb;
  color: #ff6a00;
  border-color: rgba(255, 106, 0, 0.15);
}

.filter-item.active {
  background: linear-gradient(90deg, #ff6a00, #ff9440);
  color: #fff;
  font-weight: 700;
}

.filter-select {
  width: 100%;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 140, 0, 0.28);
  font-size: 14px;
  font-weight: 600;
  color: #333;
  background: #fff8f3;
  outline: none;
  cursor: pointer;
  font-family: inherit;
  transition: 0.2s;
}

.filter-select:focus {
  border-color: #ff6a00;
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.10);
  background: #fff;
}

/* TOOLBAR */
.products-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  gap: 20px;
  flex-wrap: wrap;
}

.search-form {
  flex: 1;
  max-width: 400px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 12px 50px 12px 16px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 140, 0, 0.28);
  font-size: 15px;
  outline: none;
  background: #fff8f3;
  font-family: inherit;
  transition: 0.2s;
}

.search-input:focus {
  border-color: #ff6a00;
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.10);
  background: #fff;
}

.search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(90deg, #ff6a00, #ff9440);
  color: #fff;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}

.search-btn:hover {
  transform: translateY(-50%) scale(1.05);
}

.products-count {
  font-size: 15px;
  font-weight: 600;
  color: #666;
}

/* PRODUCTS GRID */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.product-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: all 0.3s;
  border: 2px solid transparent;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(255, 106, 0, 0.20);
  border-color: #ff6a00;
}

.product-image-link {
  display: block;
  position: relative;
  overflow: hidden;
  background: #fff4eb;
  aspect-ratio: 1;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform 0.4s;
}

.product-card:hover .product-image {
  transform: scale(1.08);
}

.product-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fff4eb, #ffe1c7);
}

.product-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #ff6a00;
  color: #fff;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(255, 106, 0, 0.35);
}

.product-badge.featured {
  background: linear-gradient(90deg, #ff6a00, #ff9440);
  top: 12px;
  left: 12px;
  right: auto;
}

.product-badge.out-of-stock {
  background: #dc2626;
}

.product-badge.low-stock {
  background: #f59e0b;
}

.product-info {
  padding: 18px;
}

.product-name {
  font-size: 17px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 8px;
  line-height: 1.3;
}

.product-name a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.product-name a:hover {
  color: #ff6a00;
}

.product-desc {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.product-weight {
  font-size: 13px;
  font-weight: 600;
  color: #ff6a00;
  background: #fff4eb;
  padding: 4px 10px;
  border-radius: 6px;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid #f0e0d0;
}

.product-price {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.price-mrp {
  font-size: 13px;
  color: #999;
  text-decoration: line-through;
  font-weight: 500;
}

.price-current {
  font-size: 20px;
  font-weight: 900;
  color: #ff6a00;
}

.btn-add-cart {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: linear-gradient(90deg, #ff6a00, #ff9440);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 4px 12px rgba(255, 106, 0, 0.28);
  white-space: nowrap;
}

.btn-add-cart:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(255, 106, 0, 0.38);
}

.btn-add-cart:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-add-cart.loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn-add-cart.loading::after {
  content: "";
  position: absolute;
  right: 10px;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btnSpin 0.7s linear infinite;
}

@keyframes btnSpin {
  to { transform: rotate(360deg); }
}

/* NO PRODUCTS */
.no-products {
  text-align: center;
  padding: 80px 24px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.no-products svg {
  margin: 0 auto 20px;
  opacity: 0.5;
}

.no-products h3 {
  font-size: 24px;
  font-weight: 800;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.no-products p {
  font-size: 16px;
  color: #666;
  margin-bottom: 24px;
}

.btn-primary {
  display: inline-block;
  padding: 12px 24px;
  background: linear-gradient(90deg, #ff6a00, #ff9440);
  color: #fff;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  transition: 0.25s;
  box-shadow: 0 4px 12px rgba(255, 106, 0, 0.28);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(255, 106, 0, 0.38);
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .products-container {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .products-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
  }

  .filter-section {
    margin-bottom: 0;
  }

  .products-hero {
    padding: 120px 24px 50px;
    border-bottom-left-radius: 36px;
    border-bottom-right-radius: 36px;
  }

  .products-hero-content h1 {
    font-size: 32px;
  }

  .products-hero-content p {
    font-size: 16px;
  }

  .products-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-form {
    max-width: 100%;
  }

  .products-count {
    text-align: center;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
  }
}

@media (max-width: 600px) {
  .products-hero {
    padding: 110px 20px 40px;
    border-bottom-left-radius: 28px;
    border-bottom-right-radius: 28px;
  }

  .products-hero-content h1 {
    font-size: 26px;
  }

  .products-hero-content p {
    font-size: 15px;
  }

  .products-container {
    margin: 40px auto;
    padding: 0 16px;
  }

  .products-sidebar {
    grid-template-columns: 1fr;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .product-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-add-cart {
    width: 100%;
    justify-content: center;
  }
}
