/* ==========================================================
   VIBEFIT — Design Tokens
   Palette: deep space black, cyan/purple/pink pulse gradient
   Type: Space Grotesk (display) / Inter (body) / JetBrains Mono (data)
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Colors */
  --bg:            #0A0A12;
  --surface:       #14141F;
  --surface-2:     #1C1C2A;
  --border:        #26263A;
  --text:          #F5F5F7;
  --text-muted:    #8A8A9E;
  --cyan:          #00F0FF;
  --purple:        #7B5CFF;
  --pink:          #FF3DBB;
  --grad: linear-gradient(90deg, var(--cyan), var(--purple) 55%, var(--pink));

  /* Type */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Layout */
  --max-w: 1320px;
  --radius: 14px;
  --radius-sm: 8px;
  --nav-h: 76px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

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

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

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

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--cyan);
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn-primary {
  background: var(--grad);
  color: #06060A;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px -6px rgba(0,240,255,0.4); }
.btn-outline {
  border-color: var(--border);
  color: var(--text);
  background: transparent;
}
.btn-outline:hover { border-color: var(--cyan); color: var(--cyan); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ---------------- NAV ---------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(10,10,18,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.nav-logo { height: 34px; display: flex; align-items: center; }
.nav-logo img { height: 100%; width: auto; object-fit: contain; }
.nav-links { display: flex; gap: 34px; list-style: none; font-size: 14px; font-weight: 500; }
.nav-links a { color: var(--text-muted); transition: color 0.2s, background 0.2s, border-color 0.2s; position: relative; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: ''; position: absolute; bottom: -22px; left: 0; right: 0; height: 2px; background: var(--grad);
}
.nav-actions { display: flex; align-items: center; gap: 14px; }
.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  transition: border-color 0.2s, background 0.2s, transform 0.15s ease;
}
.icon-btn:hover { border-color: var(--cyan); transform: translateY(-1px); }
.cart-count {
  position: absolute; top: -4px; right: -4px; background: var(--pink); color: #06060A;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700; min-width: 17px; height: 17px;
  border-radius: 999px; display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
.nav-toggle {
  display: none;
  position: relative;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.15s ease;
  overflow: hidden;
}
.nav-toggle:hover,
.nav-toggle:focus-visible {
  border-color: var(--cyan);
  color: var(--cyan);
}
.nav-toggle.open {
  border-color: var(--pink);
  color: var(--pink);
  background: var(--surface-2);
}
.nav-toggle .icon-menu,
.nav-toggle .icon-close {
  position: absolute;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
}
.nav-toggle .icon-close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.6);
  pointer-events: none;
}
.nav-toggle.open .icon-menu {
  opacity: 0;
  transform: rotate(90deg) scale(0.6);
  pointer-events: none;
}
.nav-toggle.open .icon-close {
  opacity: 1;
  transform: rotate(0deg) scale(1);
  pointer-events: auto;
}
.nav-toggle svg {
  display: block;
}

/* Backdrop for mobile drawer */
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 8, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 990;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.nav-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
body.nav-open {
  overflow: hidden;
}

/* ---------------- HERO / CAROUSEL (signature element) ---------------- */
.hero {
  position: relative;
  height: calc(100vh - var(--nav-h));
  min-height: 560px;
  overflow: hidden;
  background: var(--bg);
}
.carousel-track { position: relative; width: 100%; height: 100%; }
.slide {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transition: opacity 0.9s ease;
}
.slide.active { opacity: 1; visibility: visible; z-index: 2; }
.slide img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(1.05) brightness(0.75);
  transform: scale(1.06);
  transition: transform 8s ease;
}
.slide.active img { transform: scale(1); }
.slide::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,10,18,0.15) 0%, rgba(10,10,18,0.35) 55%, rgba(10,10,18,0.95) 100%);
  z-index: 1;
}

/* scanning pulse line sweep on active slide */
.scan-line {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: var(--grad);
  box-shadow: 0 0 24px 4px rgba(0,240,255,0.6);
  z-index: 3;
  left: -2px;
  opacity: 0;
}
.slide.active .scan-line { animation: sweep 1.4s cubic-bezier(0.65,0,0.35,1) forwards; }
@keyframes sweep {
  0%   { left: -2px; opacity: 1; }
  95%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

.hero-content {
  position: relative; z-index: 4;
  height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding-bottom: 92px;
}
.hero-caption {
  max-width: 620px;
  background: rgba(20,20,31,0.55);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 28px 32px;
}
.hero-caption .eyebrow { margin-bottom: 10px; display: block; }
.hero-caption h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
  margin-bottom: 12px;
}
.hero-caption p { color: var(--text-muted); margin-bottom: 20px; font-size: 15px; }
.hero-price { font-family: var(--font-mono); font-size: 14px; color: var(--cyan); margin-bottom: 18px; display: block; }
.hero-price s { color: var(--text-muted); margin-left: 8px; }

