/**
 * Bazaario — Flipkart-style E-commerce Frontend (STATIC DEMO)
 * Brand: Bazaario — "Sab kuch, sabke liye"
 * Complete stylesheet for ALL pages per DESIGN.md & PRD.md
 * 
 * Target Pages:
 *  1. index.html    - Hero banner, category chips, deals row, product grids
 *  2. products.html - Full catalog, category filters, search results, sort
 *  3. product.html  - Product detail 2-col, gallery, offers, specs, CTAs, related
 *  4. cart.html     - Cart items list, qty selector, coupon box, price summary, empty state
 *  5. checkout.html - Address/phone form, payment selector, summary, success screen
 */

/* ==========================================================================
   1. DESIGN TOKENS (Per DESIGN.md exactly)
   ========================================================================== */
:root {
  /* Color & gradient tokens */
  --brand: #4f46e5;
  --brand-dark: #3730a3;
  --accent: #f59e0b;
  --bg: #f6f7fb;
  --card: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --ok: #059669;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(16,24,40,.08), 0 4px 14px rgba(16,24,40,.06);
  --grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #db2777 100%);

  /* Typography & surface helpers */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow-hover: 0 10px 25px -5px rgba(16,24,40,.12), 0 8px 10px -6px rgba(16,24,40,.08);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.12);
  --max-w: 1200px;
  --header-h: 70px;
}

/* ==========================================================================
   2. CSS RESET & BASE STYLES
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  flex: 1 0 auto;
}

/* Headings: weight 700-800, tight letter-spacing per DESIGN.md */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
  line-height: 1.25;
}

h1 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 2.5vw, 1.85rem); font-weight: 800; }
h3 { font-size: 1.25rem; font-weight: 700; }
h4 { font-size: 1.05rem; font-weight: 700; }

p {
  color: var(--ink);
  margin-bottom: 0.5rem;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

ul, ol {
  list-style: none;
}

/* Accessible focus ring */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Screen reader utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   3. LAYOUT CONTAINER
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
}

/* ==========================================================================
   4. STICKY HEADER & LOGO
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 2px 10px rgba(16,24,40,.06);
  transition: box-shadow 0.2s ease;
}

.site-header.scrolled {
  box-shadow: 0 4px 16px rgba(16,24,40,.10);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--header-h);
  padding: 10px 0;
}

/* Logo: "Baz" in grad box + "aario" ink */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.45rem;
  line-height: 1;
  flex-shrink: 0;
  user-select: none;
}

.logo-badge {
  background: var(--grad);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 1.25rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.logo-text {
  color: var(--ink);
  font-weight: 800;
}

/* Header Navigation & Live Cart Icon */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-link {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--brand);
  background-color: rgba(79, 70, 229, 0.08);
}

.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background-color: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cart-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  background-color: #ffffff;
}

.cart-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background-color: var(--danger);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 5px rgba(220, 38, 38, 0.35);
  line-height: 1;
}

/* ==========================================================================
   5. SEARCH PILL (44px, grow on focus per DESIGN.md)
   ========================================================================== */
.search-pill-wrap {
  flex: 1;
  max-width: 460px;
  margin: 0 8px;
  transition: max-width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-pill-wrap:focus-within {
  max-width: 560px;
}

.search-pill {
  display: flex;
  align-items: center;
  height: 44px;
  border-radius: 9999px;
  background-color: var(--bg);
  border: 1.5px solid var(--border);
  padding: 0 14px 0 18px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-pill:focus-within {
  background-color: #ffffff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.92rem;
  color: var(--ink);
  min-width: 0;
}

.search-input::placeholder {
  color: var(--muted);
}

.search-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  margin-left: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.search-btn:hover {
  color: var(--brand);
  background-color: rgba(79, 70, 229, 0.08);
}

/* ==========================================================================
   6. GRADIENT HERO BANNER & FLOATING CSS SHAPES
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--grad);
  color: #ffffff;
  padding: 48px 0;
  border-radius: 0;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 620px;
}

.hero-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 4px 12px;
  border-radius: 9999px;
  margin-bottom: 14px;
}

.hero h1,
.hero-title {
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #ffffff;
  margin-bottom: 14px;
}

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 26px;
  line-height: 1.5;
  max-width: 520px;
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: #ffffff;
  color: var(--brand);
  font-weight: 700;
  font-size: 1rem;
  padding: 12px 24px;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.btn-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28);
  background-color: #f9fafb;
}

/* Floating rounded rectangle collage CSS shapes per DESIGN.md */
.hero-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.hero-shape {
  position: absolute;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.20);
}

.hero-shape-1 {
  width: 220px;
  height: 140px;
  top: -20px;
  right: 5%;
  transform: rotate(-12deg);
  animation: heroFloat1 7s ease-in-out infinite alternate;
}

.hero-shape-2 {
  width: 170px;
  height: 170px;
  bottom: -35px;
  right: 20%;
  transform: rotate(18deg);
  background: rgba(255, 255, 255, 0.08);
  animation: heroFloat2 9s ease-in-out infinite alternate;
}

.hero-shape-3 {
  width: 110px;
  height: 90px;
  top: 32%;
  right: 36%;
  transform: rotate(6deg);
  background: rgba(255, 255, 255, 0.12);
  animation: heroFloat1 6s ease-in-out infinite alternate-reverse;
}

@keyframes heroFloat1 {
  0% { transform: translateY(0) rotate(-12deg); }
  100% { transform: translateY(-14px) rotate(-8deg); }
}

@keyframes heroFloat2 {
  0% { transform: translateY(0) rotate(18deg); }
  100% { transform: translateY(16px) rotate(22deg); }
}

/* ==========================================================================
   7. CATEGORY CHIPS (Horizontal scroll on mobile per DESIGN.md)
   ========================================================================== */
.chips-section {
  padding: 20px 0 10px;
}

.chips-container {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  padding: 4px 2px 12px;
}

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

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 9999px;
  background-color: var(--card);
  color: var(--ink);
  border: 1.5px solid var(--border);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16,24,40,.04);
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.chip:hover {
  border-color: var(--brand);
  color: var(--brand);
  background-color: rgba(79, 70, 229, 0.05);
  transform: translateY(-1px);
}

