/* ================================================
   LaptopBazaar — Custom CSS
   Cream & Slate & Amber palette
   ================================================ */

:root {
  --bg-page:      #F7F3EE;
  --bg-card:      #FFFFFF;
  --bg-subtle:    #EDE5D8;
  --text-primary: #1E293B;
  --text-muted:   #64748B;
  --accent:       #D97706;
  --accent-hover: #F59E0B;
  --accent-light: #FEF3C7;
  --border:       #E2D9CE;
  --shadow:       0 2px 12px rgba(30,41,59,0.08);
  --shadow-lg:    0 8px 32px rgba(30,41,59,0.12);
  --radius-card:  12px;
  --radius-btn:   8px;
  --radius-input: 8px;
}

/* ---- Reset / Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
  line-height: 1.2;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-subtle); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ---- Back to Top ---- */
#backToTop {
  position: fixed; bottom: 2rem; right: 2rem;
  background: var(--accent); color: white;
  border: none; border-radius: 50%; width: 44px; height: 44px;
  cursor: pointer; display: none; font-size: 18px;
  box-shadow: var(--shadow); transition: all 0.3s ease;
  z-index: 999; align-items: center; justify-content: center;
}
#backToTop:hover { background: var(--accent-hover); transform: translateY(-2px); }
#backToTop.visible { display: flex; }

/* ---- Sticky Header Glass ---- */
header { transition: background 0.3s ease, box-shadow 0.3s ease; }
header.scrolled {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(247,243,238,0.9) !important;
  box-shadow: 0 2px 16px rgba(30,41,59,0.09);
}

/* ---- Nav link ---- */
.nav-link {
  position: relative;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.925rem;
  padding: 0.25rem 0;
  transition: color 0.22s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.22s ease;
}
.nav-link:hover { color: var(--accent); }
.nav-link:hover::after { width: 100%; }
.nav-link.active { color: var(--accent); }
.nav-link.active::after { width: 100%; }

/* ---- Mobile Menu ---- */
#mobileMenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  background: var(--bg-page);
  border-top: 1px solid var(--border);
}
#mobileMenu.open { max-height: 400px; }

/* ---- Buttons ---- */
.btn-primary {
  background: var(--accent);
  color: white;
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-btn);
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: 'DM Sans', sans-serif;
  display: inline-flex; align-items: center; gap: 0.5rem;
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1;
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(217,119,6,0.35);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-btn);
  font-weight: 500;
  border: 1.5px solid var(--accent);
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: 'DM Sans', sans-serif;
  display: inline-flex; align-items: center; gap: 0.5rem;
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1;
}
.btn-outline:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}

.btn-dark {
  background: var(--text-primary);
  color: white;
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-btn);
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: 'DM Sans', sans-serif;
  display: inline-flex; align-items: center; gap: 0.5rem;
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1;
}
.btn-dark:hover { background: #334155; transform: translateY(-1px); }

/* ---- Product Card ---- */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  transition: all 0.3s ease;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(30,41,59,0.12);
  border-color: var(--accent);
}
.product-card__img {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--bg-subtle);
  position: relative;
}
.product-card__img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s ease;
}
.product-card:hover .product-card__img img { transform: scale(1.04); }
.product-card__body { padding: 1rem 1.125rem; flex: 1; display: flex; flex-direction: column; gap: 0.375rem; }
.product-card__footer {
  padding: 0.875rem 1.125rem;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 0.625rem;
}

/* ---- Badge ---- */
.badge {
  background: var(--accent-light);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  font-family: 'DM Sans', sans-serif;
  display: inline-block;
}

/* ---- Stars ---- */
.stars { color: #D97706; font-size: 0.8rem; letter-spacing: 0.04em; }

/* ---- Spec chips ---- */
.spec-chip {
  display: inline-flex; align-items: center; gap: 0.25rem;
  font-size: 0.7rem; font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-page);
  border: 1px solid var(--border);
  padding: 0.18rem 0.55rem;
  border-radius: 20px;
  white-space: nowrap;
}

