/* ===========================
   kwiKKirana PAGE STYLES
   =========================== */

/* This file is intentionally minimal since pages use inline styles.
   It provides shared page-level utilities. */

/* --- Page Container --- */
.page {
  padding-top: var(--space-lg);
  padding-bottom: var(--space-3xl);
  min-height: calc(100vh - var(--navbar-height) - 200px);
}

/* --- Horizontal Scroll Container --- */
.scroll-row {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

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

.scroll-row > * {
  scroll-snap-align: start;
  flex-shrink: 0;
}

/* --- Product Grid --- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-md);
}

/* --- Category Grid --- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-md);
}

/* --- Filter Chips --- */
.filter-chips {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  scrollbar-width: none;
}

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

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  font-size: var(--font-sm);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  background: var(--bg);
  color: var(--text-secondary);
  flex-shrink: 0;
}

.filter-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

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

/* --- Stepper --- */
.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) 0;
}

.stepper-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  flex: 1;
  position: relative;
}

.stepper-step::before {
  content: '';
  position: absolute;
  top: 20px;
  left: -50%;
  right: 50%;
  height: 3px;
  background: var(--border);
  z-index: 0;
}

.stepper-step:first-child::before {
  display: none;
}

.stepper-step.completed::before,
.stepper-step.active::before {
  background: var(--primary);
}

.stepper-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  position: relative;
  z-index: 1;
  transition: all var(--transition-normal);
}

.stepper-step.completed .stepper-circle {
  background: var(--primary);
  border-color: var(--primary);
}

.stepper-step.active .stepper-circle {
  background: var(--primary-light);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.15);
  animation: pulse 2s ease-in-out infinite;
}

.stepper-label {
  font-size: var(--font-xs);
  font-weight: 500;
  color: var(--text-tertiary);
  text-align: center;
}

.stepper-step.completed .stepper-label,
.stepper-step.active .stepper-label {
  color: var(--primary);
  font-weight: 600;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--space-sm);
  }

  .category-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--space-sm);
  }

  .stepper-label {
    font-size: 0.6rem;
  }

  .stepper-circle {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }
}

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

  .category-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