.chip.active {
  background-color: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.35);
}

/* ==========================================================================
   8. BUTTONS (per DESIGN.md: .btn, .btn-accent, .btn-ghost)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--brand);
  color: #ffffff;
  border: 1.5px solid transparent;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(16,24,40,.05);
  transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  background-color: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.btn:active {
  transform: translateY(0);
}

/* Orange accent button for buy */
.btn-accent {
  background-color: var(--accent);
  color: #ffffff;
  border-color: transparent;
}

.btn-accent:hover {
  background-color: #d97706;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* Ghost outline button */
.btn-ghost {
  background-color: transparent;
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: none;
}

.btn-ghost:hover {
  background-color: rgba(79, 70, 229, 0.08);
  color: var(--brand-dark);
  border-color: var(--brand-dark);
}

/* Button sizing and variants */
.btn-sm {
  padding: 8px 14px;
  font-size: 0.85rem;
  border-radius: 8px;
}

.btn-lg {
  padding: 14px 26px;
  font-size: 1.05rem;
  border-radius: 12px;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #b91c1c;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ==========================================================================
   9. PRODUCT GRID (.pgrid) & PRODUCT CARDS
   ========================================================================== */
.pgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* Mobile 2-column rule per PRD & DESIGN */
@media (max-width: 639px) {
  .pgrid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

.pcard {
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(16,24,40,.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pcard:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.pcard-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
}

.pcard-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #f3f4f6;
  overflow: hidden;
}

.pcard-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.pcard:hover .pcard-img {
  transform: scale(1.03);
}

.pcard-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: var(--grad);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.pcard-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.pcard-cat {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

/* 2-line clamp on title per PRD & DESIGN */
.pcard-title {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.65em;
  transition: color 0.15s ease;
}

.pcard:hover .pcard-title {
  color: var(--brand);
}

/* Rating pill: --ok bg 12% tint, green text, "★ 4.3" format per DESIGN.md */
.rating-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background-color: rgba(5, 150, 105, 0.12);
  color: var(--ok);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  line-height: 1.3;
  width: fit-content;
}

.rating-pill-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.review-count {
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 500;
}

/* Price row with current price, strike MRP, discount % */
.pcard-price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
}

.price-current {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
}

.price-mrp {
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: line-through;
}

.price-discount {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ok);
}

/* ==========================================================================
   10. SECTION HEADERS & DEALS ROW
   ========================================================================== */
.section {
  padding: 28px 0;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-title {
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  font-weight: 800;
  color: var(--ink);
}

.section-link {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.section-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   11. PRODUCT DETAIL 2-COLUMN LAYOUT (product.html)
   ========================================================================== */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin: 28px 0 48px;
}

.detail-gallery {
  position: relative;
}

.detail-img-box {
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  position: relative;
}

.detail-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-cta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.detail-info {
  display: flex;
  flex-direction: column;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.breadcrumb a:hover {
  color: var(--brand);
}

.breadcrumb-sep {
  color: var(--muted);
}

.detail-title {
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 12px;
}

.detail-rating-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.detail-price-box {
  background-color: var(--card);
  border-radius: var(--radius);
  padding: 16px 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.detail-price-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}

.detail-price-main {
  font-size: 2rem;
  font-weight: 800;
  color: var(--ink);
}

.detail-mrp {
  font-size: 1.05rem;
  color: var(--muted);
  text-decoration: line-through;
}

.detail-discount {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ok);
}

.price-subtext {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 4px;
}

/* Delivery line per PRD */
.delivery-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background-color: rgba(5, 150, 105, 0.08);
  border: 1px solid rgba(5, 150, 105, 0.2);
  border-radius: 10px;
  color: var(--ok);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.delivery-line svg {
  width: 20px;
  height: 20px;
  stroke: var(--ok);
  stroke-width: 2;
  flex-shrink: 0;
}

/* Offers list per PRD */
.offers-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.offers-title {
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.offers-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.offer-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.4;
}

.offer-tag {
  background-color: rgba(5, 150, 105, 0.12);
  color: var(--ok);
  font-weight: 700;
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Specs bullet list per PRD */
.specs-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.specs-title {
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.specs-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.spec-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
}

.spec-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--brand);
  margin-top: 8px;
  flex-shrink: 0;
}

.detail-desc {
  font-size: 0.95rem;
  color: #374151;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* ==========================================================================
   12. CART ROWS & CART LAYOUT (cart.html)
   ========================================================================== */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin: 28px 0 48px;
}

.cart-items-box {
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

.cart-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 1.15rem;
  font-weight: 700;
}

.cart-list {
  display: flex;
  flex-direction: column;
}

.cart-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-light);
  transition: background-color 0.15s ease;
}