/* ---- Active filter tag ---- */
.filter-tag {
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid #FDE68A;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
}
.filter-tag:hover { background: #FDE68A; }

/* ---- Filter checkbox / range ---- */
input[type="checkbox"] { accent-color: var(--accent); }
input[type="range"] { accent-color: var(--accent); width: 100%; }

/* ---- Filter sidebar ---- */
.filter-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  position: sticky; top: 84px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}
.filter-group { border-bottom: 1px solid var(--border); padding: 1rem 1.125rem; }
.filter-group:last-child { border-bottom: none; }
.filter-group-title {
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-primary);
  margin-bottom: 0.75rem;
}
.filter-check-label {
  display: flex; align-items: center; gap: 0.5rem;
  cursor: pointer; padding: 0.2rem 0;
  font-size: 0.875rem; color: var(--text-primary);
  transition: color 0.2s ease;
}
.filter-check-label:hover { color: var(--accent); }

/* ---- Skeleton shimmer ---- */
.skeleton {
  background: linear-gradient(90deg, #EDE5D8 25%, #F7F3EE 50%, #EDE5D8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ---- Form inputs ---- */
.form-label { font-weight: 500; font-size: 0.875rem; color: var(--text-primary); display: block; margin-bottom: 0.375rem; }
.form-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 0.65rem 0.875rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: white;
  outline: none;
  transition: border-color 0.22s ease, box-shadow 0.22s ease;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217,119,6,0.12);
}
.form-input::placeholder { color: #94A3B8; }
.form-error { font-size: 0.78rem; color: #DC2626; margin-top: 0.25rem; display: none; }
.form-error.show { display: block; }
.form-input.invalid { border-color: #DC2626; }

/* ---- Tabs ---- */
.tab-btn {
  padding: 0.625rem 1.375rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem; font-weight: 500;
  color: var(--text-muted);
  border: none; border-bottom: 2px solid transparent;
  background: none; cursor: pointer;
  transition: all 0.22s ease;
  white-space: nowrap;
}
.tab-btn.active { color: var(--text-primary); border-bottom-color: var(--accent); font-weight: 600; }
.tab-btn:hover { color: var(--accent); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ---- Qty selector ---- */
.qty-selector { display: flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-input); overflow: hidden; width: fit-content; }
.qty-btn {
  width: 38px; height: 38px;
  background: var(--bg-page); border: none; cursor: pointer;
  font-size: 1.1rem; color: var(--text-primary);
  transition: all 0.2s ease;
  display: flex; align-items: center; justify-content: center;
}
.qty-btn:hover { background: var(--accent-light); color: var(--accent); }
.qty-num {
  width: 48px; text-align: center;
  font-weight: 600; font-size: 0.95rem;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: white; color: var(--text-primary);
  padding: 0.5rem 0;
}

/* ---- Gallery ---- */
.gallery-main {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden; aspect-ratio: 4/3;
  background: var(--bg-subtle);
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; transition: opacity 0.3s ease; }
.gallery-thumb {
  border: 2px solid var(--border);
  border-radius: 8px; overflow: hidden;
  aspect-ratio: 1; cursor: pointer;
  transition: border-color 0.2s ease;
  background: var(--bg-subtle);
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.active, .gallery-thumb:hover { border-color: var(--accent); }

/* ---- Breadcrumb ---- */
.breadcrumb { display: flex; align-items: center; gap: 0.375rem; font-size: 0.85rem; color: var(--text-muted); }
.breadcrumb a { color: var(--text-muted); text-decoration: none; transition: color 0.2s ease; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--accent); font-size: 0.8rem; }

/* ---- Spec table ---- */
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table tr:nth-child(even) { background: #FDFBF8; }
.spec-table td { padding: 0.6rem 0.875rem; font-size: 0.875rem; border-bottom: 1px solid var(--border); }
.spec-table td:first-child { font-weight: 600; color: var(--text-muted); width: 38%; }

/* ---- FAQ ---- */
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  margin-bottom: 0.625rem;
  transition: border-color 0.22s ease;
  overflow: hidden;
}
.faq-item.open { border-left: 3px solid var(--accent); }
.faq-question {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; cursor: pointer;
  font-weight: 500; font-size: 0.925rem; color: var(--text-primary);
  user-select: none;
}
.faq-question:hover { color: var(--accent); }
.faq-icon { color: var(--accent); font-size: 1.1rem; flex-shrink: 0; transition: transform 0.25s ease; }
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.32s ease; }
.faq-item.open .faq-answer { max-height: 300px; }
.faq-answer-inner {
  padding: 0 1.25rem 1rem;
  font-size: 0.875rem; color: var(--text-muted); line-height: 1.7;
  border-top: 1px solid var(--border); padding-top: 0.875rem;
}

/* ---- Category cards ---- */
.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.75rem 1.5rem;
  text-align: center;
  transition: all 0.28s ease;
  text-decoration: none;
  display: block;
  box-shadow: var(--shadow);
}
.category-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.category-icon {
  width: 56px; height: 56px;
  border-radius: 12px;
  background: var(--accent-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.375rem; color: var(--accent);
  margin: 0 auto 1rem;
  transition: all 0.28s ease;
}
.category-card:hover .category-icon { background: var(--accent); color: white; }

/* ---- Why card ---- */
.why-card { text-align: center; padding: 1.75rem 1.25rem; }
.why-icon {
  font-size: 2rem; color: var(--accent);
  margin-bottom: 1rem; display: block;
}

/* ---- Stats bar ---- */
.stat-item { text-align: center; }
.stat-num { font-family: 'Outfit', sans-serif; font-size: 1.75rem; font-weight: 700; color: white; }
.stat-label { font-size: 0.8rem; color: #CBD5E1; margin-top: 0.125rem; }

/* ---- Testimonial ---- */
.testimonial-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.625rem;
  box-shadow: var(--shadow);
  transition: all 0.28s ease;
}
.testimonial-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }

/* ---- Mobile filter drawer ---- */
.filter-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(30,41,59,0.4); z-index: 800;
}
.filter-overlay.open { display: block; }
.filter-drawer {
  position: fixed; top: 0; left: -320px;
  width: 300px; height: 100vh;
  background: var(--bg-card); z-index: 900;
  overflow-y: auto;
  transition: left 0.3s ease;
  border-right: 1px solid var(--border);
}
.filter-drawer.open { left: 0; }

