/* ===== OK MART - CATEGORY PAGE STYLES ===== */
/* Includes styles for both dairy and fruits pages */

.category-main {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 14px 85px;
  min-height: 100vh;
}

/* Animations */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-8px) rotate(-5deg); }
  75% { transform: translateY(-8px) rotate(5deg); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-slide-up {
  animation: slideUp 0.4s ease-out forwards;
  opacity: 0;
}

/* Header */
.category-header {
  position: sticky;
  top: 0;
  background: var(--card-bg);
  padding: 12px 16px;
  z-index: 100;
  border-bottom: 1px solid var(--border-light);
}

.category-header .header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.back-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-light);
  text-decoration: none;
  transition: all 0.2s;
}

.back-button:active {
  background: var(--border-light);
  transform: scale(0.92);
}

.back-icon {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-dark);
}

.logo-link {
  text-decoration: none;
}

.logo-text {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wishlist-icon-link {
  position: relative;
  padding: 8px;
  background: var(--bg-light);
  border-radius: 40px;
  text-decoration: none;
}

.wishlist-icon {
  font-size: 1.2rem;
}

.wishlist-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #dc2626;
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 16px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

/* Category Hero */
.category-hero {
  text-align: center;
  padding: 24px 16px 20px;
  margin-bottom: 8px;
}

.category-icon-wrapper {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
}

.category-icon {
  font-size: 3.5rem;
  position: relative;
  z-index: 2;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

.icon-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(46,204,113,0.2) 0%, transparent 70%);
  animation: pulse 2s ease-in-out infinite;
}

.category-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.category-description {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 300px;
  margin: 0 auto 16px;
}

.category-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-value {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary-dark);
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Search */
.search-container {
  padding: 8px 0 12px;
}

.search-wrapper {
  position: relative;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 14px 48px 14px 44px;
  background: var(--card-bg);
  border: 1.5px solid var(--border-light);
  border-radius: 30px;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(46,204,113,0.1);
  outline: none;
}

.clear-search {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  display: none;
}

.clear-search.visible {
  display: block;
}

/* Quick Filters */
.quick-filters {
  padding: 8px 0 12px;
}

.filter-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 0;
}

.filter-scroll::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex-shrink: 0;
  padding: 10px 18px;
  background: var(--card-bg);
  border: 1.5px solid var(--border-light);
  border-radius: 40px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-chip:active {
  transform: scale(0.94);
}

.filter-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  font-weight: 600;
}

/* Seasonal Banner */
.seasonal-banner {
  margin: 8px 0 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  border-radius: 16px;
  border: 1px solid #f59e0b;
}

.seasonal-banner .banner-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.banner-icon {
  font-size: 1.2rem;
}

.banner-text {
  font-weight: 600;
  color: #92400e;
  font-size: 0.85rem;
}

/* Results Header */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 8px;
}

.results-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.sort-container {
  position: relative;
}

.sort-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--card-bg);
  border: 1.5px solid var(--border-light);
  border-radius: 40px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.2s;
}

.sort-btn:active {
  background: var(--bg-light);
}

.sort-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  min-width: 180px;
  overflow: hidden;
  z-index: 50;
  animation: fadeIn 0.2s ease-out;
}

.sort-option {
  width: 100%;
  padding: 14px 18px;
  background: none;
  border: none;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dark);
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border-light);
}

.sort-option:last-child {
  border-bottom: none;
}

.sort-option:hover {
  background: var(--bg-light);
}

.sort-option.active {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}

/* Loading Animation */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
}

.loading-animation {
  text-align: center;
}

.fruit-loader {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}

.fruit-loader span {
  font-size: 2rem;
  animation: bounce 0.8s ease-in-out infinite;
}

.fruit-loader span:nth-child(1) { animation-delay: 0s; }
.fruit-loader span:nth-child(2) { animation-delay: 0.15s; }
.fruit-loader span:nth-child(3) { animation-delay: 0.3s; }
.fruit-loader span:nth-child(4) { animation-delay: 0.45s; }

.milk-loader {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 16px;
}

.milk-loader span {
  font-size: 2rem;
  animation: bounce 0.8s ease-in-out infinite;
}

.milk-loader span:nth-child(1) { animation-delay: 0s; }
.milk-loader span:nth-child(2) { animation-delay: 0.15s; }
.milk-loader span:nth-child(3) { animation-delay: 0.3s; }

.loading-animation p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 8px 0;
}

.product-card {
  animation: fadeIn 0.4s ease-out forwards;
  opacity: 0;
}

.product-card:nth-child(1) { animation-delay: 0.02s; }
.product-card:nth-child(2) { animation-delay: 0.04s; }
.product-card:nth-child(3) { animation-delay: 0.06s; }
.product-card:nth-child(4) { animation-delay: 0.08s; }
.product-card:nth-child(5) { animation-delay: 0.10s; }
.product-card:nth-child(6) { animation-delay: 0.12s; }
.product-card:nth-child(n+7) { animation-delay: 0.14s; }

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

.empty-animation {
  margin-bottom: 20px;
}

.empty-icon {
  font-size: 4rem;
  opacity: 0.5;
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}

.empty-state h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: 20px;
}

.reset-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: 40px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.reset-btn:active {
  transform: scale(0.95);
}

/* Popular Section */
.popular-in-category {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.popular-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 12px;
}

/* Combos Section */
.combos-section {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.combos-section .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.combo-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  padding: 4px 12px;
  border-radius: 40px;
  font-size: 0.7rem;
  font-weight: 600;
}

.combos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.combo-card {
  background: linear-gradient(135deg, var(--card-bg), var(--bg-light));
  border-radius: 18px;
  padding: 16px;
  border: 2px dashed var(--primary);
  text-align: center;
}

.combo-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.combo-title {
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.combo-price {
  color: var(--primary-dark);
  font-weight: 700;
  margin-bottom: 8px;
}

.combo-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.75rem;
  cursor: pointer;
}

/* Toast */
.toast-message {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-dark);
  color: white;
  padding: 12px 24px;
  border-radius: 40px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s;
  z-index: 1000;
  white-space: nowrap;
}

.toast-message.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-message.success {
  background: #10b981;
}

/* Responsive */
@media (min-width: 500px) {
  .category-main {
    padding: 0 16px 85px;
  }
  
  .product-grid,
  .popular-grid,
  .combos-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .category-main {
    max-width: 720px;
  }
  
  .product-grid,
  .popular-grid,
  .combos-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
