/* ==========================
   DESIGN SYSTEM – EMNALIA
   Minimal • Youth • Premium
   Apple-inspired fluidity
   ========================== */

:root {
  --bg: #0e0e0f;
  --surface: #151517;
  --glass: rgba(255, 255, 255, .04);
  --text: #f5f5f5;
  --muted: #9a9a9a;

  --accent: #ff8e79;
  --accent-2: #ea7d7d;
  --accent-hover: #ff9f8c;

  --radius-s: 10px;
  --radius-m: 14px;
  --radius-l: 20px;
  --radius-xl: 24px;

  --shadow-soft: 0 20px 60px rgba(0, 0, 0, .45);
  --shadow-accent: 0 12px 40px rgba(221, 84, 60, .35);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, .3);

  --max-w: 1200px;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  color-scheme: dark;
}

/* Light mode */
[data-theme="light"] {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --glass: rgba(0, 0, 0, .08);
  --text: #1d1d1f;
  --muted: #6e6e73;
  --accent: #ff6b54;
  --accent-2: #e85d5d;
  --shadow-soft: 0 20px 60px rgba(0, 0, 0, .1);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, .08);
  --shadow-accent: 0 12px 40px rgba(255, 107, 84, .3);
  color-scheme: light;
}

* {
  transition-duration: .3s;
  transition-timing-function: var(--ease);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  letter-spacing: -.01em;
}

/* ==========================
   LAYOUT
   ========================== */
.wrap {
  min-height: 100vh;
  max-width: var(--max-w);
  margin-inline: auto;
  padding: 48px 32px;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 48px;
  align-items: start;
}

@media (max-width: 980px) {
  .wrap {
    grid-template-columns: 1fr;
    padding: 32px 20px;
    gap: 32px;
  }
}

/* ==========================
   HEADER
   ========================== */
.header {
  grid-column: 1/-1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid transparent;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  max-width: var(--max-w);
  margin: 0 auto;
  padding-inline: 32px;
  transition: all .4s var(--ease-out);
}

.header.scrolled {
  padding: 12px 32px;
  background: rgba(14, 14, 15, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--glass);
  box-shadow: 0 1px 0 0 rgba(255, 255, 255, 0.05);
}

.header.hidden {
  transform: translateY(-100%);
}

[data-theme="light"] .header.scrolled {
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 1px 0 0 rgba(0, 0, 0, 0.05);
}

/* Compenser le header fixe */
.hero {
  padding-top: 80px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-m);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #000;
  box-shadow: var(--shadow-accent);
  transition: all .3s var(--ease-spring);
}

.logo:hover {
  transform: scale(1.05) rotate(-2deg);
}

.header.scrolled .logo {
  width: 44px;
  height: 44px;
  font-size: 12px;
}

.header.scrolled .brand-text h1 {
  font-size: 18px;
}

.header.scrolled .brand-text p {
  display: none;
}

.brand-text h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.brand-text p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nav-link {
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: all .25s var(--ease);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 16px;
  right: 16px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform .25s var(--ease);
}

.nav-link:hover {
  color: var(--text);
  background: var(--glass);
}

.nav-link:hover::after {
  transform: scaleX(1);
}

/* ==========================
   HERO
   ========================== */
.hero-content {
  max-width: 580px;
}

.kicker {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 142, 121, .12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 24px;
  animation: fadeInUp .6s var(--ease-out) .2s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.15;
  margin-bottom: 20px;
  animation: fadeInUp .6s var(--ease-out) .3s both;
}

.lead {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
  margin-bottom: 32px;
  animation: fadeInUp .6s var(--ease-out) .4s both;
}

/* ==========================
   BUTTONS (MAGNETIC + APPLE)
   ========================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-m);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all .25s var(--ease);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .15), transparent);
  transform: translateX(-100%);
  transition: transform .6s var(--ease);
}

.btn:hover::before {
  transform: translateX(100%);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #000;
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 48px rgba(221, 84, 60, .45);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-accent);
}

.btn-ghost {
  border: 1.5px solid var(--glass);
  background: rgba(255, 255, 255, .02);
  backdrop-filter: blur(10px);
}

.btn-ghost:hover {
  border-color: var(--muted);
  background: rgba(255, 255, 255, .05);
}

/* ==========================
   MODE LIGHT - SURCHARGES
   ========================== */
[data-theme="light"] .btn-ghost {
  border: 1.5px solid rgba(0, 0, 0, .15);
  background: rgba(0, 0, 0, .03);
  color: var(--text);
}

[data-theme="light"] .btn-ghost:hover {
  border-color: rgba(0, 0, 0, .25);
  background: rgba(0, 0, 0, .06);
}

[data-theme="light"] .nav-link {
  color: var(--muted);
}

[data-theme="light"] .nav-link:hover {
  color: var(--text);
  background: rgba(0, 0, 0, .06);
}

[data-theme="light"] .feature {
  background: rgba(0, 0, 0, .04);
  border: 1px solid rgba(0, 0, 0, .08);
}

[data-theme="light"] .feature:hover {
  background: rgba(0, 0, 0, .08);
}

[data-theme="light"] .card {
  border: 1px solid rgba(0, 0, 0, .1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .1);
}