.hero-nav {
  position: absolute; z-index: 5; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(20,20,31,0.6); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text); backdrop-filter: blur(10px);
  transition: border-color 0.2s, transform 0.2s;
}
.hero-nav:hover { border-color: var(--cyan); transform: translateY(-50%) scale(1.06); }
.hero-prev { left: 28px; } .hero-next { right: 28px; }

.hero-indicators {
  position: absolute; z-index: 5; bottom: 32px; right: 28px;
  display: flex; gap: 8px;
}
.indicator {
  width: 34px; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.18);
  border: none; overflow: hidden; position: relative;
}
.indicator::after {
  content: ''; position: absolute; inset: 0; background: var(--grad);
  transform: scaleX(0); transform-origin: left; transition: transform 0.2s;
}
.indicator.active::after { animation: fillbar 5s linear forwards; }
@keyframes fillbar { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------------- SECTIONS ---------------- */
section { padding: 90px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 40px; gap: 20px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(26px, 3vw, 36px); }
.section-head .eyebrow { display: block; margin-bottom: 10px; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s;
  position: relative;
}
.card:hover { border-color: var(--cyan); transform: translateY(-4px); }
.card-img { aspect-ratio: 4/5; overflow: hidden; background: var(--surface-2); position: relative; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.card:hover .card-img img { transform: scale(1.06); }
.badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; text-transform: uppercase;
  padding: 5px 10px; border-radius: 999px; background: rgba(10,10,18,0.75); border: 1px solid var(--cyan); color: var(--cyan);
}
.badge.sale { border-color: var(--pink); color: var(--pink); }
.card-body { padding: 18px 18px 20px; }
.card-cat { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.card-name { font-family: var(--font-display); font-weight: 600; font-size: 16px; margin-bottom: 8px; }
.card-price { font-family: var(--font-mono); font-size: 15px; color: var(--cyan); }
.card-price s { color: var(--text-muted); font-weight: 400; margin-left: 6px; font-size: 13px; }
.card-add {
  width: 100%; margin-top: 14px; padding: 10px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  transition: background 0.2s, border-color 0.2s;
}
.card-add:hover { background: var(--cyan); color: #06060A; border-color: var(--cyan); }

/* ---------------- FILTER BAR (shop page) ---------------- */
.filter-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-bottom: 36px; padding-bottom: 24px; border-bottom: 1px solid var(--border);
}
.filter-chip {
  padding: 8px 18px; border-radius: 999px; border: 1px solid var(--border);
  font-size: 13px; font-weight: 500; color: var(--text-muted); background: transparent;
  transition: all 0.2s;
}
.filter-chip.active, .filter-chip:hover { border-color: var(--cyan); color: var(--cyan); }
.filter-bar select {
  margin-left: auto; background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 9px 14px; border-radius: var(--radius-sm); font-size: 13px; font-family: var(--font-body);
}

/* ---------------- PRODUCT DETAIL ---------------- */
.pd-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; padding: 50px 0 90px; }
.pd-main-img { aspect-ratio: 4/5; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.pd-main-img img { width: 100%; height: 100%; object-fit: cover; }
.pd-thumbs { display: flex; gap: 10px; margin-top: 12px; }
.pd-thumb { width: 72px; height: 90px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); opacity: 0.6; }
.pd-thumb.active { opacity: 1; border-color: var(--cyan); }
.pd-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pd-info h1 { font-size: clamp(26px, 3vw, 34px); margin: 6px 0 0; }
.pd-option { margin-bottom: 22px; }
.pd-option label { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
.pd-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.pd-swatch { padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--text); font-size: 13px; font-weight: 500; transition: all 0.2s; }
.pd-swatch.active, .pd-swatch:hover { border-color: var(--cyan); color: var(--cyan); }
.qty-stepper { display: inline-flex; align-items: center; gap: 18px; border: 1px solid var(--border); border-radius: 999px; padding: 8px 20px; }
.qty-stepper button { background: none; border: none; color: var(--text); font-size: 18px; width: 20px; }
.qty-stepper span { font-family: var(--font-mono); min-width: 16px; text-align: center; }

/* ---------------- CART ---------------- */
.cart-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; padding: 44px 0 90px; align-items: start; }
.cart-row { display: grid; grid-template-columns: 76px 1fr auto auto; gap: 16px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--border); }
.cart-row img { width: 76px; height: 92px; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface); }
.cart-remove { background: none; border: none; color: var(--text-muted); padding: 8px; }
.cart-remove:hover { color: var(--pink); }
.summary-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; position: sticky; top: 100px; }
.summary-card h3 { font-size: 18px; margin-bottom: 18px; }
.checkout-line { display: flex; justify-content: space-between; font-size: 14px; color: var(--text-muted); padding: 8px 0; }
.checkout-line.total { color: var(--text); font-weight: 700; font-family: var(--font-mono); font-size: 16px; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 16px; }

