/* LML Studio Store — launchmodelive.com v0.3 */

/*
  Brand palette pulled from Launch Mode Live racing banners:
  - deep black background
  - vivid red #e6243f accent
  - warm white / muted gray text
  - clipped-parallelogram buttons inspired by drift/racing livery
*/

:root {
  --bg: #050507;
  --panel: rgba(12, 14, 20, 0.94);
  --ink: #f6f7fb;
  --muted: #a0a8b7;
  --accent: #e6243f;
  --accent-2: #ff4d4d;
  --accent-dark: #7a0f20;
  --gold: #ffd700;
  --green: #00ff41;
  --dark-card: #0d1017;
  --line: rgba(255, 255, 255, 0.14);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 45, 85, 0.08), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Views ── */
.view { display: block; }
.view[hidden] { display: none; }

/* ── Header ── */
.store-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  background: rgba(5, 5, 7, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(230, 36, 63, 0.25);
}

.header-actions {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.nav-toggle {
  display: none;
  min-height: 44px;
  min-width: 44px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: var(--dark-card);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.store-header h1 { font-size: 18px; letter-spacing: -0.02em; }

.top-brand-banner {
  position: relative;
  z-index: 5;
  padding: 8px 18px 10px;
  background: linear-gradient(180deg, rgba(230, 36, 63, 0.15), transparent);
}
.top-brand-banner img {
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 10px;
  font-weight: 900;
  margin: 0 0 4px;
}

.cart-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(145deg, rgba(230, 36, 63, 0.25), rgba(13, 16, 23, 0.92));
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  clip-path: polygon(9px 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
  transition: transform 0.15s, border-color 0.15s;
}
.cart-btn:hover {
  border-color: var(--accent-2);
  transform: translateY(-1px);
}

.cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

/* ── Navigation ── */
.store-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 28px;
  background: rgba(10, 12, 18, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.store-nav[hidden] { display: none; }

.nav-link {
  padding: 8px 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  border: 1px solid transparent;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.nav-link:hover {
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
}
.nav-link.active {
  color: #fff;
  border-color: rgba(230, 36, 63, 0.8);
  background: rgba(230, 36, 63, 0.18);
}

.nav-spacer { flex: 1; }

.nav-cart { margin-left: auto; }

.nav-cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  vertical-align: middle;
  margin-left: 4px;
}

/* ── Home page ── */
.view-home {
  position: relative;
  padding-bottom: 30px;
}

.hero-image-wrap {
  position: relative;
  max-width: 1250px;
  margin: 14px auto 0;
  padding: 0 20px;
}
.hero-image {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.55);
}
.hero-image-shade {
  position: absolute;
  inset: 0 20px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(5, 5, 7, 0.08), rgba(5, 5, 7, 0.78));
  pointer-events: none;
}

.home-hero {
  text-align: center;
  margin: -54px auto 0;
  padding: 26px 24px 0;
  max-width: 740px;
  position: relative;
  z-index: 2;
}
.home-kicker {
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 11px;
  font-weight: 900;
  margin-bottom: 8px;
}
.home-hero h2 {
  font-size: 44px;
  letter-spacing: -0.035em;
  margin-bottom: 12px;
  text-transform: uppercase;
}
.home-hero p {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 26px;
}

.cta-button {
  display: inline-block;
  padding: 14px 38px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
  transition: transform 0.15s, filter 0.15s;
}
.cta-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

/* ── Category title ── */
.category-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  grid-column: 1 / -1;
}

