/* ==========================================================
   EVMARKET — storefront styles (Rivian-inspired design)
   ========================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Noto+Sans+Georgian:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f2f1ee;
  --bg-2: #e9e7e2;
  --surface: #ffffff;
  --text: #121212;
  --muted: #6b6b6b;
  --line: #e3e1dc;
  --dark: #151515;
  --dark-2: #1f1f1f;
  --accent: #f4c542;
  --accent-hover: #ffd35c;
  --danger: #d64545;
  --ok: #2f9e5f;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.06);
  --header-h: 64px;
  --font: 'Inter', 'Noto Sans Georgian', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --container: 1280px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
p { margin: 0; }
.container { width: min(var(--container), calc(100% - 32px)); margin: 0 auto; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 600; font-size: 15px; cursor: pointer; transition: all .18s ease; white-space: nowrap;
  background: var(--dark); color: #fff;
}
.btn:hover { background: #000; transform: translateY(-1px); }
.btn-accent { background: var(--accent); color: var(--text); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-ghost { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.55); backdrop-filter: blur(8px); }
.btn-ghost:hover { background: rgba(255,255,255,.26); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--text); }
.btn-outline:hover { background: var(--text); color: #fff; }
.btn-light { background: #fff; color: var(--text); }
.btn-light:hover { background: #f4f4f4; }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-lg { padding: 15px 30px; font-size: 16px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- Header ---------- */
.header {
  position: fixed; top: 12px; left: 12px; right: 12px; z-index: 50;
  height: var(--header-h); background: rgba(255,255,255,.96); backdrop-filter: blur(12px);
  border-radius: 14px; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; padding: 0 20px 0 24px; gap: 24px;
}
.header .logo { font-weight: 800; letter-spacing: .28em; font-size: 17px; text-transform: uppercase; display: flex; align-items: center; gap: 10px; }
.header .logo .bolt { width: 22px; height: 22px; background: var(--accent); border-radius: 6px; display: grid; place-items: center; }
.header .logo .bolt svg { width: 14px; height: 14px; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { padding: 8px 12px; border-radius: 999px; font-weight: 500; font-size: 14px; color: #333; transition: background .15s; white-space: nowrap; }
.nav a:hover, .nav a.active { background: var(--bg-2); color: var(--text); }
.header .spacer { flex: 1; }
.header .actions { display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: var(--bg-2); }
.icon-btn svg { width: 20px; height: 20px; }
.burger { display: none; }
.mobile-nav { display: none; position: fixed; top: calc(var(--header-h) + 20px); left: 12px; right: 12px; background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 12px; z-index: 49; flex-direction: column; }
.mobile-nav a { padding: 12px 14px; border-radius: 10px; font-weight: 500; }
.mobile-nav a:hover { background: var(--bg-2); }
.mobile-nav.open { display: flex; }

main { padding-top: 0; }
.page { padding-top: calc(var(--header-h) + 40px); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 88vh; display: flex; align-items: center;
  background: var(--dark) center/cover no-repeat; color: #fff; overflow: hidden;
}
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.6) 0%, rgba(0,0,0,.25) 55%, rgba(0,0,0,0) 100%); }
.hero .container { position: relative; z-index: 1; padding-top: calc(var(--header-h) + 48px); padding-bottom: 48px; }
.hero h1 { font-size: clamp(40px, 6.5vw, 84px); font-weight: 700; max-width: 12ch; line-height: 1.02; }
.hero p { font-size: clamp(16px, 1.6vw, 20px); max-width: 52ch; margin: 22px 0 32px; color: rgba(255,255,255,.88); }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .stats { display: flex; gap: 36px; margin-top: 48px; flex-wrap: wrap; }
.hero .stat b { display: block; font-size: 32px; font-weight: 700; letter-spacing: -0.02em; }
.hero .stat span { font-size: 14px; color: rgba(255,255,255,.75); }

