/* ============================================================
   safitri mart Shop - Katalog Styles
   ============================================================ */

.section-products {
  background: var(--bg-body);
}

/* Product Cards */
.product-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-lg) !important;
  overflow: hidden;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--card-shadow-hover) !important;
  border-color: transparent !important;
}

.product-image {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  height: 200px;
  object-fit: cover;
}

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

.product-placeholder {
  height: 200px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.product-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  transition: color 0.2s ease;
  font-weight: 600;
}

.product-title:hover {
  color: #2d6b54 !important;
}

.product-actions .btn {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-cart {
  background: var(--primary-gradient);
  border: none;
  color: #fff;
  box-shadow: 0 4px 12px rgba(27, 77, 62, 0.25);
}

.btn-cart:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(27, 77, 62, 0.35);
  color: #fff;
}

.btn-cart:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-detail {
  background: transparent;
  border: 2px solid var(--border-color);
  color: var(--text-main);
}

.btn-detail:hover {
  background: var(--hover-bg);
  border-color: #2d6b54;
  color: #2d6b54;
  transform: translateY(-2px);
}

.stock-badge {
  font-size: 0.65rem;
  padding: 0.25em 0.5em;
  letter-spacing: 0.3px;
  border-radius: var(--radius-full);
}

.btn-wishlist {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-wishlist:hover,
.btn-wishlist.active {
  background: #fff;
  color: #dc3545;
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.25);
}

.btn-wishlist.active i {
  color: #dc3545;
}

.bg-orange {
  background-color: #f97316 !important;
}

/* Filter Sidebar */
.filter-sidebar {
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  border-radius: var(--radius-lg) !important;
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
}

.filter-sidebar::-webkit-scrollbar {
  width: 6px;
}

.filter-sidebar::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}

.filter-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* View Toggle */
.list-view .grid-container {
  display: none !important;
}

.list-view .list-container {
  display: block !important;
}

.grid-view .grid-container {
  display: block !important;
}

.grid-view .list-container {
  display: none !important;
}

.product-card-list {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: var(--radius-lg) !important;
  border: 1px solid var(--border-color);
}

.product-card-list:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover) !important;
}

.view-toggle {
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.view-toggle.active {
  background-color: #2d6b54 !important;
  border-color: #2d6b54 !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(45, 107, 84, 0.25);
}

.list-group-item {
  border-radius: var(--radius-md) !important;
  transition: all 0.2s ease;
}

.list-group-item.active {
  background-color: #2d6b54 !important;
  border-color: #2d6b54 !important;
  box-shadow: 0 4px 12px rgba(45, 107, 84, 0.25);
}

.list-group-item:hover:not(.active) {
  background-color: var(--hover-bg);
  transform: translateX(4px);
}

.badge {
  border-radius: var(--radius-full);
  font-weight: 600;
  padding: 0.35em 0.65em;
}

.top-bar-controls {
  border-radius: var(--radius-lg) !important;
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow);
}

/* Lazy Loading */
.lazy-image {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lazy-image.loaded {
  opacity: 1;
}

/* Responsive */
@media (max-width: 991.98px) {
  .product-image {
    height: 160px;
  }

  .product-placeholder {
    height: 160px;
  }
}

@media (max-width: 575.98px) {
  .product-image {
    height: 140px;
  }

  .product-placeholder {
    height: 140px;
  }
}

/* Dark Theme Overrides */
[data-theme="dark"] .section-products {
  background: var(--bg-body, #0f172a);
}

[data-theme="dark"] .product-card {
  background-color: var(--bg-card, #1e293b) !important;
  border-color: var(--border-color, #334155) !important;
}

[data-theme="dark"] .product-card:hover {
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .product-card-list {
  background-color: var(--bg-card, #1e293b) !important;
  border-color: var(--border-color, #334155) !important;
}

[data-theme="dark"] .product-card-list:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .product-title {
  color: var(--text-heading, #f3f4f6) !important;
}

[data-theme="dark"] .product-title:hover {
  color: #34d399 !important;
}

[data-theme="dark"] .btn-detail {
  border-color: var(--border-color, #475569) !important;
  color: var(--text-main, #e5e7eb) !important;
}

[data-theme="dark"] .btn-detail:hover {
  background-color: var(--hover-bg, #334155) !important;
  border-color: #2d6b54 !important;
  color: #34d399 !important;
}

[data-theme="dark"] .btn-wishlist {
  background-color: var(--bg-card, #1e293b) !important;
}

[data-theme="dark"] .btn-wishlist:hover,
[data-theme="dark"] .btn-wishlist.active {
  background-color: var(--bg-card, #1e293b) !important;
  color: #f87171 !important;
}

[data-theme="dark"] .filter-sidebar {
  background-color: var(--bg-card, #1e293b) !important;
}

[data-theme="dark"] .filter-sidebar::-webkit-scrollbar-thumb {
  background: var(--border-color, #475569) !important;
}

[data-theme="dark"] .list-group-item.active {
  background-color: #2d6b54 !important;
  border-color: #2d6b54 !important;
  color: #fff !important;
}

[data-theme="dark"] .list-group-item:hover:not(.active) {
  background-color: var(--hover-bg, #334155) !important;
}

[data-theme="dark"] .product-placeholder {
  background-color: var(--bg-light, #334155) !important;
}

[data-theme="dark"] .view-toggle.active {
  background-color: #2d6b54 !important;
  border-color: #2d6b54 !important;
}

[data-theme="dark"] .offcanvas {
  background-color: var(--bg-card, #1e293b) !important;
}

[data-theme="dark"] .form-check-label {
  color: var(--text-main, #e5e7eb) !important;
}

[data-theme="dark"] .form-check-input {
  background-color: var(--bg-input, #1e293b) !important;
  border-color: var(--border-color, #475569) !important;
}

[data-theme="dark"] .top-bar-controls {
  background-color: var(--bg-card, #1e293b) !important;
  border-color: var(--border-color, #334155) !important;
}
