/* =============================================
   WATCHMART — GLOBAL STYLES
   ============================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #1a1a2e;
  --accent: #f0c040;
  --danger: #e74c3c;
  --success: #27ae60;
  --bg: #f5f5f5;
  --white: #ffffff;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  --radius: 10px;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: #333;
}

/* ===== HEADER ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 25px;
  background: var(--primary);
  color: white;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
  gap: 15px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
}

.logo span {
  color: white;
}

/* ===== SEARCH BAR ===== */
.search-bar {
  display: flex;
  flex: 1;
  max-width: 450px;
}

.search-bar input {
  flex: 1;
  padding: 10px 18px;
  border: none;
  border-radius: 25px 0 0 25px;
  outline: none;
  font-size: 0.9rem;
  background: #f0f0f0;
}

.search-bar button {
  padding: 10px 18px;
  background: var(--accent);
  border: none;
  border-radius: 0 25px 25px 0;
  cursor: pointer;
  color: var(--primary);
  font-size: 1rem;
}

/* ===== CART ICON ===== */
.cart-btn {
  position: relative;
  cursor: pointer;
  font-size: 1.5rem;
  color: white;
  background: none;
  border: none;
  padding: 5px;
}

.cart-count {
  position: absolute;
  top: -5px;
  right: -8px;
  background: var(--danger);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* ===== HERO SECTION ===== */
.hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: white;
  text-align: center;
  padding: 80px 20px;
}

.hero h2 {
  font-size: 2.2rem;
  color: var(--accent);
  margin-bottom: 12px;
}

.hero p {
  font-size: 1.1rem;
  color: #ccc;
  margin-bottom: 25px;
}

.hero-badge {
  display: inline-block;
  background: var(--accent);
  color: var(--primary);
  padding: 8px 20px;
  border-radius: 25px;
  font-weight: bold;
  font-size: 0.9rem;
}

.category-nav {
  max-width: 1400px;
  margin: 22px auto 0;
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.category-chip {
  border: 1px solid rgba(26, 26, 46, 0.12);
  background: #fff;
  color: var(--primary);
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.category-chip:hover,
.category-chip.active {
  background: var(--accent);
  color: var(--primary);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

/* ===== PRODUCTS SECTION ===== */
.products-section {
  padding: 40px 20px;
  max-width: 1400px;
  margin: 0 auto;
}

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

.section-title {
  font-size: 1.5rem;
  color: var(--primary);
  border-left: 4px solid var(--accent);
  padding-left: 12px;
}

/* ===== RESPONSIVE GRID (PRD Specs) ===== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* Mobile: 2 per row */
  gap: 15px;
}

@media (min-width: 600px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr); /* Tablet */
  }
}

@media (min-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr); /* Desktop: 4 per row */
  }
}

/* ===== PRODUCT CARD ===== */
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.product-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  cursor: pointer;
}

.product-info {
  padding: 12px;
}

.product-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
  line-height: 1.3;
}

.product-price {
  font-size: 1.05rem;
  font-weight: bold;
  color: var(--danger);
  margin-bottom: 10px;
}

.btn-add-cart {
  width: 100%;
  padding: 9px;
  background: var(--primary);
  color: var(--accent);
  border: none;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-add-cart:hover {
  background: var(--accent);
  color: var(--primary);
}

.out-of-stock {
  width: 100%;
  padding: 9px;
  background: #eee;
  color: #999;
  border: none;
  border-radius: 7px;
  font-size: 0.85rem;
  cursor: not-allowed;
}

/* ===== PRODUCT CARD RATING BADGE ===== */
.product-card-rating {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #d97706;
  background: #fffbeeb3;
  padding: 2px 6px;
  border-radius: 4px;
}

.product-card-rating i {
  color: #f59e0b;
}

/* ===== PAGINATION FEATURE ===== */
.pagination-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 35px;
  padding: 15px 0 5px;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination-btn {
  padding: 8px 14px;
  border: 1px solid #ddd;
  background: #ffffff;
  color: var(--primary);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--primary);
  transform: translateY(-1px);
}

.pagination-btn.active {
  background: var(--primary);
  color: var(--accent);
  border-color: var(--primary);
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.pagination-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: #eee;
}

.pagination-dots {
  color: #888;
  font-weight: bold;
  padding: 0 4px;
}

.pagination-info {
  font-size: 0.85rem;
  color: #666;
  font-weight: 500;
}

/* ===== BUTTONS ===== */
.btn-primary {
  padding: 12px 28px;
  background: var(--accent);
  color: var(--primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: var(--primary);
  color: var(--accent);
}

.btn-secondary {
  padding: 12px 28px;
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: var(--primary);
  color: white;
}

/* ===== LOADING SPINNER ===== */
.loading-container {
  text-align: center;
  padding: 80px 20px;
  color: #666;
}

.spinner {
  width: 45px;
  height: 45px;
  border: 4px solid #eee;
  border-top: 4px solid var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 15px;
}

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

/* ===== TOAST NOTIFICATION ===== */
.toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: var(--accent);
  padding: 14px 28px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.5s ease;
  white-space: nowrap;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.toast.show { opacity: 1; }

/* ===== FOOTER ===== */
.footer {
  background: var(--primary);
  color: #aaa;
  text-align: center;
  padding: 25px 20px;
  margin-top: 60px;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: #666;
}

.empty-state .icon {
  font-size: 5rem;
  margin-bottom: 15px;
}

/* ===== SUMMARY ROWS ===== */
.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.95rem;
}

.summary-row.total {
  font-size: 1.15rem;
  font-weight: bold;
  color: var(--primary);
  border-bottom: none;
  padding-top: 15px;
}

/* ===== BADGE ===== */
.badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: bold;
}

.badge-pending  { background: #fff3cd; color: #856404; }
.badge-confirmed { background: #cce5ff; color: #004085; }
.badge-completed { background: #d4edda; color: #155724; }
.badge-cancelled { background: #f8d7da; color: #721c24; }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .header { padding: 12px 15px; }
  .logo { font-size: 1.2rem; }
  .hero h2 { font-size: 1.5rem; }
  .search-bar { display: none; }
}