/*
 * Arihant Commerce CMS — app.css
 * Base stylesheet for the storefront.
 * Extend with your brand colours and component styles.
 */

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Custom Properties ──────────────────────────────── */
:root {
  --color-primary:     #2563eb;
  --color-primary-dk:  #1d4ed8;
  --color-accent:      #f59e0b;
  --color-success:     #16a34a;
  --color-danger:      #dc2626;
  --color-warning:     #d97706;
  --color-info:        #0891b2;
  --color-text:        #1f2937;
  --color-muted:       #6b7280;
  --color-border:      #e5e7eb;
  --color-bg:          #f9fafb;
  --color-white:       #ffffff;
  --font-sans:         'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:         'JetBrains Mono', 'Fira Code', monospace;
  --radius:            0.5rem;
  --shadow-sm:         0 1px 2px rgba(0,0,0,.06);
  --shadow:            0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  --shadow-lg:         0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
  --transition:        150ms ease;
}

/* ── Base ───────────────────────────────────────────── */
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-primary-dk); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* ── Layout ─────────────────────────────────────────── */
.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 1.5rem; }
.container-sm { max-width: 640px; }
.container-md { max-width: 768px; }

/* ── Navigation ─────────────────────────────────────── */
.navbar {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 50;
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
}
.navbar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -.025em;
}
.navbar-nav { display: flex; align-items: center; gap: 1.5rem; }
.navbar-nav a {
  font-size: .9rem;
  font-weight: 500;
  color: var(--color-text);
  padding: .25rem .5rem;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
}
.navbar-nav a:hover { background: var(--color-bg); color: var(--color-primary); }
.navbar-nav a.active { color: var(--color-primary); }

/* ── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .875rem;
  font-weight: 500;
  padding: .55rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary   { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-dk); border-color: var(--color-primary-dk); color: #fff; }
.btn-outline   { background: transparent; color: var(--color-primary); border-color: var(--color-primary); }
.btn-outline:hover { background: var(--color-primary); color: #fff; }
.btn-danger    { background: var(--color-danger); color: #fff; border-color: var(--color-danger); }
.btn-success   { background: var(--color-success); color: #fff; }
.btn-sm        { font-size: .8rem; padding: .35rem .85rem; }
.btn-lg        { font-size: 1rem; padding: .75rem 1.75rem; }
.btn-block     { width: 100%; justify-content: center; }

/* ── Forms ──────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .4rem; }
.form-control {
  width: 100%;
  padding: .6rem .875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: .9rem;
  color: var(--color-text);
  background: var(--color-white);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.form-text  { font-size: .8rem; color: var(--color-muted); margin-top: .3rem; }
.form-error { font-size: .8rem; color: var(--color-danger); margin-top: .3rem; }
.form-control.is-invalid { border-color: var(--color-danger); }

/* ── Cards ──────────────────────────────────────────── */
.card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) * 1.5);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header { padding: 1rem 1.5rem; border-bottom: 1px solid var(--color-border); }
.card-body   { padding: 1.5rem; }
.card-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--color-border); background: var(--color-bg); }
.card-title  { font-size: 1.1rem; font-weight: 600; }

/* ── Alerts / Flash ─────────────────────────────────── */
.alert {
  padding: .875rem 1.25rem;
  border-radius: var(--radius);
  font-size: .9rem;
  border: 1px solid transparent;
  margin-bottom: 1rem;
}
.alert-success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.alert-error,
.alert-danger  { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.alert-warning { background: #fef9c3; color: #854d0e; border-color: #fef08a; }
.alert-info    { background: #e0f2fe; color: #075985; border-color: #bae6fd; }

/* ── Badges ─────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  padding: .2rem .6rem;
  border-radius: 9999px;
}
.badge-primary { background: #dbeafe; color: #1d4ed8; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef9c3; color: #854d0e; }

/* ── Tables ─────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { background: var(--color-bg); font-weight: 600; text-align: left; padding: .75rem 1rem; border-bottom: 2px solid var(--color-border); }
.table td { padding: .75rem 1rem; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.table tbody tr:hover { background: #f8faff; }

/* ── Pagination ─────────────────────────────────────── */
.pagination { display: flex; gap: .4rem; align-items: center; justify-content: center; }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem;
  border-radius: var(--radius);
  font-size: .875rem;
  border: 1px solid var(--color-border);
}
.pagination a:hover      { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.pagination .active span { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }

/* ── Product Grid ───────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}
.product-card { transition: transform var(--transition), box-shadow var(--transition); }
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.product-card img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.product-card .card-body { padding: 1rem; }
.product-card .price { font-size: 1.1rem; font-weight: 700; color: var(--color-primary); }
.product-card .price-original { font-size: .85rem; color: var(--color-muted); text-decoration: line-through; }

/* ── Hero ───────────────────────────────────────────── */
.hero {
  padding: 5rem 0 4rem;
  text-align: center;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.15; letter-spacing: -.03em; margin-bottom: 1rem; }
.hero p   { font-size: 1.15rem; color: var(--color-muted); max-width: 560px; margin-inline: auto; margin-bottom: 2rem; }

/* ── Footer ─────────────────────────────────────────── */
.footer {
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
  padding: 2.5rem 0;
  text-align: center;
  color: var(--color-muted);
  font-size: .875rem;
  margin-top: auto;
}

/* ── Auth Pages ─────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  padding: 2rem 1rem;
}
.auth-card { width: 100%; max-width: 440px; }
.auth-logo  { text-align: center; margin-bottom: 1.5rem; }
.auth-logo a { font-size: 1.5rem; font-weight: 800; color: var(--color-primary); }
.auth-heading { font-size: 1.5rem; font-weight: 700; margin-bottom: .35rem; }
.auth-sub     { color: var(--color-muted); font-size: .9rem; margin-bottom: 1.75rem; }

/* ── Utilities ──────────────────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--color-muted); }
.text-danger { color: var(--color-danger); }
.text-success{ color: var(--color-success); }
.mt-1 { margin-top: .25rem; } .mt-2 { margin-top: .5rem; } .mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem; }   .mt-6 { margin-top: 1.5rem; }.mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: .25rem; } .mb-2 { margin-bottom: .5rem; }
.mb-4 { margin-bottom: 1rem; }   .mb-6 { margin-bottom: 1.5rem; }
.py-4 { padding-block: 1rem; }   .py-8 { padding-block: 2rem; }
.px-4 { padding-inline: 1rem; }
.d-flex { display: flex; } .align-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-2 { gap: .5rem; } .gap-4 { gap: 1rem; }
.w-full { width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar-nav { gap: .75rem; }
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .hero { padding: 3rem 0 2.5rem; }
}
@media (max-width: 480px) {
  .products-grid { grid-template-columns: 1fr; }
  .table { display: block; overflow-x: auto; }
}