/* ---- Cart toast ---- */
.cart-toast {
  position: fixed; top: 84px; right: 1.5rem;
  background: var(--text-primary); color: white;
  padding: 0.7rem 1.25rem;
  border-radius: var(--radius-btn);
  font-size: 0.875rem; font-weight: 500;
  z-index: 2000;
  opacity: 0; transform: translateX(20px);
  transition: all 0.3s ease;
  pointer-events: none;
  display: flex; align-items: center; gap: 0.5rem;
  box-shadow: var(--shadow-lg);
}
.cart-toast .toast-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.cart-toast.show { opacity: 1; transform: translateX(0); }

/* ---- Wishlist heart ---- */
.heart-btn {
  background: none; border: none; cursor: pointer;
  color: #CBD5E1; font-size: 1.125rem;
  transition: all 0.22s ease; padding: 0.25rem; line-height: 1;
}
.heart-btn:hover, .heart-btn.active { color: #EF4444; transform: scale(1.15); }

/* ---- No results ---- */
.no-results { display: none; text-align: center; padding: 4rem 2rem; }
.no-results.show { display: block; }

/* ---- Page hero ---- */
.page-hero {
  padding: 5.5rem 0 3.5rem;
  background: var(--bg-subtle);
  position: relative;
  overflow: hidden;
}

/* ---- Entrance animations ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.55s ease both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* ---- Footer ---- */
footer { background: #1E293B; color: #E2D9CE; }
.footer-link {
  color: #94A3B8; text-decoration: none; font-size: 0.875rem;
  transition: color 0.22s ease; display: block; padding: 0.2rem 0;
}
.footer-link:hover { color: var(--accent); }
.social-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(226,217,206,0.15);
  color: #94A3B8; display: flex; align-items: center; justify-content: center;
  text-decoration: none; transition: all 0.22s ease; font-size: 0.875rem;
}
.social-btn:hover { background: var(--accent); border-color: var(--accent); color: white; transform: translateY(-2px); }

/* ---- Responsive ---- */
@media (max-width: 1023px) {
  .desktop-filter { display: none; }
  .filter-toggle-btn { display: flex !important; }
}
@media (max-width: 767px) {
  .stat-num { font-size: 1.375rem; }
}
