@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ============================================================
   BACK TO BACHPAN — SHOPEASY DESIGN SYSTEM
   Blue primary · Clean white surfaces · Flat modern UI
   ============================================================ */

/* 1. ROOT TOKENS
   ---------------------------------------------------------- */
:root {
  /* Brand palette */
  --primary:        #2563eb;   /* ShopEasy Blue */
  --primary-dark:   #1d4ed8;
  --primary-light:  #3b82f6;
  --primary-soft:   #eff6ff;
  --accent:         #f59e0b;   /* Amber */
  --accent-light:   #fef3c7;
  --accent-dark:    #b45309;

  /* Neutrals */
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;
  --white:          #ffffff;

  /* Status */
  --success:        #16a34a;
  --success-soft:   #dcfce7;
  --danger:         #dc2626;
  --danger-soft:    #fee2e2;
  --warning:        #f59e0b;
  --warning-soft:   #fef3c7;
  --info:           #3b82f6;
  --info-soft:      #eff6ff;

  /* Surfaces (Flat Design) */
  --surface:           #ffffff;
  --surface-secondary: #f8fafc;
  --surface-strong:    #ffffff;
  --surface-overlay:   #ffffff;

  --border:         #e2e8f0;
  --border-soft:    #f1f5f9;
  --border-subtle:  #e2e8f0;

  /* Background */
  --background:     #f8fafc;
  --bg-gradient:    none;

  /* Radii */
  --radius-xs:      4px;
  --radius-sm:      6px;
  --radius:         8px;
  --radius-lg:      12px;
  --radius-xl:      16px;
  --radius-2xl:     24px;
  --radius-pill:    9999px;

  /* Shadows (Flat/Clean) */
  --shadow-xs:      0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm:      0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow:         0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg:      0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl:      0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-primary: 0 4px 14px 0 rgba(37, 99, 235, 0.39);
  --shadow-accent:  0 4px 14px 0 rgba(245, 158, 11, 0.39);
  --shadow-inset:   none;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  --gradient-accent:  linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);

  /* Motion */
  --transition:      all 0.2s ease-in-out;
  --transition-fast: all 0.1s ease-in-out;
  --transition-slow: all 0.3s ease-in-out;
  --ease-spring:     ease-in-out;

  /* Typography */
  --font-sans:     'Inter', system-ui, -apple-system, sans-serif;
  --container-max: 1280px;
  --header-h:      72px;

  /* Z-index system */
  --z-base:     1;
  --z-dropdown: 50;
  --z-sticky:   60;
  --z-overlay:  900;
  --z-modal:    1000;
  --z-toast:    1100;

  /* ── SEMANTIC ALIASES ──────────────────────────────── */
  --color-bg:             var(--background);
  --color-surface:        var(--surface);
  --color-card:           var(--surface);
  --color-border:         var(--border);
  --color-text:           var(--text-primary);
  --color-text-secondary: var(--text-secondary);
  --color-text-muted:     var(--text-muted);

  /* ── SPACING SCALE (0.25rem increments) ───────────── */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-7:  2rem;
  --space-8:  2.5rem;
  --space-9:  3rem;
  --space-10: 4rem;
  --space-11: 5rem;
  --space-12: 6rem;

  --space-section: 72px;
  --space-section-mobile: 48px;
}

/* 2. CSS RESET & BASE
   ---------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Background & ambient canvas ── */
html {
  font-family: var(--font-sans);
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--background);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

img, picture, video, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}
a:hover { color: var(--primary-dark); }

ul, ol { list-style: none; }

/* 3. TYPOGRAPHY
   ---------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.875rem, 1.4rem + 2.3vw, 3.25rem); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.375rem, 1.1rem + 1.3vw, 2rem); }
h3 { font-size: clamp(1.125rem, 0.95rem + 0.9vw, 1.5rem); }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; font-weight: 600; }
h6 { font-size: 0.875rem; font-weight: 600; }

p { color: var(--text-secondary); line-height: 1.7; }
small { font-size: 0.875rem; }

/* 4. GLASS UTILITIES
   ---------------------------------------------------------- */
 {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid rgba(255, 255, 255, 0.80);
  box-shadow: 0 4px 24px rgba(79, 70, 229, 0.06), 0 1px 0 rgba(255,255,255,0.9) inset;
  border-radius: var(--radius-lg);
}

 {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(var(--glass-blur-sm)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur-sm)) saturate(var(--glass-saturate));
  border: 1px solid rgba(255, 255, 255, 0.60);
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  border-radius: var(--radius-lg);
}

 {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 32px rgba(79, 70, 229, 0.08), 0 1px 0 rgba(255,255,255,1) inset;
  border-radius: var(--radius-xl);
}