/* ── Category title ── */
.category-title {
  grid-column: 1 / -1;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

/* ── Product detail page ── */
.product-detail {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 28px;
}
.product-detail .back-link {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
}
.product-detail .back-link:hover { text-decoration: underline; }

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.detail-image img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.detail-title {
  font-size: 24px;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.detail-price {
  font-size: 22px;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 16px;
}
.detail-desc {
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 20px;
}
.etsy-link {
  display: inline-block;
  padding: 10px 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(7px 0, 100% 0, calc(100% - 7px) 100%, 0 100%);
}
.etsy-link:hover {
  border-color: var(--accent);
}

.variant-group {
  margin: 18px 0 14px;
}
.variant-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.variant-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.variant-btn {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 13px;
  min-height: 38px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.variant-btn:hover { border-color: var(--accent); }
.variant-btn.active {
  background: rgba(255, 45, 85, 0.20);
  border-color: var(--accent);
}
.selected-variant {
  margin-top: 10px;
  color: var(--green);
  font-size: 12px;
}
.detail-add-btn {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  padding: 12px 18px;
  margin: 10px 0 14px;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  cursor: pointer;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
}
.detail-add-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.72);
  display: grid;
  place-items: center;
  padding: 20px;
}
.confirm-modal {
  width: 100%;
  max-width: 420px;
  background: #0e1017;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 20px;
}
.confirm-modal h3 {
  margin: 0 0 10px;
  font-size: 18px;
}
.confirm-product,
.confirm-size {
  color: var(--muted);
  margin: 0 0 8px;
}
.confirm-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
}
.confirm-btn {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
}
.confirm-btn.primary {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

/* ── Cart page ── */
.cart-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 28px 60px;
}
.cart-title {
  font-size: 24px;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.cart-empty {
  color: var(--muted);
  margin-bottom: 12px;
}
.cart-page-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.cart-page-item { min-width: 0; }
.cart-page-name { font-weight: 600; margin-bottom: 2px; }
.cart-page-meta { color: var(--muted); font-size: 12px; }
.cart-page-right { text-align: right; }
.cart-page-price {
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 4px;
}
.cart-remove-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
}
.cart-remove-btn:hover { color: var(--accent); border-color: var(--accent); }
.cart-page-total {
  display: flex;
  justify-content: space-between;
  padding: 18px 0 6px;
  font-size: 18px;
}
.cart-page-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

@media (max-width: 640px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .store-nav {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 10px 16px;
    gap: 0;
    background: rgba(10, 12, 18, 0.96);
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    transform: translateY(-130%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s, opacity 0.25s;
  }

  .store-nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-link {
    padding: 12px 10px;
    border-radius: 10px;
  }

  .nav-spacer { display: none; }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .detail-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .product-detail { padding: 16px; }
  .detail-title { font-size: 20px; }
}

/* ── Product grid ── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  padding: 24px 28px 0;
  max-width: 1400px;
  margin: 0 auto;
}

.product-card {
  background: var(--dark-card);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.product-card:hover { border-color: rgba(255, 45, 85, 0.4); }

.product-card-link {
  display: block;
  color: var(--ink);
  text-decoration: none;
}

.product-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.product-card-info {
  padding: 10px;
}

.product-card-info h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-info .price {
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
}

/* ── Pagination ── */
.pagination {
  padding: 20px 28px 40px;
  text-align: center;
}
.pagination-inner {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.page-btn {
  padding: 8px 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.page-btn:hover {
  border-color: var(--accent);
  background: rgba(230, 36, 63, 0.1);
}
.page-info {
  color: var(--muted);
  font-size: 13px;
}

/* ── Detail placeholder ── */
.detail-placeholder {
  text-align: center;
  padding: 80px 24px;
}
.detail-placeholder p {
  color: var(--muted);
  margin-bottom: 12px;
}
.back-link {
  color: var(--accent);
  text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

/* ── Loading ── */
.loading {
  text-align: center;
  padding: 80px;
  color: var(--muted);
  grid-column: 1 / -1;
}

/* ── Skeleton ── */
.skeleton {
  background: linear-gradient(90deg, #0e1017 25%, #161927 50%, #0e1017 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: 12px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Footer ── */
.footer {
  padding: 0 20px 34px;
  color: var(--muted);
  font-size: 12px;
  border-top: 0;
  text-align: center;
}

.footer-banner-wrap {
  position: relative;
  max-width: 860px;
  margin: 0 auto 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}
.footer-banner {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
}

.footer p { margin-bottom: 8px; }
.footer a { color: var(--accent-2); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ── Checkout overlay (preserved) ── */
#checkoutOverlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
}
.checkout-modal {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  background: #0e1017;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
}
.checkout-modal h2 { margin-bottom: 20px; font-size: 20px; }
.cart-items { margin-bottom: 20px; }
.cart-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 13px;
}
.cart-total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  padding: 14px 0;
}
.checkout-btn {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  clip-path: polygon(9px 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
}
.checkout-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 20px 20px 0;
  }
}

@media (max-width: 640px) {
  .products-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px 16px 0;
  }

  .store-header {
    padding: 12px 16px;
  }
  .store-header h1 { font-size: 15px; }

  .store-nav {
    padding: 8px 16px;
    gap: 2px;
  }
  .nav-link { font-size: 12px; padding: 5px 10px; }

  .home-hero {
    padding: 48px 16px;
  }
  .home-hero h2 { font-size: 26px; }

  .pagination { padding: 16px; }
  .page-btn { padding: 6px 14px; font-size: 12px; }
}