/* ==========================================================================
   MAISON TOURNELLE · components.css
   Composants réutilisables : Nav · Footer · Boutons · Badges · Cards · Forms
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. BOUTONS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.8125rem; /* 13px */
  letter-spacing: 0.15em; /* ~2px */
  text-transform: uppercase;
  padding: 14px 36px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background-color 350ms var(--transition),
              color 350ms var(--transition),
              border-color 350ms var(--transition),
              transform 350ms var(--transition);
  white-space: nowrap;
}

/* Bouton primaire */
.btn--primary {
  background-color: var(--gold);
  color: #0D0B09;
}
.btn--primary:hover,
.btn--primary:focus-visible {
  background-color: var(--gold-light);
  transform: translateY(-2px);
}

/* Bouton ghost */
.btn--ghost {
  background-color: transparent;
  border-color: var(--gold);
  color: var(--gold);
}
.btn--ghost:hover,
.btn--ghost:focus-visible {
  background-color: var(--gold);
  color: #0D0B09;
}

/* Bouton ghost clair (sur fond image sombre) */
.btn--ghost-light {
  background-color: transparent;
  border-color: rgba(240, 232, 220, 0.5);
  color: var(--text);
}
.btn--ghost-light:hover,
.btn--ghost-light:focus-visible {
  background-color: var(--text);
  color: #0D0B09;
  border-color: var(--text);
}

/* Pleine largeur */
.btn--block {
  width: 100%;
}

.btn .lucide {
  width: 16px;
  height: 16px;
}

/* --------------------------------------------------------------------------
   2. BADGES
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.5625rem; /* 9px */
  letter-spacing: 0.15em; /* ~2px */
  text-transform: uppercase;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  background: rgba(13, 11, 9, 0.4);
}

.badge .lucide {
  width: 12px;
  height: 12px;
  color: var(--gold);
}

.badge--gold {
  color: var(--gold);
  border-color: var(--border-hover);
}

/* --------------------------------------------------------------------------
   3. NAVIGATION
   -------------------------------------------------------------------------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background-color: transparent;
  transition: background-color 400ms var(--transition),
              backdrop-filter 400ms var(--transition),
              border-color 400ms var(--transition),
              box-shadow 400ms var(--transition);
  border-bottom: 1px solid transparent;

  /* Couleur de la nav SELON le contexte :
     - en haut (transparente, posée sur le héros sombre) -> texte clair
     - une fois "scrollée" (fond plein) -> couleur du thème courant */
  --nav-fg:       var(--on-overlay);
  --nav-fg-muted: rgba(244, 236, 224, 0.72);
}

/* État au scroll (ajouté par nav.js) · thème SOMBRE */
.nav.is-scrolled {
  background-color: rgba(26, 22, 18, 0.82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --nav-fg:       var(--text);
  --nav-fg-muted: var(--text-muted);
}

/* État au scroll · thème CLAIR : fond ivoire translucide */
:root[data-theme="light"] .nav.is-scrolled {
  background-color: rgba(251, 247, 240, 0.85);
  box-shadow: 0 8px 32px rgba(42, 32, 23, 0.10);
}

.nav__inner {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav__logo {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.5rem; /* 24px */
  color: var(--nav-fg);
  white-space: nowrap;
  transition: color 300ms var(--transition);
}
.nav__logo:hover {
  color: var(--gold-light);
}

/* Menu desktop */
.nav__menu {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav__link {
  position: relative;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.8125rem; /* 13px */
  letter-spacing: 0.15em; /* ~2px */
  color: var(--nav-fg-muted);
  padding-block: 6px;
  transition: color 300ms var(--transition);
}
.nav__link:hover {
  color: var(--nav-fg);
}

/* Soulignement actif */
.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background-color: var(--gold);
  transition: width 350ms var(--transition);
}
.nav__link:hover::after {
  width: 100%;
}
.nav__link.is-active {
  color: var(--nav-fg);
}
.nav__link.is-active::after {
  width: 100%;
}

/* Bloc droite : bascule de thème + panier */
.nav__actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav__theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  color: var(--nav-fg);
  transition: color 300ms var(--transition), background-color 300ms var(--transition);
}
.nav__theme:hover {
  color: var(--gold);
  background-color: rgba(196, 146, 58, 0.10);
}
.nav__theme .lucide {
  width: 19px;
  height: 19px;
}
/* Bascule des pictos : soleil en mode sombre (=> passer en clair),
   lune en mode clair (=> passer en sombre). */
.nav__theme-icon {
  display: inline-flex;
}
.nav__theme-icon--moon { display: none; }
:root[data-theme="light"] .nav__theme-icon--sun  { display: none; }
:root[data-theme="light"] .nav__theme-icon--moon { display: inline-flex; }

.nav__cart {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--nav-fg);
  transition: color 300ms var(--transition);
}
.nav__cart:hover {
  color: var(--gold);
}
.nav__cart .lucide {
  width: 20px;
  height: 20px;
}
.nav__cart-count {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--gold-ink);
}