/* Fallback for browsers without backdrop-filter */
@supports not (backdrop-filter: blur(1px)) {
           { background: rgba(255, 255, 255, 0.96); }
  { background: rgba(255, 255, 255, 0.90); }
    { background: #fff; }
}

/* 5. TEXT UTILITIES
   ---------------------------------------------------------- */
.text-primary   { color: var(--primary) !important; }
.text-accent    { color: var(--accent) !important; }
.text-dark      { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-success   { color: var(--success) !important; }
.text-danger    { color: var(--danger) !important; }
.text-warning   { color: var(--warning) !important; }
.text-white     { color: var(--white) !important; }
.text-center    { text-align: center; }
.text-left      { text-align: left; }
.text-right     { text-align: right; }

.text-xs   { font-size: 0.75rem;  line-height: 1.4; }
.text-sm   { font-size: 0.875rem; line-height: 1.5; }
.text-base { font-size: 1rem;     line-height: 1.5; }
.text-lg   { font-size: 1.125rem; line-height: 1.5; }
.text-xl   { font-size: 1.25rem;  line-height: 1.4; }
.text-2xl  { font-size: 1.5rem;   line-height: 1.3; }
.text-3xl  { font-size: 1.875rem; line-height: 1.2; }

.font-bold     { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium   { font-weight: 500; }
.font-normal   { font-weight: 400; }

.uppercase     { text-transform: uppercase; }
.truncate      { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-through  { text-decoration: line-through; }
.leading-relaxed { line-height: 1.75; }

/* 6. SPACING UTILITIES
   ---------------------------------------------------------- */
.m-0  { margin: 0; }
.mt-0 { margin-top: 0;        } .mb-0 { margin-bottom: 0;        }
.mt-1 { margin-top: 0.25rem;  } .mb-1 { margin-bottom: 0.25rem;  }
.mt-2 { margin-top: 0.5rem;   } .mb-2 { margin-bottom: 0.5rem;   }
.mt-3 { margin-top: 1rem;     } .mb-3 { margin-bottom: 1rem;     }
.mt-4 { margin-top: 1.5rem;   } .mb-4 { margin-bottom: 1.5rem;   }
.mt-5 { margin-top: 3rem;     } .mb-5 { margin-bottom: 3rem;     }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.ml-1 { margin-left: 0.25rem; } .mr-1 { margin-right: 0.25rem; }
.ml-2 { margin-left: 0.5rem;  } .mr-2 { margin-right: 0.5rem;  }
.ml-3 { margin-left: 1rem;    } .mr-3 { margin-right: 1rem;    }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem;  }
.p-3 { padding: 1rem;    }
.p-4 { padding: 1.5rem;  }
.p-5 { padding: 3rem;    }
.p-6 { padding: 4rem;    }

.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2 { padding-left: 0.5rem;  padding-right: 0.5rem;  }
.px-3 { padding-left: 1rem;    padding-right: 1rem;    }
.px-4 { padding-left: 1.5rem;  padding-right: 1.5rem;  }
.px-6 { padding-left: 2rem;    padding-right: 2rem;    }
.px-8 { padding-left: 2.5rem;  padding-right: 2.5rem;  }

.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem;  padding-bottom: 0.5rem;  }
.py-3 { padding-top: 1rem;    padding-bottom: 1rem;    }
.py-4 { padding-top: 1.5rem;  padding-bottom: 1.5rem;  }
.py-5 { padding-top: 3rem;    padding-bottom: 3rem;    }
.py-6 { padding-top: 4rem;    padding-bottom: 4rem;    }

.pt-3 { padding-top: 1rem; }
.pt-4 { padding-top: 1.5rem; }
.pt-5 { padding-top: 3rem; }
.pb-3 { padding-bottom: 1rem; }
.pb-4 { padding-bottom: 1.5rem; }

/* 7. LAYOUT & GRID
   ---------------------------------------------------------- */
.container {
  width: min(100% - 32px, var(--container-max));
  margin-inline: auto;
  padding: 0;
}
@media (min-width: 768px) {
  .container {
    width: min(100% - 48px, var(--container-max));
  }
}
@media (min-width: 1200px) {
  .container {
    width: min(100% - 64px, var(--container-max));
  }
}

.section-spacing {
  padding-top: var(--space-section-mobile);
  padding-bottom: var(--space-section-mobile);
}
@media (min-width: 768px) {
  .section-spacing {
    padding-top: var(--space-section);
    padding-bottom: var(--space-section);
  }
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }
}
@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
  }
}

