/* ==========================================================================
   ASUNA PARFUMERIE — Footer
   Dépend de tokens.css. Comportement : assets/js/footer.js
   >= 900px : logo | newsletter | réseaux sociaux, séparés par deux filets verticaux
   <  900px : une colonne centrée, sans filets verticaux
   ========================================================================== */

.site-footer {
  --footer-pad-x: clamp(16px, 5vw, 72px);
  --footer-line: #d9cdbf;

  margin-top: clamp(40px, 4.4vw, 64px);
  background: var(--asuna-ivory);
  color: var(--asuna-brown);
  font-family: var(--asuna-font-ui);
}

.site-footer__inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--footer-pad-x);
}

/* --------------------------------------------------------------------------
   Partie haute : 3 zones
   -------------------------------------------------------------------------- */
.site-footer__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1.9fr) 1px minmax(0, 1fr);
  align-items: center;
  column-gap: clamp(24px, 4vw, 64px);
  padding-block: 28px 36px;
}

.site-footer__rule {
  align-self: stretch;
  width: 1px;
  background: var(--footer-line);
}

.site-footer__brand {
  justify-self: start;
  display: inline-flex;
  border-radius: 4px;
}

.site-footer__logo {
  width: auto;
  height: 66px;
  max-width: none;
}

/* Newsletter */
.newsletter {
  position: relative;
  justify-self: center;
  width: min(430px, 100%);
}

.newsletter__title {
  margin: 0;
  color: var(--asuna-brown);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}

.newsletter__text {
  margin: 4px 0 0;
  color: var(--asuna-brown-2);
  font-size: 12px;
  line-height: 1.5;
}

.newsletter__form {
  position: relative;
  margin-top: 12px;
}

.newsletter__input {
  display: block;
  width: 100%;
  height: 40px;
  margin: 0;
  padding: 0 50px 0 18px;
  border: 1px solid var(--asuna-border);
  border-radius: var(--asuna-radius-pill);
  background: var(--asuna-ivory-light);
  color: var(--asuna-brown);
  font: inherit;
  font-size: 13px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s ease;
}

.newsletter__input::placeholder {
  color: var(--asuna-placeholder);
  opacity: 1;
}

.newsletter__input:focus-visible {
  border-color: var(--asuna-champagne);
}

.newsletter__input[aria-invalid="true"] {
  border-color: #b5513a;
}

.newsletter__submit {
  position: absolute;
  top: 4px;
  right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--asuna-brown);
  color: var(--asuna-on-dark);
  cursor: pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

.newsletter__submit:hover {
  background: var(--asuna-brown-2);
}

.newsletter__submit:disabled {
  opacity: 0.6;
  cursor: progress;
}

.newsletter__submit svg {
  width: 14px;
  height: 14px;
}

.newsletter__submit:focus-visible {
  outline: 2px solid var(--asuna-champagne);
  outline-offset: 2px;
}

/* Champ piège anti-robots, invisible pour les visiteurs */
.newsletter__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Message sous le champ, sans pousser la mise en page */
.newsletter__status {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  margin: 6px 0 0 4px;
  font-size: 12px;
  line-height: 1.4;
}

.newsletter__status:empty {
  display: none;
}

.newsletter__status[data-state="error"] {
  color: #9c3f2b;
}

.newsletter__status[data-state="success"] {
  color: #4f6b3a;
}

/* Réseaux sociaux */
.socials {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.socials__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--asuna-brown);
  transition: background-color 0.2s ease;
}

a.socials__link[href]:hover {
  background: var(--asuna-sand);
}

/* Lien non configuré (URL officielle pas encore transmise) */
.socials__link:not([href]) {
  cursor: default;
}

.socials__link svg {
  width: 18px;
  height: 18px;
}

.socials__link:focus-visible {
  outline: 2px solid var(--asuna-champagne);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Partie basse : liens légaux, copyright, retour en haut
   -------------------------------------------------------------------------- */
.site-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-block: 16px 22px;
  border-top: 1px solid var(--footer-line);
}

.legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.legal {
  gap: 2px 14px;
}

/* Filets « | » entre les liens, seulement quand tout tient sur une ligne */
@media (min-width: 1200px) {
  .legal {
    gap: 0;
  }

  .legal li + li::before {
    content: "|";
    margin: 0 14px;
    color: var(--footer-line);
  }
}

.legal a {
  color: var(--asuna-text-muted);
  font-size: 12.5px;
  line-height: 1.8;
  text-decoration: none;
  transition: color 0.2s ease;
}

.legal a:hover {
  color: var(--asuna-brown);
}

.site-footer__end {
  display: flex;
  flex: none;
  align-items: center;
  gap: 22px;
}

.site-footer__copy {
  margin: 0;
  color: var(--asuna-text-muted);
  font-size: 12.5px;
}

.back-to-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #e6e2dc;
  color: var(--asuna-brown);
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.25s var(--asuna-ease);
}

.back-to-top svg {
  width: 14px;
  height: 14px;
}

.back-to-top:hover {
  background: var(--asuna-sand);
  transform: translateY(-2px);
}

.legal a:focus-visible,
.site-footer__brand:focus-visible,
.back-to-top:focus-visible {
  outline: 2px solid var(--asuna-champagne);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Tablette et mobile : une colonne centrée
   -------------------------------------------------------------------------- */
@media (max-width: 899.98px) {
  .site-footer__top {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    row-gap: 26px;
    padding-block: 32px 26px;
    text-align: center;
  }

  .site-footer__rule {
    display: none;
  }

  .site-footer__brand,
  .newsletter,
  .socials {
    justify-self: center;
  }

  .newsletter__form {
    text-align: left;
  }

  .newsletter__status {
    position: static;
    margin: 8px 0 0;
    text-align: center;
  }

  .site-footer__bottom {
    flex-direction: column;
    text-align: center;
  }

  .legal {
    justify-content: center;
    max-width: 520px;
  }

  .site-footer__end {
    flex-direction: column;
    gap: 14px;
  }

  .back-to-top {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 479.98px) {
  .site-footer__logo {
    height: 60px;
  }

  .legal a,
  .site-footer__copy {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top,
  .newsletter__input,
  .newsletter__submit {
    transition: none;
  }
}
