/* ========================================
   Catalog Styles — Coffee Catalog Pro
   ======================================== */

* { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  background: #fff;
  color: #000;
  -webkit-font-smoothing: antialiased;
}

/* ===== COFFEE CHIPS CAROUSEL ===== */
.coffee-chips-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.coffee-chips-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 0;
}
.coffee-chips-scroll::-webkit-scrollbar { display: none; }

.carousel-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.15s;
  color: #6b7280;
}
.carousel-btn:hover {
  border-color: #ffcb27;
  color: #000;
  background: #fffef5;
}

.coffee-chip {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 30px;
  background: #f3f4f6;
  border: none;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: #000;
  cursor: pointer;
  transition: 0.15s;
  white-space: nowrap;
}
.coffee-chip:hover { background: #e5e7eb; }
.coffee-chip.active { background: #ffcb27; }
.chip-search-icon { width: 14px; height: 14px; }

/* ===== FILTER CHIPS ROW ===== */
.filter-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.filter-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 30px;
  background: #f3f4f6;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: #000;
  cursor: pointer;
  transition: 0.15s;
  position: relative;
  user-select: none;
  white-space: nowrap;
  border: 1.5px solid transparent;
}
.filter-chip:hover { background: #e5e7eb; }
.filter-chip.active { background: #ffcb27; border-color: #ffcb27; }

.chip-label { font-weight: 500; }

.chip-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  color: inherit;
  cursor: pointer;
  padding: 0;
}
.chip-arrow { transition: transform 0.2s; }
.dropdown-chip.open .chip-arrow { transform: rotate(180deg); }

/* ===== TOGGLE SWITCH ===== */
.toggle-switch {
  position: relative;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #d1d5db;
  border-radius: 20px;
  transition: 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .toggle-slider { background: #ffcb27; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(16px); }

/* ===== CHIP DROPDOWN ===== */
.chip-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.04);
  z-index: 100;
  min-width: 180px;
  padding: 8px;
  animation: dropdownIn 0.15s ease;
}
.chip-dropdown.open { display: block; }

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Sort dropdown */
.sort-dropdown { min-width: 200px; }
.sort-option {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: 0.12s;
  color: #374151;
}
.sort-option:hover { background: #f3f4f6; }
.sort-option.active { background: #ffcb27; color: #000; font-weight: 600; }

/* Price dropdown */
.price-dropdown { min-width: 280px; padding: 16px; }

/* ===== RANGE SLIDER ===== */
.range-slider {
  position: relative;
  height: 40px;
  display: flex;
  align-items: center;
}
.range-track-bg {
  position: absolute;
  width: 100%;
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  top: 50%;
  transform: translateY(-50%);
}
.range-track-fill {
  position: absolute;
  height: 4px;
  background: #ffcb27;
  border-radius: 2px;
  top: 50%;
  transform: translateY(-50%);
}
.range-input {
  -webkit-appearance: none;
  appearance: none;
  position: absolute;
  width: 100%;
  height: 40px;
  background: transparent;
  pointer-events: none;
  margin: 0;
  padding: 0;
  outline: none;
  z-index: 2;
}
.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: all;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffcb27;
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  cursor: pointer;
  position: relative;
  z-index: 3;
}
.range-input::-moz-range-thumb {
  pointer-events: all;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffcb27;
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  cursor: pointer;
}
.range-input::-moz-range-track { background: transparent; border: none; }
.range-max { z-index: 3; }

.range-number-inputs {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}
.range-number-inputs input {
  width: 100%;
  padding: 7px 10px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  text-align: center;
  outline: none;
  transition: border-color 0.15s;
}
.range-number-inputs input:focus { border-color: #ffcb27; }
.range-separator { color: #9ca3af; font-size: 13px; flex-shrink: 0; }

/* ===== DROPDOWN CHECKBOX ===== */
.dropdown-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: #374151;
  transition: 0.1s;
  user-select: none;
}
.dropdown-checkbox:hover { background: #f9fafb; }
.dropdown-checkbox input[type="checkbox"] { display: none; }
.cv-sm {
  width: 18px;
  height: 18px;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.12s;
  flex-shrink: 0;
}
.dropdown-checkbox input:checked + .cv-sm {
  background: #ffcb27;
  border-color: #ffcb27;
}
.dropdown-checkbox input:checked + .cv-sm::after {
  content: '✓';
  color: #000;
  font-size: 12px;
  font-weight: 700;
}

/* ===== CATALOG GRID ===== */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
@media (max-width: 1023px) {
  .catalog-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}
@media (max-width: 767px) {
  .catalog-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

/* ===== PRODUCT CARD ===== */
.product-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 20px rgba(0,0,0,0.12);
}
.product-card .add-to-cart-btn {
  display: block;
  width: calc(100% - 24px);
  margin: 0 12px 12px;
  padding: 10px;
  background: #ffcb27;
  color: #000;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s, background 0.2s;
  opacity: 0;
  transform: translateY(5px);
}
.product-card:hover .add-to-cart-btn {
  opacity: 1;
  transform: translateY(0);
}
.product-card .add-to-cart-btn:hover { background: #feb331; }
@media (max-width: 767px) {
  .product-card .add-to-cart-btn { opacity: 1; transform: translateY(0); }
}

/* Card Image */
.card-image-block {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f9f9f9;
}
.card-image-block img {
  object-fit: cover;
  width: 100%;
  height: 100%;
  transition: transform 0.3s ease;
}
.product-card:hover .card-image-block img { transform: scale(1.05); }

/* Offer Glow */
.product-card[data-offer="sale"] { box-shadow: 0 0 0 2px #fff, 0 0 12px 4px rgba(239,68,68,0.35), 0 4px 12px rgba(0,0,0,0.08); }
.product-card[data-offer="sale"]:hover { box-shadow: 0 0 0 2px #fff, 0 0 18px 6px rgba(239,68,68,0.45), 0 12px 20px rgba(0,0,0,0.12); }
.product-card[data-offer="new"] { box-shadow: 0 0 0 2px #fff, 0 0 12px 4px rgba(59,130,246,0.35), 0 4px 12px rgba(0,0,0,0.08); }
.product-card[data-offer="new"]:hover { box-shadow: 0 0 0 2px #fff, 0 0 18px 6px rgba(59,130,246,0.45), 0 12px 20px rgba(0,0,0,0.12); }
.product-card[data-offer="hit"] { box-shadow: 0 0 0 2px #fff, 0 0 12px 4px rgba(245,158,11,0.35), 0 4px 12px rgba(0,0,0,0.08); }
.product-card[data-offer="hit"]:hover { box-shadow: 0 0 0 2px #fff, 0 0 18px 6px rgba(245,158,11,0.45), 0 12px 20px rgba(0,0,0,0.12); }
.product-card[data-offer="leasing"] { box-shadow: 0 0 0 2px #fff, 0 0 12px 4px rgba(16,185,129,0.35), 0 4px 12px rgba(0,0,0,0.08); }
.product-card[data-offer="leasing"]:hover { box-shadow: 0 0 0 2px #fff, 0 0 18px 6px rgba(16,185,129,0.45), 0 12px 20px rgba(0,0,0,0.12); }

/* Offer Badge */
.offer-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  z-index: 2;
  letter-spacing: 0.02em;
}
.offer-badge.sale { background: #ef4444; }
.offer-badge.new { background: #3b82f6; }
.offer-badge.hit { background: #f59e0b; }
.offer-badge.leasing { background: #10b981; }

/* Favorite Button */
.favorite-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.85);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.2s;
  border: none;
  z-index: 2;
  font-size: 16px;
  line-height: 1;
  backdrop-filter: blur(4px);
}
.favorite-btn:hover { background: #fff; transform: scale(1.1); }
.favorite-btn.active { color: #ef4444; }

/* Card Info */
.card-info { padding: 0; flex: 1; display: flex; flex-direction: column; }
.card-title {
  font-size: 15px;
  font-weight: 600;
  color: #000;
  margin: 12px 12px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}
.card-rating { display: flex; align-items: center; gap: 4px; margin: 6px 12px; font-size: 13px; }
.card-rating .stars { color: #feb331; letter-spacing: 1px; }
.card-rating .review-count { color: #9ca3af; font-size: 12px; margin-left: 4px; }
.card-price { margin: 6px 12px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.new-price { font-size: 18px; font-weight: 700; color: #000; }
.old-price { font-size: 14px; color: #9ca3af; text-decoration: line-through; }
.discount-percent { font-size: 13px; font-weight: 600; color: #10b981; }

/* ===== PAGINATION ===== */
.pagination-btn {
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: #000;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
  padding: 0 4px;
}
.pagination-btn:hover { border-color: #ffcb27; background: #fffef5; }
.pagination-btn.active { background: #ffcb27; border-color: #ffcb27; }
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }

#loadMoreBtn {
  border: 2px solid #ffcb27;
  border-radius: 10px;
  background: transparent;
  color: #000;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 32px;
  cursor: pointer;
  transition: 0.2s;
}
#loadMoreBtn:hover { background: #ffcb27; }
#loadMoreBtn:disabled { opacity: 0.4; cursor: not-allowed; background: transparent; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s;
}
.modal-overlay.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalSlide 0.2s ease;
  overflow: hidden;
}
@keyframes modalSlide { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f3f4f6;
}
.modal-close-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: none;
  cursor: pointer;
  transition: 0.15s;
  color: #6b7280;
}
.modal-close-btn:hover { background: #f3f4f6; color: #000; }

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-filter-group { margin-bottom: 20px; }
.modal-filter-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #000;
}
.modal-cb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.modal-footer {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid #f3f4f6;
}
.modal-reset-btn {
  flex: 1;
  padding: 10px;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  color: #000;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
}
.modal-reset-btn:hover { background: #f3f4f6; }
.modal-apply-btn {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 10px;
  background: #ffcb27;
  color: #000;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
}
.modal-apply-btn:hover { background: #feb331; }

@media (max-width: 480px) {
  .modal-content { max-height: 95vh; border-radius: 12px; }
  .modal-cb-grid { grid-template-columns: 1fr; }
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1f2937;
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }