/* ============================================================
   QuickMart Online — storefront styles
   Palette: ink #0B1220, navy #10192E, blue #3B6EF5, amber #FFB020,
            mint #16C79A, paper #F6F7FB, slate #64748B
   Type: Space Grotesk (display) / Inter (body)
   ============================================================ */

:root {
  --ink: #0B1220;
  --navy: #10192E;
  --navy-soft: #17233F;
  --blue: #3B6EF5;
  --blue-dark: #2952C8;
  --amber: #FFB020;
  --mint: #16C79A;
  --paper: #F6F7FB;
  --white: #FFFFFF;
  --slate: #64748B;
  --slate-light: #A7B0C0;
  --border: #E4E7F0;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(11, 18, 32, 0.08);
  --shadow-sm: 0 2px 8px rgba(11, 18, 32, 0.06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, Segoe UI, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
}

h1, h2, h3, h4, .display {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  font-family: inherit;
}
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--blue-dark); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-amber { background: var(--amber); color: var(--ink); }
.btn-amber:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-ghost { background: transparent; color: var(--white); border: 1.5px solid rgba(255,255,255,0.35); }
.btn-ghost:hover { border-color: var(--white); }
.btn-outline { background: transparent; color: var(--ink); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Header ---------- */

.site-header {
  background: var(--ink);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-top {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 16px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--white);
  white-space: nowrap;
}
.logo .bolt { color: var(--amber); }
.logo small {
  display: block;
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate-light);
}

.search-wrap { flex: 1; max-width: 480px; position: relative; }

.search-form {
  display: flex;
  width: 100%;
}
.search-form input {
  flex: 1;
  border: none;
  border-radius: 999px 0 0 999px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 0.9rem;
}
.search-form button {
  border: none;
  border-radius: 0 999px 999px 0;
  background: var(--blue);
  color: var(--white);
  padding: 0 18px;
  cursor: pointer;
}

.header-actions { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.cart-link { position: relative; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.cart-badge {
  background: var(--amber);
  color: var(--ink);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  position: absolute;
  top: -8px;
  right: -14px;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--white);
  color: var(--ink);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 60;
  max-height: 400px;
  overflow-y: auto;
}
.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.search-result:hover { background: var(--paper); }
.search-result img { width: 40px; height: 40px; object-fit: contain; background: var(--paper); border-radius: 8px; flex-shrink: 0; }
.sr-info { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.sr-name { font-size: 0.87rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-cat { font-size: 0.75rem; color: var(--slate); }
.sr-price { font-size: 0.85rem; font-weight: 700; white-space: nowrap; }
.search-empty { padding: 16px; font-size: 0.85rem; color: var(--slate); text-align: center; }
.search-viewall { display: block; text-align: center; padding: 10px; font-size: 0.85rem; font-weight: 600; color: var(--blue); background: var(--paper); }

.nav-strip {
  background: var(--navy);
  border-top: 1px solid rgba(255,255,255,0.06);
}
.nav-strip ul { display: flex; gap: 4px; overflow-x: auto; padding: 10px 0; }
.nav-strip a {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--slate-light);
  white-space: nowrap;
}
.nav-strip a:hover, .nav-strip a.active { background: rgba(59,110,245,0.18); color: var(--white); }

/* ---------- Hero slider ---------- */

.hero-slider {
  position: relative;
  overflow: hidden;
  color: var(--white);
}
.hero-slides { position: relative; height: 460px; }
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease;
  background-size: cover;
  background-position: center;
}
.hero-slide.active { opacity: 1; visibility: visible; }
.hero-slide-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-slide-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 560px;
}
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,176,32,0.14);
  color: var(--amber);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 18px;
  width: fit-content;
}
.hero-slide h1 { font-size: clamp(2rem, 4vw, 2.9rem); }
.hero-slide p { color: var(--slate-light); max-width: 440px; font-size: 1.05rem; margin-bottom: 28px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-dots {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  gap: 8px;
}
.hero-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: rgba(255,255,255,0.35);
  border: none; cursor: pointer; padding: 0;
  transition: background 0.2s ease, width 0.2s ease;
}
.hero-dot.active { background: var(--amber); width: 22px; border-radius: 5px; }

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(11,18,32,0.4);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease;
}
.hero-arrow:hover { background: rgba(11,18,32,0.65); }
.hero-arrow.prev { left: 20px; }
.hero-arrow.next { right: 20px; }

@media (max-width: 900px) {
  .hero-slides { height: 420px; }
  .hero-arrow { display: none; }
}
@media (max-width: 560px) {
  .hero-slides { height: 460px; }
}

/* ---------- Trust badges ---------- */

.trust-strip { background: var(--white); border-bottom: 1px solid var(--border); }
.trust-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; padding: 22px 0; }
.trust-item { display: flex; align-items: center; gap: 12px; }
.trust-item .icon { width: 38px; height: 38px; flex-shrink: 0; color: var(--blue); background: rgba(59,110,245,0.1); border-radius: 10px; display:flex; align-items:center; justify-content:center; }
.trust-item .icon svg { width: 20px; height: 20px; }
.trust-item .label { font-weight: 700; font-size: 0.85rem; }
.trust-item .sub { font-size: 0.76rem; color: var(--slate); }

/* ---------- Shop by category (large tiles) ---------- */