[data-theme="light"] .product-visual {
  background: linear-gradient(180deg, #e8e8e8, #f5f5f5);
}

[data-theme="light"] .chip {
  background: rgba(0, 0, 0, .05);
  border: 1px solid rgba(0, 0, 0, .08);
}

[data-theme="light"] .chip:hover {
  background: rgba(0, 0, 0, .08);
}

[data-theme="light"] .info-accordion {
  border: 1px solid rgba(0, 0, 0, .1);
  background: rgba(0, 0, 0, .02);
}

[data-theme="light"] .info-accordion summary:hover {
  background: rgba(0, 0, 0, .05);
}

[data-theme="light"] .header {
  border-bottom: 1px solid rgba(0, 0, 0, .1);
}

[data-theme="light"] .footer {
  border-top: 1px solid rgba(0, 0, 0, .1);
}

[data-theme="light"] .price-row {
  border-top: 1px solid rgba(0, 0, 0, .08);
  border-bottom: 1px solid rgba(0, 0, 0, .08);
}

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  animation: fadeInUp .6s var(--ease-out) .5s both;
}

/* ==========================
   FEATURES
   ========================== */
.features {
  display: flex;
  gap: 12px;
  margin-top: 40px;
  flex-wrap: wrap;
  animation: fadeInUp .6s var(--ease-out) .6s both;
}

.feature {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  font-size: 14px;
  border: 1px solid rgba(255, 255, 255, .05);
  transition: all .3s var(--ease);
}

.feature:hover {
  background: rgba(255, 255, 255, .08);
  transform: translateY(-2px);
}

.feature svg {
  opacity: .6;
}

/* ==========================
   PRODUCT CARD
   ========================== */
.card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--glass);
  position: sticky;
  top: 32px;
  animation: fadeInScale .6s var(--ease-out) .4s both;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.product-visual {
  height: 340px;
  border-radius: var(--radius-m);
  background: linear-gradient(180deg, #1b1b1b, #0f0f0f);
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 20px;
}

.product-blob {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  filter: blur(60px);
  opacity: .4;
  animation: blobFloat 8s ease-in-out infinite;
}

@keyframes blobFloat {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(20px, -20px) scale(1.1);
  }
}

.product-placeholder {
  position: relative;
  z-index: 2;
  color: var(--muted);
}

.product-name {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.product-desc {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding: 16px 0;
  border-top: 1px solid var(--glass);
  border-bottom: 1px solid var(--glass);
}

.price-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.price {
  font-size: 28px;
  font-weight: 700;
}

.old {
  font-size: 16px;
  color: var(--muted);
  text-decoration: line-through;
}

.badge {
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 142, 121, .15);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}

.small {
  font-size: 13px;
  color: var(--muted);
}

.stock-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: .5;
  }
}

.cta-product {
  gap: 12px;
  margin-bottom: 20px;
}

.btn-cart {
  flex: 1;
}

.btn-fav {
  width: 52px;
  padding: 14px;
  justify-content: center;
}

.btn-fav.active .heart-icon path {
  fill: var(--accent);
  stroke: var(--accent);
}

/* ==========================
   ACCORDION
   ========================== */
.product-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-accordion {
  border: 1px solid var(--glass);
  border-radius: var(--radius-s);
  overflow: hidden;
  background: rgba(255, 255, 255, .02);
}

.info-accordion summary {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all .2s var(--ease);
}

.info-accordion summary::-webkit-details-marker {
  display: none;
}

.info-accordion summary::after {
  content: '+';
  font-size: 20px;
  transition: transform .2s var(--ease);
}

.info-accordion[open] summary::after {
  transform: rotate(45deg);
}

.info-accordion summary:hover {
  background: var(--glass);
}

.accordion-content {
  padding: 0 16px 16px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  animation: slideDown .3s var(--ease);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================
   FOOTER
   ========================== */
.footer {
  grid-column: 1/-1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 120px;
  padding: 40px 0;
  border-top: 1px solid var(--glass);
  opacity: 0.7;
  transition: opacity .3s var(--ease);
}

.footer:hover {
  opacity: 1;
}

@media (max-width: 640px) {
  .footer {
    flex-direction: column;
    gap: 20px;
  }
}

.chip {
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, .05);
  transition: all .25s var(--ease);
}

.chip:hover {
  background: rgba(255, 255, 255, .08);
  transform: translateY(-1px);
}

.theme-toggle {
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}

.theme-icon {
  font-size: 18px;
  transition: transform .3s var(--ease-spring);
}

.theme-toggle:hover .theme-icon {
  transform: rotate(20deg) scale(1.1);
}

.socials {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================
   TOAST NOTIFICATION
   ========================== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 16px 24px;
  border-radius: var(--radius-m);
  background: var(--surface);
  border: 1px solid var(--glass);
  box-shadow: var(--shadow-card);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: all .3s var(--ease-out);
  z-index: 1000;
  pointer-events: none;
}

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

/* ==========================
   REVEAL ANIMATION
   ========================== */
.opacity-0 {
  opacity: 0;
  transform: translateY(30px);
}

.fade-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
}

/* ==========================
   SCROLLBAR (WEBKIT)
   ========================== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--glass);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ==========================
   RESPONSIVE
   ========================== */
@media (max-width: 640px) {
  .header {
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
  }

  .hero-title {
    font-size: 36px;
  }

  .cta-row {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .card {
    position: static;
  }
}

/* ==========================
   PRINT STYLES
   ========================== */
@media print {
  .nav, .footer, .btn {
    display: none;
  }
}