.flex             { display: flex;                    }
.inline-flex      { display: inline-flex;             }
.flex-col         { flex-direction: column;           }
.flex-wrap        { flex-wrap: wrap;                  }
.flex-1           { flex: 1;                          }
.flex-shrink-0    { flex-shrink: 0;                   }
.items-center     { align-items: center;              }
.items-start      { align-items: flex-start;          }
.items-end        { align-items: flex-end;            }
.justify-between  { justify-content: space-between;   }
.justify-center   { justify-content: center;          }
.justify-end      { justify-content: flex-end;        }
.gap-0  { gap: 0; }
.gap-1  { gap: 0.5rem;  }
.gap-2  { gap: 1rem;    }
.gap-3  { gap: 1.5rem;  }
.gap-4  { gap: 2rem;    }
.gap-5  { gap: 2.5rem;  }

.grid               { display: grid; }
.grid-cols-1        { grid-template-columns: 1fr; }
.grid-cols-2        { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3        { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4        { grid-template-columns: repeat(4, 1fr); }
.grid-cols-auto-fit { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.col-span-full      { grid-column: 1 / -1; }

.w-full    { width: 100%; }
.h-full    { height: 100%; }
.min-h-screen { min-height: 100vh; }

.relative  { position: relative; }
.absolute  { position: absolute; }
.fixed     { position: fixed; }
.sticky    { position: sticky; }

.inset-0   { top: 0; right: 0; bottom: 0; left: 0; }
.top-0     { top: 0; }
.right-0   { right: 0; }
.bottom-0  { bottom: 0; }
.left-0    { left: 0; }

.overflow-hidden   { overflow: hidden; }
.overflow-x-auto   { overflow-x: auto; }
.overflow-y-auto   { overflow-y: auto; }

.hidden    { display: none !important; }
.block     { display: block; }
.inline    { display: inline; }

.cursor-pointer { cursor: pointer; }
.select-none    { user-select: none; }
.pointer-events-none { pointer-events: none; }

.opacity-0   { opacity: 0; }
.opacity-50  { opacity: 0.5; }
.opacity-100 { opacity: 1; }

/* Display helpers */
.d-none         { display: none !important; }
.d-block        { display: block; }
.d-flex         { display: flex; }
.d-md-inline    { display: none; }
.d-md-block     { display: none; }
.d-md-flex      { display: none; }
@media (min-width: 768px) {
  .d-md-inline  { display: inline; }
  .d-md-block   { display: block; }
  .d-md-flex    { display: flex; }
  .d-md-none    { display: none !important; }
}

/* Borders */
.border-bottom  { border-bottom: 1px solid var(--border-soft); }
.border-top     { border-top: 1px solid var(--border-soft); }
.rounded        { border-radius: var(--radius); }
.rounded-full   { border-radius: var(--radius-pill); }
.rounded-xl     { border-radius: var(--radius-xl); }

/* Background helpers */
.bg-white       { background: #fff; }
.bg-surface     { background: var(--surface); }

/* 8. SKELETON LOADERS
   ---------------------------------------------------------- */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: var(--radius);
}

.skeleton-card {
  background: var(--surface-strong);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.skeleton-image {
  aspect-ratio: 1;
  width: 100%;
}

.skeleton-line {
  height: 14px;
  margin-bottom: 10px;
  border-radius: var(--radius-sm);
}

.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-line.full { width: 100%; }

/* 9. STATUS BADGES
   ---------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.badge-primary  { background: var(--primary-soft);   color: var(--primary-dark); }
.badge-success  { background: var(--success-soft);   color: var(--success); }
.badge-danger   { background: var(--danger-soft);    color: var(--danger); }
.badge-warning  { background: var(--warning-soft);   color: var(--accent-dark); }
.badge-muted    { background: rgba(0,0,0,0.06);      color: var(--text-secondary); }
.badge-accent   { background: var(--accent-light);   color: var(--accent-dark); }

/* 10. RESPONSIVE GRID
   ---------------------------------------------------------- */
@media (max-width: 1024px) {
  .lg\:grid-cols-3 { grid-template-columns: repeat(2, 1fr); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .md\:hidden       { display: none !important; }
  .md\:block        { display: block; }
  .md\:grid-cols-1  { grid-template-columns: 1fr !important; }
  .md\:grid-cols-2  { grid-template-columns: repeat(2, 1fr) !important; }
  .grid-cols-3, .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .sm\:grid-cols-1  { grid-template-columns: 1fr !important; }
  .sm\:grid-cols-2  { grid-template-columns: repeat(2, 1fr) !important; }
}

/* 11. SCROLL REVEAL ANIMATIONS
   ---------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-fade {
  opacity: 0;
  transition: opacity 0.6s ease;
}
.reveal-fade.visible {
  opacity: 1;
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }

/* Respect user motion preference */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-fade,
  .reveal-scale {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
