:root {
  --bg: #0f0f0f;
  --bg-alt: #171717;
  --fg: #f5f5f0;
  --fg-muted: #a3a3a0;
  --accent: #d9c4a3;
  --border: #2a2a2a;
  --danger: #c0392b;
  --max-width: 1120px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
header.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(15, 15, 15, 0.92);
  backdrop-filter: blur(6px);
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
}

.logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
}

nav.main-nav {
  display: flex;
  gap: 28px;
  font-size: 14px;
  letter-spacing: 0.5px;
}

nav.main-nav a {
  opacity: 0.8;
  transition: opacity 0.15s;
}

nav.main-nav a:hover { opacity: 1; }

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

.account-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--fg);
  opacity: 0.85;
  transition: opacity 0.15s;
}

.account-link:hover { opacity: 1; }

.account-link #account-label {
  font-size: 10px;
  letter-spacing: 0.3px;
  color: var(--fg-muted);
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-link.logged-in svg {
  color: var(--accent);
}

.cart-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
}

#cart-count {
  background: var(--accent);
  color: #1c1c1c;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* Hero */
.hero {
  position: relative;
  padding: 100px 24px 80px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20px;
  background-image: url("/img/hero-gym.jpg");
  background-size: cover;
  background-position: center 35%;
  filter: blur(7px);
  transform: scale(1.1);
  z-index: -2;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 15, 0.74);
  z-index: -1;
}

.hero h1 {
  font-size: clamp(32px, 6vw, 56px);
  margin: 0 0 16px;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.hero p {
  color: var(--fg-muted);
  max-width: 520px;
  margin: 0 auto 32px;
  font-size: 16px;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: #1c1c1c;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  letter-spacing: 0.5px;
  transition: transform 0.15s, opacity 0.15s;
}

.btn:hover { transform: translateY(-1px); opacity: 0.92; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-outline {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
}

/* Section titles */
.section-title {
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 64px 0 24px;
}

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
  padding-bottom: 80px;
}

.product-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-card .thumb {
  aspect-ratio: 1 / 1;
  background: #111;
}

.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }

.product-card .info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.product-card h3 {
  margin: 0;
  font-size: 15px;
}

.product-card .color {
  color: var(--fg-muted);
  font-size: 13px;
  margin-top: -6px;
}

.product-card .price {
  font-weight: 700;
  font-size: 15px;
}

.product-desc {
  color: var(--fg-muted);
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
}

.size-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.size-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.size-btn.selected {
  background: var(--accent);
  color: #1c1c1c;
  border-color: var(--accent);
}

.size-btn.out-of-stock {
  color: var(--fg-muted);
  border-color: var(--border);
  text-decoration: line-through;
  cursor: not-allowed;
  opacity: 0.45;
  pointer-events: none;
}

.product-card.is-sold-out .thumb img {
  opacity: 0.55;
}

.product-card.is-sold-out h3,
.product-card.is-sold-out .price {
  opacity: 0.6;
}

.add-btn {
  margin-top: 8px;
  width: 100%;
  padding: 10px;
  font-size: 13px;
}

/* Cart drawer */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  z-index: 50;
}

.cart-overlay.open { display: block; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(400px, 100%);
  background: var(--bg-alt);
  border-left: 1px solid var(--border);
  z-index: 51;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.2s ease;
}

.cart-drawer.open { transform: translateX(0); }

.cart-drawer-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.cart-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.cart-item img {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  background: #111;
}

.cart-item .meta {
  flex: 1;
  font-size: 13px;
}

.cart-item .meta .name { font-weight: 700; margin-bottom: 2px; }
.cart-item .meta .attrs { color: var(--fg-muted); }

.qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.qty-controls button {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
}

.remove-link {
  font-size: 12px;
  color: var(--danger);
  cursor: pointer;
  margin-top: 6px;
  display: inline-block;
}

.cart-footer {
  padding: 20px;
  border-top: 1px solid var(--border);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
}

.empty-msg {
  color: var(--fg-muted);
  font-size: 14px;
  padding: 40px 0;
  text-align: center;
}

footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  color: var(--fg-muted);
  font-size: 13px;
  text-align: center;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--accent);
  color: #1c1c1c;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 60;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.status-page {
  padding: 120px 24px;
  text-align: center;
}

.status-page h1 { font-size: 32px; margin-bottom: 12px; }
.status-page p { color: var(--fg-muted); margin-bottom: 28px; }

/* Account page */
.account-wrap {
  max-width: 440px;
  margin: 0 auto;
  padding: 72px 24px 96px;
}

.account-wrap h1 {
  font-size: clamp(26px, 4vw, 32px);
  text-align: center;
  margin: 0 0 8px;
}

.account-wrap > p.subtitle {
  color: var(--fg-muted);
  text-align: center;
  margin-bottom: 36px;
  font-size: 14px;
}

.account-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
}

.account-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: transparent;
  border: none;
  color: var(--fg-muted);
  cursor: pointer;
}

.account-tab.active {
  background: var(--accent);
  color: #1c1c1c;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--fg);
  font-size: 14px;
  font-family: inherit;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-error {
  color: var(--danger);
  font-size: 13px;
  margin: -6px 0 16px;
  display: none;
}

.form-error.show { display: block; }

.form-success {
  color: var(--accent);
  font-size: 13px;
  margin: -6px 0 16px;
  display: none;
}

.form-success.show { display: block; }

.account-summary {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.account-summary .name {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 2px;
}

.account-summary .email {
  color: var(--fg-muted);
  font-size: 13px;
}

.section-label {
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 28px 0 14px;
}

.order-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
}

.order-item-line {
  color: var(--fg-muted);
  font-size: 13px;
  line-height: 1.5;
}

/* About page */
.page-hero {
  padding: 80px 24px 56px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.page-hero .eyebrow {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.page-hero h1 {
  font-size: clamp(28px, 5vw, 44px);
  margin: 0 0 16px;
  letter-spacing: -0.5px;
}

.page-hero p {
  color: var(--fg-muted);
  max-width: 560px;
  margin: 0 auto;
  font-size: 16px;
}

.story-section {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 24px;
}

.story-section p {
  color: var(--fg-muted);
  font-size: 16px;
  margin-bottom: 20px;
}

.story-section p strong {
  color: var(--fg);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 72px;
}

.stat-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 6px;
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--fg-muted);
  letter-spacing: 0.5px;
}

/* Contact page */
.contact-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 72px 24px 96px;
  text-align: center;
}

.contact-wrap h1 {
  font-size: clamp(26px, 4vw, 36px);
  margin: 0 0 14px;
}

.contact-wrap > p {
  color: var(--fg-muted);
  margin-bottom: 40px;
}

.contact-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.contact-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contact-row .label {
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.contact-row .value {
  font-size: 17px;
  font-weight: 700;
}

.contact-row .value a {
  color: var(--fg);
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
}

.contact-row .value a:hover {
  color: var(--accent);
  border-color: var(--accent);
}