/* ---------- Showcase sections (R1S / R2 style) ---------- */
.showcase { position: relative; overflow: hidden; padding: 96px 0 72px; background: var(--bg); }
.showcase.alt { background: var(--bg-2); }
.showcase.dark { background: var(--dark); color: #fff; }
.showcase .backdrop {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%);
  font-size: clamp(120px, 24vw, 360px); font-weight: 800; letter-spacing: -0.05em; line-height: 1;
  color: var(--text); opacity: .07; white-space: nowrap; pointer-events: none; user-select: none;
}
.showcase.dark .backdrop { color: #fff; opacity: .06; }
.showcase .container { position: relative; z-index: 1; }
.showcase .visual { margin: 40px auto 36px; max-width: 980px; border-radius: 28px; overflow: hidden; box-shadow: var(--shadow); }
.showcase .visual img { width: 100%; aspect-ratio: 16/8.5; object-fit: cover; }
.showcase .text { text-align: center; max-width: 720px; margin: 0 auto; }
.showcase .eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.showcase.dark .eyebrow { color: rgba(255,255,255,.6); }
.showcase h2 { font-size: clamp(28px, 4vw, 48px); margin-top: 8px; }
.showcase .lead { font-size: 18px; margin: 14px auto 0; color: var(--muted); max-width: 52ch; }
.showcase.dark .lead { color: rgba(255,255,255,.7); }
.showcase .cta { display: flex; gap: 12px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.showcase .mini-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 44px; }

/* ---------- Brand strip ---------- */
.brand-strip { background: var(--dark); color: #fff; padding: 56px 0; }
.brand-strip .row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.brand-strip a { padding: 16px 32px; border-radius: 999px; border: 1px solid rgba(255,255,255,.2); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 14px; transition: all .15s; }
.brand-strip a:hover { background: #fff; color: var(--text); }
.brand-strip h3 { text-align: center; font-size: 14px; letter-spacing: .2em; text-transform: uppercase; color: rgba(255,255,255,.55); margin-bottom: 24px; font-weight: 600; }

/* ---------- Feature tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 72px 0; }
.tile { background: var(--surface); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow-sm); }
.tile .ico { width: 46px; height: 46px; border-radius: 12px; background: var(--accent); display: grid; place-items: center; margin-bottom: 18px; }
.tile .ico svg { width: 22px; height: 22px; }
.tile h3 { font-size: 20px; margin-bottom: 8px; }
.tile p { color: var(--muted); font-size: 15px; }

/* ---------- Catalog layout ---------- */
.catalog-hero { background: var(--dark) center/cover no-repeat; color: #fff; padding: calc(var(--header-h) + 80px) 0 60px; position: relative; }
.catalog-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.65)); }
.catalog-hero .container { position: relative; z-index: 1; }
.catalog-hero h1 { font-size: clamp(34px, 5vw, 62px); }
.catalog-hero p { margin-top: 12px; color: rgba(255,255,255,.8); max-width: 60ch; font-size: 17px; }
.catalog { display: grid; grid-template-columns: 290px 1fr; gap: 28px; padding: 36px 0 80px; align-items: start; }
.filters { background: var(--surface); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); position: sticky; top: calc(var(--header-h) + 24px); }
.filters h3 { font-size: 16px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
.filters h3 button { border: 0; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; text-decoration: underline; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.field select, .field input, .field textarea {
  width: 100%; padding: 11px 14px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; outline: none; transition: border .15s;
}
.field select:focus, .field input:focus, .field textarea:focus { border-color: var(--text); }
.field .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-size: 14px; cursor: pointer; transition: all .15s; }
.chip:hover { border-color: var(--text); }
.chip.active { background: var(--text); color: #fff; border-color: var(--text); }
.cat-list { display: flex; flex-direction: column; gap: 2px; max-height: 420px; overflow: auto; }
.cat-list button { text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; display: flex; justify-content: space-between; }
.cat-list button:hover { background: var(--bg); }
.cat-list button.active { background: var(--text); color: #fff; }
.cat-list .sub { padding-left: 24px; font-size: 13px; color: var(--muted); }
.cat-list .sub.active { color: #fff; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar .count { color: var(--muted); font-size: 15px; }
.toolbar select { padding: 9px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; }
.filters-toggle { display: none; }

/* ---------- Cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card .media { position: relative; aspect-ratio: 4/3; background: var(--bg-2); overflow: hidden; }
.card .media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .media img { transform: scale(1.04); }
.card .badges { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.badge { padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: rgba(255,255,255,.92); color: var(--text); backdrop-filter: blur(6px); }
.badge.dark { background: rgba(20,20,20,.85); color: #fff; }
.badge.accent { background: var(--accent); }
.badge.ok { background: #dff5e7; color: #1b6b3d; }
.badge.warn { background: #fdecc8; color: #7a4c00; }
.badge.danger { background: #fbdcdc; color: #8a1f1f; }
.card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.card h3 { font-size: 17px; line-height: 1.3; }
.card .specs { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 2px; }
.card .specs span::before { content: '•'; margin-right: 6px; opacity: .5; }
.card .specs span:first-child::before { content: ''; margin: 0; }
.card .price { margin-top: auto; padding-top: 12px; display: flex; justify-content: space-between; align-items: center; }
.card .price b { font-size: 20px; letter-spacing: -0.02em; }
.card .price .arrow { width: 36px; height: 36px; border-radius: 50%; background: var(--text); color: #fff; display: grid; place-items: center; }
.empty { grid-column: 1/-1; text-align: center; padding: 60px 20px; color: var(--muted); background: var(--surface); border-radius: var(--radius); }
.skeleton { background: linear-gradient(90deg, #ececea 25%, #f6f6f4 50%, #ececea 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); min-height: 300px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Detail page ---------- */
.detail { padding: calc(var(--header-h) + 48px) 0 80px; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 20px; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.detail-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 36px; align-items: start; }
.gallery .main { border-radius: 24px; overflow: hidden; background: var(--bg-2); aspect-ratio: 4/3; box-shadow: var(--shadow-sm); }
.gallery .main img { width: 100%; height: 100%; object-fit: cover; }
.gallery .thumbs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-top: 12px; }
.gallery .thumbs button { border: 2px solid transparent; border-radius: 12px; overflow: hidden; padding: 0; background: var(--bg-2); aspect-ratio: 4/3; cursor: pointer; }
.gallery .thumbs button.active { border-color: var(--text); }
.gallery .thumbs img { width: 100%; height: 100%; object-fit: cover; }
.info { background: var(--surface); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); position: sticky; top: calc(var(--header-h) + 24px); }
.info .kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; }
.info h1 { font-size: clamp(24px, 3vw, 34px); margin: 8px 0 14px; }
.info .price { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; }
.info .price small { font-size: 15px; color: var(--muted); font-weight: 500; margin-left: 8px; }
.spec-table { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; margin: 22px 0; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.spec-table div span { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.spec-table div b { font-weight: 600; font-size: 15px; }
.info .cta { display: flex; flex-direction: column; gap: 10px; }
.desc { margin-top: 36px; background: var(--surface); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); }
.desc h2 { font-size: 20px; margin-bottom: 12px; }
.desc p { white-space: pre-line; color: #333; }
.related { margin-top: 56px; }
.related h2 { font-size: 26px; margin-bottom: 20px; }

/* ---------- Contact / simple pages ---------- */
.simple { padding: calc(var(--header-h) + 60px) 0 80px; }
.simple h1 { font-size: clamp(32px, 5vw, 56px); margin-bottom: 16px; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 36px; }
.contact-card { background: var(--surface); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); }
.contact-card h3 { font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.contact-card p { font-size: 20px; font-weight: 600; }

/* ---------- Footer ---------- */
.footer { background: var(--dark); color: #fff; padding: 72px 0 32px; margin-top: 0; }
.footer .top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer .big a { display: block; font-size: clamp(26px, 3vw, 38px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; color: #fff; transition: color .15s; }
.footer .big a:hover { color: var(--accent); }
.footer h4 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.5); margin-bottom: 14px; font-weight: 600; }
.footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer ul a { color: rgba(255,255,255,.85); font-size: 15px; }
.footer ul a:hover { color: #fff; text-decoration: underline; }
.footer .bottom { margin-top: 56px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.12); display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: rgba(255,255,255,.5); flex-wrap: wrap; gap: 12px; }
.footer .logo { font-weight: 800; letter-spacing: .28em; text-transform: uppercase; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .showcase .mini-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .info { position: static; }
  .footer .top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1100px) {
  .nav { display: none; }
  .burger { display: grid; }
}
@media (max-width: 860px) {
  .catalog { grid-template-columns: 1fr; }
  .filters { position: static; display: none; }
  .filters.open { display: block; }
  .filters-toggle { display: inline-flex; }
  .hero { min-height: 78vh; }
  .hero .stats { gap: 22px; }
  .tiles { grid-template-columns: 1fr; padding: 48px 0; }
  .contact-grid { grid-template-columns: 1fr; }
  .gallery .thumbs { grid-template-columns: repeat(4, 1fr); }
  .header { left: 8px; right: 8px; top: 8px; padding: 0 12px 0 16px; }
  .header .actions .btn { display: none; }
  .showcase { padding: 64px 0 48px; }
  .spec-table { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
  .footer .top { grid-template-columns: 1fr; }
  .field .row2 { grid-template-columns: 1fr; }
}