.cart-row:last-child {
  border-bottom: none;
}

.cart-row:hover {
  background-color: #fafbfd;
}

.cart-thumb {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  object-fit: cover;
  background-color: #f3f4f6;
  border: 1px solid var(--border);
}

.cart-item-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.cart-item-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-title:hover {
  color: var(--brand);
}

.cart-item-cat {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
}

.cart-item-pricing {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
}

.cart-item-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
}

.cart-item-mrp {
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: line-through;
}

.cart-actions-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

/* Quantity control (+ / - buttons) */
.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background-color: var(--bg);
  overflow: hidden;
}

.qty-btn {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.qty-btn:hover {
  background-color: var(--border);
  color: var(--brand);
}

.qty-val {
  min-width: 32px;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0 4px;
}

.btn-remove {
  background: transparent;
  border: none;
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background-color 0.15s ease;
}

.btn-remove:hover {
  background-color: rgba(220, 38, 38, 0.08);
}

/* Empty cart state per PRD */
.cart-empty {
  text-align: center;
  padding: 64px 20px;
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.cart-empty-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
}

.cart-empty h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.cart-empty p {
  color: var(--muted);
  max-width: 400px;
  margin: 0 auto 24px;
}

/* ==========================================================================
   13. COUPON BOX (cart.html)
   ========================================================================== */
.coupon-box {
  background-color: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 20px;
}

.coupon-box-title {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.coupon-hint {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: normal;
}

.coupon-form {
  display: flex;
  gap: 8px;
}

.coupon-input {
  flex: 1;
  height: 42px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background-color: var(--bg);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.coupon-input:focus {
  background-color: #ffffff;
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.coupon-msg {
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 8px;
}

.coupon-msg.success {
  color: var(--ok);
}

.coupon-msg.error {
  color: var(--danger);
}

/* ==========================================================================
   14. PRICE SUMMARY CARD (cart.html & checkout.html)
   ========================================================================== */
.summary-card {
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 22px;
  position: sticky;
  top: 90px;
}

.summary-title {
  font-size: 1.15rem;
  font-weight: 800;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.summary-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.92rem;
  color: var(--muted);
}

.summary-row strong,
.summary-row .summary-val {
  color: var(--ink);
  font-weight: 600;
}

.summary-row.discount .summary-val {
  color: var(--ok);
  font-weight: 700;
}

.summary-row.total {
  border-top: 1px dashed var(--border);
  padding-top: 14px;
  margin-top: 6px;
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--ink);
}

.summary-row.total .summary-val {
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 800;
}

.savings-banner {
  background-color: rgba(5, 150, 105, 0.1);
  color: var(--ok);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  margin: 16px 0;
}

/* ==========================================================================
   15. CHECKOUT FORM & SUCCESS SCREEN (checkout.html)
   ========================================================================== */
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin: 28px 0 48px;
}

.form-card {
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 24px;
  margin-bottom: 20px;
}

.form-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-group {
  margin-bottom: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background-color: var(--bg);
  font-size: 0.92rem;
  color: var(--ink);
  transition: all 0.15s ease;
}

.form-textarea {
  height: 84px;
  padding: 10px 14px;
  resize: vertical;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  background-color: #ffffff;
  border-color: var(--brand);
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Payment selector radio cards */
.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.payment-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background-color: var(--bg);
  cursor: pointer;
  transition: all 0.15s ease;
}

.payment-card:hover {
  border-color: var(--brand);
}

.payment-card.active,
.payment-card:has(input:checked) {
  border-color: var(--brand);
  background-color: rgba(79, 70, 229, 0.04);
}

.payment-card input[type="radio"] {
  accent-color: var(--brand);
  width: 18px;
  height: 18px;
}

.payment-info {
  display: flex;
  flex-direction: column;
}

.payment-name {
  font-weight: 700;
  font-size: 0.92rem;
}

.payment-desc {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Order Success Screen per PRD */
.order-success-card {
  text-align: center;
  max-width: 580px;
  margin: 48px auto;
  padding: 44px 28px;
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.success-icon-badge {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background-color: rgba(5, 150, 105, 0.12);
  color: var(--ok);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin-bottom: 20px;
}

.order-success-card h1 {
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.order-id-pill {
  display: inline-block;
  background-color: var(--bg);
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand);
  margin: 18px 0;
}

/* ==========================================================================
   16. PRODUCTS CATALOG PAGE CONTROLS (products.html)
   ========================================================================== */
.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0 20px;
}

.catalog-title-wrap {
  display: flex;
  flex-direction: column;
}

.catalog-count {
  font-size: 0.88rem;
  color: var(--muted);
}

.catalog-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sort-select {
  height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background-color: var(--card);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
}

.sort-select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.no-results {
  text-align: center;
  padding: 64px 20px;
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin: 20px 0;
}

.no-results-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

/* ==========================================================================
   17. DARK COLUMN FOOTER (Per DESIGN.md: dark #111827, 3 columns -> stack)
   ========================================================================== */
.site-footer {
  background-color: #111827;
  color: #f3f4f6;
  margin-top: auto;
  padding: 56px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
  padding-bottom: 44px;
}

.footer-col h4,
.footer-title {
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.footer-col p,
.footer-desc {
  color: #9ca3af;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-link {
  color: #9ca3af;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s ease, transform 0.15s ease;
}

.footer-link:hover {
  color: #ffffff;
  transform: translateX(3px);
}

/* Footer bottom bar per DESIGN.md: "Bazaario demo — no real transactions" */
.footer-bottom {
  border-top: 1px solid #1f2937;
  padding: 22px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-bottom p {
  color: #9ca3af;
}

/* ==========================================================================
   18. ANIMATIONS & PREFERS-REDUCED-MOTION
   ========================================================================== */
/* Subtle fade-up on load (CSS only) per DESIGN.md */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-up {
  animation: fadeUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.fade-up-delay-1 { animation-delay: 0.05s; }
.fade-up-delay-2 { animation-delay: 0.10s; }
.fade-up-delay-3 { animation-delay: 0.15s; }

/* Respect prefers-reduced-motion per DESIGN.md */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .hero-shape-1,
  .hero-shape-2,
  .hero-shape-3 {
    animation: none !important;
  }
}

/* ==========================================================================
   19. RESPONSIVE BREAKPOINTS (640px / 900px / 1200px)
   ========================================================================== */

/* --- Tablet Small Breakpoint (>= 640px) --- */
@media (min-width: 640px) {
  .container {
    padding-left: 24px;
    padding-right: 24px;
  }

  .form-row {
    grid-template-columns: 1fr 1fr;
  }

  /* Grid progression 2 -> 3 columns */
  .pgrid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }

  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
  }

  .specs-list {
    grid-template-columns: 1fr 1fr;
  }
}

/* --- Tablet / Desktop Breakpoint (>= 900px) --- */
@media (min-width: 900px) {
  /* Product detail 2-column layout */
  .detail-layout {
    grid-template-columns: 460px 1fr;
    gap: 40px;
    align-items: start;
  }

  .detail-gallery {
    position: sticky;
    top: 90px;
  }

  /* Cart 2-column layout */
  .cart-layout {
    grid-template-columns: 1fr 380px;
    gap: 32px;
    align-items: start;
  }

  /* Checkout 2-column layout */
  .checkout-layout {
    grid-template-columns: 1fr 380px;
    gap: 32px;
    align-items: start;
  }

  .hero {
    padding: 64px 0;
  }
}

/* --- Large Desktop Breakpoint (>= 1200px) --- */
@media (min-width: 1200px) {
  /* Grid progression 3 -> 4 columns per PRD */
  .pgrid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }

  .detail-layout {
    grid-template-columns: 500px 1fr;
    gap: 48px;
  }
}

/* ── QA fixes (visual audit 2026-10-18) ─────────────────────────── */
html, body { overflow-x: clip; max-width: 100vw; }
.hero { overflow: hidden; }
.chips, .chip-row, .cat-chips { scrollbar-width: none; -ms-overflow-style: none; }
.chips::-webkit-scrollbar, .chip-row::-webkit-scrollbar, .cat-chips::-webkit-scrollbar { display: none; }
