/* TopShapeFitness — Shared Design System
   Design tokens from landing page, extended for storefront. */

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

:root {
  --coral: #FF6B5A;
  --coral-dark: #E5503F;
  --midnight: #0D0D0D;
  --charcoal: #1A1A1A;
  --smoke: #2A2A2A;
  --silver: #A0A0A0;
  --off-white: #F5F2ED;
  --warm-white: #FAF8F5;
  --accent-gold: #D4A853;
  --success: #4CAF50;
  --error: #E5503F;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--midnight);
  color: var(--off-white);
  overflow-x: hidden;
  line-height: 1.6;
  min-height: 100vh;
}

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

/* ─── NAV ─── */
.nav {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  padding: 1.2rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(13, 13, 13, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 107, 90, 0.08);
}

.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  color: var(--off-white);
}

.nav-logo span { color: var(--coral); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--silver);
  transition: color 0.2s;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.nav-links a:hover,
.nav-links a.active { color: var(--off-white); }

.nav-cart {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--silver);
  transition: color 0.2s;
  cursor: pointer;
}

.nav-cart:hover { color: var(--off-white); }

.cart-badge {
  position: absolute;
  top: -8px;
  right: -12px;
  background: var(--coral);
  color: var(--midnight);
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cart-badge.visible {
  opacity: 1;
  transform: scale(1);
}

/* ─── PAGE LAYOUT ─── */
.page-content {
  padding-top: 5rem;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ─── SECTION HEADERS ─── */
.section-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--coral);
  margin-bottom: 0.8rem;
  font-weight: 500;
}

.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.section-desc {
  color: var(--silver);
  font-size: 1.05rem;
  max-width: 600px;
  line-height: 1.7;
}

/* ─── PRODUCT GRID ─── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.product-card {
  background: var(--charcoal);
  border: 1px solid rgba(255, 107, 90, 0.06);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.product-card:hover {
  border-color: rgba(255, 107, 90, 0.2);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.product-image {
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.product-image svg {
  width: 80px;
  height: 80px;
  opacity: 0.6;
  transition: all 0.4s ease;
}

.product-card:hover .product-image svg {
  opacity: 0.85;
  transform: scale(1.05);
}

.product-info {
  padding: 1.5rem;
}

.product-category {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--coral);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.product-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.product-desc {
  font-size: 0.85rem;
  color: var(--silver);
  line-height: 1.6;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--off-white);
}

.product-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--coral);
  color: var(--midnight);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.8rem;
  border-radius: 100px;
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 2rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.02em;
}

.btn-primary {
  background: var(--coral);
  color: var(--midnight);
}

.btn-primary:hover {
  background: var(--coral-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255, 107, 90, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--off-white);
  border: 1px solid rgba(255, 107, 90, 0.3);
}

.btn-secondary:hover {
  border-color: var(--coral);
  background: rgba(255, 107, 90, 0.05);
}

.btn-sm {
  padding: 0.6rem 1.2rem;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
}

/* ─── SIZE & COLOR SELECTORS ─── */
.size-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.size-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--smoke);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--off-white);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.size-btn:hover {
  border-color: rgba(255, 107, 90, 0.4);
}

.size-btn.selected {
  border-color: var(--coral);
  background: rgba(255, 107, 90, 0.1);
  color: var(--coral);
}

.color-selector {
  display: flex;
  gap: 0.6rem;
  margin: 1rem 0;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  position: relative;
}

.color-swatch:hover {
  transform: scale(1.1);
}

.color-swatch.selected {
  border-color: var(--coral);
  box-shadow: 0 0 0 2px var(--midnight), 0 0 0 4px var(--coral);
}

.color-name {
  font-size: 0.8rem;
  color: var(--silver);
  margin-top: 0.3rem;
}

/* ─── QUANTITY SELECTOR ─── */
.quantity-selector {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  width: fit-content;
}

.qty-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--smoke);
  border: none;
  color: var(--off-white);
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.qty-btn:hover { background: rgba(255, 107, 90, 0.15); }

.qty-value {
  width: 48px;
  text-align: center;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--charcoal);
}

/* ─── CART ─── */
.cart-item {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  align-items: center;
}

.cart-item-image {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-image svg {
  width: 40px;
  height: 40px;
  opacity: 0.6;
}

.cart-item-details h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.cart-item-meta {
  font-size: 0.8rem;
  color: var(--silver);
}

.cart-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.cart-item-price {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
}

.cart-remove {
  background: none;
  border: none;
  color: var(--silver);
  font-size: 0.8rem;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0.2rem 0;
}

.cart-remove:hover { color: var(--coral); }

.cart-summary {
  background: var(--charcoal);
  border: 1px solid rgba(255, 107, 90, 0.08);
  border-radius: 12px;
  padding: 2rem;
  position: sticky;
  top: 6rem;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.cart-summary-row.total {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.cart-empty {
  text-align: center;
  padding: 6rem 2rem;
}

.cart-empty h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.cart-empty p {
  color: var(--silver);
  margin-bottom: 2rem;
}

/* ─── FILTER BAR ─── */
.filter-bar {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.filter-btn {
  padding: 0.5rem 1.2rem;
  border: 1px solid rgba(255, 107, 90, 0.15);
  border-radius: 100px;
  background: transparent;
  color: var(--silver);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: rgba(255, 107, 90, 0.4);
  color: var(--off-white);
}

.filter-btn.active {
  border-color: var(--coral);
  background: rgba(255, 107, 90, 0.1);
  color: var(--coral);
}

/* ─── SUCCESS PAGE ─── */
.success-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
  padding: 2rem;
}

.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(76, 175, 80, 0.1);
  border: 2px solid var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
}

.success-icon svg {
  width: 40px;
  height: 40px;
  stroke: var(--success);
}

/* ─── FOOTER ─── */
.store-footer {
  padding: 3rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  margin-top: 6rem;
}

.store-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.store-footer p {
  font-size: 0.8rem;
  color: var(--silver);
}

/* ─── LOADING ─── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--charcoal) 0%,
    var(--smoke) 50%,
    var(--charcoal) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── TOAST ─── */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--charcoal);
  border: 1px solid rgba(255, 107, 90, 0.2);
  border-radius: 10px;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.9rem;
  z-index: 200;
  transform: translateY(120%);
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.toast-icon {
  color: var(--coral);
  font-size: 1.1rem;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .nav { padding: 1rem 1.5rem; }
  .nav-links { gap: 1.2rem; }
  .nav-links a { font-size: 0.8rem; }
  .container { padding: 0 1.5rem; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
  .product-image { height: 260px; }
  .cart-item { grid-template-columns: 80px 1fr auto; gap: 1rem; }
  .cart-item-image { width: 80px; height: 80px; }
}

@media (max-width: 480px) {
  .nav-links a.hide-mobile { display: none; }
  .product-grid { grid-template-columns: 1fr 1fr; gap: 0.8rem; }
  .product-image { height: 200px; }
  .product-info { padding: 1rem; }
  .product-name { font-size: 0.95rem; }
  .product-desc { display: none; }
  .cart-item { grid-template-columns: 70px 1fr; }
  .cart-item-actions { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; }
}