/* Hamburger (mobile) */
.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  z-index: 1200;
}
.nav__toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background-color: var(--nav-fg);
  transition: transform 350ms var(--transition),
              opacity 250ms var(--transition);
}
.nav__toggle.is-open span:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav__toggle.is-open span:nth-child(2) {
  opacity: 0;
}
.nav__toggle.is-open span:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* Drawer mobile */
.nav__drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(82vw, 380px);
  background-color: var(--surface);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  opacity: 0;
  visibility: hidden;
  transition: transform 450ms var(--transition),
              opacity 350ms var(--transition),
              visibility 0s linear 450ms;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px var(--gutter) 40px;
}
.nav__drawer.is-open {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  transition: transform 450ms var(--transition),
              opacity 350ms var(--transition),
              visibility 0s;
}
.nav__drawer-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nav__drawer-link {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 2rem;
  color: var(--text);
  padding-block: 8px;
  transition: color 300ms var(--transition), padding-left 300ms var(--transition);
}
.nav__drawer-link:hover,
.nav__drawer-link.is-active {
  color: var(--gold);
  padding-left: 10px;
}
.nav__drawer-footer {
  margin-top: 48px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Overlay derrière le drawer */
.nav__overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(13, 11, 9, 0.6);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 350ms var(--transition), visibility 0s linear 350ms;
  z-index: 1050;
}
.nav__overlay.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 350ms var(--transition), visibility 0s;
}

/* --------------------------------------------------------------------------
   4. CARTE PRODUIT
   -------------------------------------------------------------------------- */
.product-card {
  display: flex;
  flex-direction: column;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 400ms var(--transition),
              transform 400ms var(--transition);
}
.product-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
}

.product-card__media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
}
.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms var(--transition);
}
.product-card:hover .product-card__media img {
  transform: scale(1.04);
}

.product-card__badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

.product-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px;
  flex: 1;
}

.product-card__name {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.75rem; /* 28px */
  line-height: 1.1;
  color: var(--text);
}

.product-card__scent {
  font-size: 0.8125rem; /* 13px */
  color: var(--text-muted);
}

.product-card__meta {
  font-family: var(--font-mono);
  font-size: 0.6875rem; /* 11px */
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.product-card__price {
  font-family: var(--font-mono);
  font-size: 1.25rem; /* 20px */
  color: var(--gold-ink);
  margin-top: 4px;
}

.product-card__action {
  margin-top: 16px;
}

/* --------------------------------------------------------------------------
   5. FOOTER
   -------------------------------------------------------------------------- */
.footer {
  position: relative;
  background-color: var(--bg);
  border-top: 1px solid var(--border);
  padding-block: clamp(56px, 8vw, 80px) 32px;
}
/* Ligne dorée fine en haut */
.footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: min(220px, 40vw);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 56px;
}

.footer__brand-logo {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.75rem;
  color: var(--text);
  margin-bottom: 12px;
  display: inline-block;
}
.footer__tagline {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.footer__col-title {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold-ink);
  margin-bottom: 20px;
}

.footer__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer__list a,
.footer__list span {
  font-size: 0.9375rem;
  color: var(--text-muted);
  transition: color 300ms var(--transition);
}
.footer__list a:hover {
  color: var(--gold);
}

.footer__socials {
  display: flex;
  gap: 14px;
  margin-top: 20px;
}
.footer__socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: color 300ms var(--transition), border-color 300ms var(--transition);
}
.footer__socials a:hover {
  color: var(--gold);
  border-color: var(--border-hover);
}
.footer__socials svg {
  width: 18px;
  height: 18px;
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.footer__copy {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-align: center;
}

/* --------------------------------------------------------------------------
   6. FORMULAIRES (underline)
   -------------------------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field__label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.field__input,
.field__textarea,
.field__select {
  width: 100%;
  background-color: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1rem;
  padding: 10px 0;
  transition: border-color 300ms var(--transition);
}
.field__input::placeholder,
.field__textarea::placeholder {
  color: var(--text-faint);
}
.field__input:focus,
.field__textarea:focus,
.field__select:focus {
  outline: none;
  border-bottom-color: var(--gold);
}
.field__textarea {
  resize: vertical;
  min-height: 120px;
}
.field__select {
  cursor: pointer;
  border: 1px solid var(--border);
  padding: 12px 14px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23C4923A' stroke-width='1.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.field__select option {
  background-color: var(--surface);
  color: var(--text);
}

/* Message de confirmation formulaire */
.form-feedback {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 14px 18px;
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  background: rgba(196, 146, 58, 0.08);
  color: var(--gold-light);
  font-size: 0.9375rem;
}
.form-feedback.is-visible {
  display: flex;
}
.form-feedback .lucide {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   7. NEWSLETTER (inline underline)
   -------------------------------------------------------------------------- */
.newsletter-form {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  max-width: 460px;
  margin-inline: auto;
}
.newsletter-form .field {
  flex: 1;
}
.newsletter-form .field__input {
  text-align: left;
}

/* --------------------------------------------------------------------------
   8. TAGS / FILTRES (pills)
   -------------------------------------------------------------------------- */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
.filter-pill {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
  transition: background-color 300ms var(--transition),
              color 300ms var(--transition),
              border-color 300ms var(--transition);
}
.filter-pill:hover {
  border-color: var(--border-hover);
  color: var(--text);
}
.filter-pill.is-active {
  background-color: var(--gold);
  color: var(--bg);
  border-color: var(--gold);
}

/* --------------------------------------------------------------------------
   9. RESPONSIVE · NAV
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .nav__menu {
    display: none;
  }
  .nav__cart {
    display: none;
  }
  .nav__toggle {
    display: flex;
  }
}

@media (min-width: 901px) {
  .nav__drawer,
  .nav__overlay {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   10. RESPONSIVE · FOOTER & CARTES
   -------------------------------------------------------------------------- */
@media (max-width: 820px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
  .footer__brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .footer__grid {
    grid-template-columns: 1fr;
  }
  .newsletter-form {
    flex-direction: column;
    align-items: stretch;
  }
}