/* ---------------- CHECKOUT FORM ---------------- */
.checkout-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; padding: 44px 0 90px; align-items: start; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 8px; font-family: var(--font-mono); }
.form-group input, .form-group textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 13px 16px; color: var(--text); font-family: var(--font-body); font-size: 14px;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--cyan); outline: none; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.success-box { text-align: center; padding: 60px 20px; }
.success-box h2 { margin: 16px 0 10px; }
.order-ref { font-family: var(--font-mono); color: var(--cyan); font-size: 18px; }

/* ---------------- FOOTER ---------------- */
footer { border-top: 1px solid var(--border); padding: 56px 0 28px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-brand img { height: 30px; margin-bottom: 14px; }
.footer-brand p { color: var(--text-muted); font-size: 13px; max-width: 240px; }
.footer-col h4 { font-family: var(--font-display); font-size: 14px; margin-bottom: 16px; }
.footer-col a { display: block; color: var(--text-muted); font-size: 13px; margin-bottom: 10px; transition: color 0.2s; }
.footer-col a:hover { color: var(--cyan); }
.footer-bottom { display: flex; justify-content: space-between; padding-top: 24px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 12px; font-family: var(--font-mono); }

/* ---------------- EMPTY STATE ---------------- */
.empty-state { text-align: center; padding: 80px 20px; color: var(--text-muted); }
.empty-state h3 { color: var(--text); margin-bottom: 10px; font-size: 20px; }

/* ---------------- LOADING SKELETON ---------------- */
.skel { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 860px) {
  :root {
    --nav-h: 70px;
  }
  .pd-layout { grid-template-columns: 1fr; gap: 32px; padding: 30px 0 60px; }
  .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
  .cart-row { grid-template-columns: 60px 1fr; grid-template-areas: "img info" "img actions"; }
  .form-row { grid-template-columns: 1fr; }

  /* Mobile Toggle & Menu */
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: rgba(10, 10, 18, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.8), 0 0 1px rgba(0, 240, 255, 0.15);
    flex-direction: column;
    padding: 16px 20px 24px;
    gap: 8px;
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-12px);
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.25s;
  }
  .nav-links.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }
  .nav-links a.active::after { display: none; }
  .nav-links li { width: 100%; list-style: none; }
  .nav-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 13px 18px;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font-display);
    border-radius: var(--radius-sm);
    background: rgba(20, 20, 31, 0.7);
    border: 1px solid rgba(38, 38, 58, 0.75);
    color: var(--text-muted);
    transition: all 0.2s ease;
  }
  .nav-links a:hover,
  .nav-links a:focus-visible {
    color: var(--text);
    background: var(--surface-2);
    border-color: rgba(0, 240, 255, 0.45);
    transform: translateX(4px);
  }
  .nav-links a.active {
    color: #FFFFFF;
    background: linear-gradient(90deg, rgba(0, 240, 255, 0.14), rgba(123, 92, 255, 0.08));
    border-color: var(--cyan);
    box-shadow: inset 0 0 16px rgba(0, 240, 255, 0.08);
  }
  .nav-links a::after {
    content: '→';
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-muted);
    opacity: 0.4;
    transition: transform 0.2s, opacity 0.2s, color 0.2s;
  }
  .nav-links a:hover::after,
  .nav-links a.active::after {
    opacity: 1;
    color: var(--cyan);
    transform: translateX(3px);
  }

  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-caption { max-width: 90%; }
}

@media (max-width: 520px) {
  :root {
    --nav-h: 64px;
  }
  .wrap {
    padding: 0 16px;
  }
  .nav-actions {
    gap: 10px;
  }
  .icon-btn, .nav-toggle {
    width: 38px;
    height: 38px;
  }
  .nav-logo {
    height: 28px;
  }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-nav { width: 38px; height: 38px; }
  .hero-content { padding-bottom: 60px; }
}