.cat-tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.cat-tile {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/5;
  color: var(--white);
  display: flex;
  align-items: flex-end;
  padding: 16px;
  background: linear-gradient(160deg, var(--navy), #1B2A4A);
  transition: transform 0.15s ease;
}
.cat-tile:hover { transform: translateY(-3px); }
.cat-tile .tile-icon { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; opacity: 0.85; }
.cat-tile .tile-glow {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(59,110,245,0.5), transparent 60%);
}
.cat-tile .tile-name { position: relative; font-weight: 700; font-size: 0.95rem; }
.cat-tile .tile-count { position: relative; font-size: 0.75rem; color: var(--slate-light); }

/* ---------- Category strip ---------- */

.category-strip { padding: 48px 0 8px; }
.category-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.category-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 14px;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.category-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: transparent; }
.category-card .icon { width: 40px; height: 40px; margin: 0 auto 10px; color: var(--blue); }
.category-card .name { font-weight: 600; font-size: 0.88rem; }

/* ---------- Section headers ---------- */

.section { padding: 44px 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
}
.section-head h2 { font-size: 1.5rem; }
.section-head .sub { color: var(--slate); font-size: 0.9rem; }
.section-head a { color: var(--blue); font-weight: 600; font-size: 0.9rem; }

/* ---------- Product grid & cards ---------- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.product-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.product-thumb {
  aspect-ratio: 1 / 1;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}
.product-thumb img { width: 100%; height: 100%; object-fit: contain; }
.product-body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-cat { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--slate); }
.product-name { font-weight: 600; font-size: 0.98rem; }
.product-price { margin-top: auto; display: flex; align-items: center; gap: 8px; padding-top: 8px; }
.price-now { font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.price-was { color: var(--slate); text-decoration: line-through; font-size: 0.85rem; }
.badge-sale {
  position: absolute;
  top: 12px;
  left: -30px;
  background: var(--amber);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 34px;
  transform: rotate(-38deg);
}
.product-actions { padding: 0 16px 16px; }

/* ---------- Product detail ---------- */

.breadcrumbs { font-size: 0.85rem; color: var(--slate); margin-bottom: 18px; }
.breadcrumbs a:hover { color: var(--blue); }
.product-detail { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 44px; align-items: start; }
.product-detail .product-thumb { border-radius: var(--radius); border: 1px solid var(--border); aspect-ratio: 1/1; padding: 40px; }
.product-detail h1 { font-size: 1.8rem; }
.stock-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; font-weight: 600; color: var(--mint);
  background: rgba(22,199,154,0.12); padding: 4px 12px; border-radius: 999px;
  margin: 10px 0 18px;
}
.qty-row { display: flex; align-items: center; gap: 14px; margin: 20px 0; }
.qty-input {
  width: 70px; padding: 10px; border-radius: 8px; border: 1px solid var(--border);
  font-family: inherit; text-align: center;
}

/* ---------- Cart & checkout ---------- */

.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { text-align: left; font-size: 0.78rem; text-transform: uppercase; color: var(--slate); padding: 10px 8px; border-bottom: 1px solid var(--border); }
.cart-table td { padding: 14px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.cart-row-product { display: flex; align-items: center; gap: 14px; }
.cart-row-product img { width: 56px; height: 56px; object-fit: contain; background: var(--paper); border-radius: 8px; padding: 6px; }
.cart-summary {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; position: sticky; top: 100px;
}
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; color: var(--slate); }
.summary-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 1.15rem; padding-top: 12px; border-top: 1px solid var(--border); }
.empty-state { text-align: center; padding: 70px 20px; color: var(--slate); }
.empty-state .icon { width: 64px; height: 64px; margin: 0 auto 16px; color: var(--slate-light); }

.cms-page h1, .cms-page h2, .cms-page h3 { margin-top: 1.2em; }
.cms-page p { margin: 0 0 1em; color: var(--ink); }
.cms-page ul, .cms-page ol { margin: 0 0 1em; padding-left: 1.4em; }
.cms-page img { border-radius: 10px; margin: 1em 0; }
.cms-page a { color: var(--blue); text-decoration: underline; }

.checkout-grid { display: grid; grid-template-columns: 1fr 0.85fr; gap: 40px; align-items: start; }
.form-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.form-row input, .form-row textarea, .form-row select {
  width: 100%; padding: 11px 13px; border-radius: 8px; border: 1px solid var(--border);
  font-family: inherit; font-size: 0.92rem;
}
.form-row textarea { resize: vertical; min-height: 80px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- Alerts ---------- */

.alert { padding: 12px 16px; border-radius: 10px; font-size: 0.9rem; margin-bottom: 20px; }
.alert-success { background: rgba(22,199,154,0.12); color: #0d7a5f; }
.alert-error { background: rgba(240,84,84,0.1); color: #c0392b; }

/* ---------- Footer ---------- */

.site-footer { background: var(--ink); color: var(--slate-light); margin-top: 60px; padding: 48px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.footer-grid h4 { color: var(--white); font-size: 0.9rem; margin-bottom: 14px; }
.footer-grid a { display: block; padding: 4px 0; font-size: 0.88rem; }
.footer-grid a:hover { color: var(--white); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 20px; font-size: 0.8rem; text-align: center; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-bolt { display: none; }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .product-detail { grid-template-columns: 1fr; }
  .checkout-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .search-form { display: none; }
}
@media (max-width: 560px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: 1fr 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
