/* ==========================================================================
   Tuhfa — feuille de style unique
   Reprend le design system du site Hostinger d'origine : Montserrat,
   fond blanc, texte noir, conteneur 1224px, header collant de 193px.
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------ */

:root {
  --font-primary: "Montserrat", sans-serif;
  --font-secondary: "Montserrat", "IBM Plex Mono", sans-serif;

  --ink: rgb(0, 0, 0);
  --ink-soft: rgb(50, 50, 50);
  --ink-muted: rgb(86, 88, 94);
  --paper: rgb(255, 255, 255);
  --line: rgb(184, 192, 204);
  --line-faint: rgb(224, 224, 224);
  --placeholder: rgb(140, 143, 150);

  --container: 1224px;
  --header-h: 193px;
  --logo-w: 193px;

  --radius-pill: 999px;
}

@media (max-width: 767px) {
  :root {
    --header-h: 152px;
    --logo-w: 152px;
  }
}

/* --- Reset ------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-secondary);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

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

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-primary);
  font-weight: 500;
  line-height: 1.25;
}

h1 { font-size: 64px; }
h2 { font-size: 56px; }
h3 { font-size: 48px; }
h4 { font-size: 40px; }

@media (max-width: 767px) {
  h1 { font-size: 40px; }
  h2 { font-size: 36px; }
  h3 { font-size: 32px; }
  h4 { font-size: 28px; }
}

/* Titre de niveau h3 appliqué à un h1 réel, pour garder la hiérarchie
   sémantique sans changer l'échelle visuelle du site d'origine. */
.h3 {
  font-size: 48px;
}

@media (max-width: 767px) {
  .h3 {
    font-size: 32px;
  }
}

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

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- Boutons ----------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 40px;
  border: 1px solid var(--ink);
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-secondary);
  font-size: 14px;
  line-height: 1.35;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  background: rgb(29, 30, 32);
  border-color: rgb(29, 30, 32);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
}

.btn--ghost:hover {
  background: rgb(29, 30, 32);
  color: var(--paper);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  background: rgb(184, 184, 184);
  border-color: rgb(184, 184, 184);
  color: var(--paper);
  cursor: not-allowed;
}

@media (max-width: 767px) {
  .btn {
    padding: 14px 36px;
  }
}

/* --- Header ------------------------------------------------------------ */

.header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--paper);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: var(--header-h);
}

.header__logo img {
  width: var(--logo-w);
  height: auto;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 24px;
  /* Le logo reste à gauche, tout le reste est poussé à droite. */
  margin-left: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  padding: 2px 0;
  border-bottom: 1px solid transparent;
  font-size: 16px;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  border-bottom-color: var(--ink);
}

.socials {
  display: flex;
  align-items: center;
  gap: 20px;
}

.socials a {
  display: flex;
  color: var(--ink);
  transition: color 0.2s ease;
}

.socials a:hover {
  color: rgb(58, 58, 58);
}

.socials svg {
  width: 20px;
  height: 20px;
}

.cart-link {
  position: relative;
  display: flex;
  align-items: center;
  border: 0;
  background: none;
  padding: 0;
}

.cart-link svg {
  width: 24px;
  height: 24px;
}

.cart-link__count {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  font-weight: 500;
  line-height: 17px;
  text-align: center;
}

.cart-link__count[hidden] {
  display: none;
}

.burger {
  display: none;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
}

.burger span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

@media (max-width: 767px) {
  .burger {
    display: block;
  }

  .header__nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: flex-end;
    gap: 20px;
    padding: 24px 16px 32px;
    background: var(--paper);
    border-bottom: 1px solid var(--line-faint);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .header__nav[data-open="true"] {
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links {
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
  }

  /* Ordre mobile d'origine : logo — panier — burger. */
  .header__cart {
    order: 2;
    margin-left: auto;
  }

  .burger {
    order: 3;
  }
}

/* --- Splash (page d'entrée) -------------------------------------------- */

.splash {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 16px;
  background: url("../img/splash-bg.jpg") center / cover no-repeat;
}

.splash::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.37);
}

/* Un lien est « inline » par défaut : min-width y est sans effet et le texte
   se décale. En flex, il est réellement centré à toutes les largeurs. */
.splash__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 143px;
  padding: 15px 32px;
  text-align: center;
  border: 1px solid var(--ink);
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--paper);
  font-size: 16px;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.splash__btn:hover {
  background: rgba(0, 0, 0, 0.64);
  border-color: rgba(0, 0, 0, 0.64);
}

/* --- Hero vidéo -------------------------------------------------------- */

.hero {
  padding: 16px 0;
}

/* Le cadre épouse le format de la vidéo source — 4:3 (960 × 720). C'est ce qui
   fait disparaître les bandes noires : le lecteur Vimeo « contient » toujours
   la vidéo dans l'iframe, donc tout cadre d'un autre format laisse du vide sur
   deux côtés. Ici il n'y a plus de vide, et rien n'est rogné.
   Si la vidéo est remplacée un jour, reporter ici le format de la nouvelle. */
.hero__frame {
  position: relative;
  width: 100%;
  max-width: 1129px;
  margin: 24px auto 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--paper);
}

.hero__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 767px) {
  .hero__frame {
    margin-top: 0;
  }
}

/* --- Grille produits --------------------------------------------------- */

.shop {
  padding: 100px 16px;
}

@media (max-width: 767px) {
  .shop {
    padding: 16px;
  }
}

.shop__inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
}

.shop__toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 14px;
}

.shop__toolbar select {
  padding: 4px 8px;
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}

/* minmax(0, 1fr) et non 1fr : sans ça, un titre long élargit sa colonne. */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

@media (max-width: 767px) {
  .product-grid {
    column-gap: 26px;
    row-gap: 41px;
  }
}

.product-card {
  display: flex;
  flex-direction: column;
  text-align: center;
}

.product-card__media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--line-faint);
}

.product-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.35s ease;
}

/* Deuxième visuel révélé au survol (imageHoverEffect: swap_image). */
.product-card__media img + img {
  opacity: 0;
}

.product-card:hover .product-card__media img + img {
  opacity: 1;
}

.product-card__title {
  margin: 20px 0 8px;
  font-family: var(--font-primary);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.25;
  color: rgb(26, 26, 26);
}

.product-card__price,
.product-card__soldout {
  margin: 0;
  font-size: 16px;
  color: rgb(26, 26, 26);
}

.product-card__soldout {
  text-transform: uppercase;
}

/* Emplacement toujours réservé — le bouton n'apparaît qu'au survol, et
   seulement si la pièce est en stock (comportement de la boutique d'origine). */
.product-card__action {
  display: block;
  height: 59px;
  padding-top: 16px;
}

.product-card__action .btn {
  width: 100%;
  padding-top: 10px;
  padding-bottom: 10px;
  opacity: 0;
  transition: opacity 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.product-card:hover .product-card__action .btn,
.product-card:focus-visible .product-card__action .btn {
  opacity: 1;
}

@media (hover: none) {
  .product-card__action .btn {
    opacity: 1;
  }
}

@media (max-width: 767px) {
  .product-card__title {
    margin-top: 16px;
    font-size: 20px;
  }
}

/* --- Fiche produit ----------------------------------------------------- */

.product {
  padding: 100px 16px;
}

@media (max-width: 767px) {
  .product {
    padding: 56px 16px;
  }
}

.product__inner {
  display: grid;
  grid-template-columns: minmax(0, 600px) minmax(0, 1fr);
  gap: 80px;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
}

@media (max-width: 899px) {
  .product__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
}

.gallery__stage {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--line-faint);
}

.gallery__stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery__arrow {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.gallery__arrow:hover {
  background: var(--paper);
}

.gallery__arrow--prev { left: 12px; }
.gallery__arrow--next { right: 12px; }

.gallery__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.gallery__thumb {
  width: 64px;
  height: 64px;
  padding: 0;
  border: 1px solid transparent;
  background: none;
  overflow: hidden;
}

.gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery__thumb[aria-current="true"] {
  border-color: var(--ink);
}

.product__title {
  font-size: 48px;
}

@media (max-width: 767px) {
  .product__title {
    font-size: 32px;
  }
}

.product__price {
  margin: 16px 0 0;
  color: var(--ink-soft);
  font-size: 18px;
}

.product__option {
  margin-top: 32px;
}

.product__option label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.product__option select {
  width: 100%;
  max-width: 340px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  font: inherit;
  color: var(--ink);
}

.product__actions {
  margin-top: 24px;
}

.product__feedback {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.product__feedback:empty {
  margin: 0;
}

/* --- Panier ------------------------------------------------------------ */

.cart {
  padding: 100px 16px;
  min-height: 50vh;
}

@media (max-width: 767px) {
  .cart {
    padding: 56px 16px;
  }
}

.cart__inner {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
}

.cart__title {
  margin-bottom: 32px;
  text-align: center;
}

.cart__line {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-faint);
}

.cart__line img {
  width: 88px;
  height: 110px;
  object-fit: cover;
}

.cart__line-name {
  font-size: 16px;
}

.cart__line-meta {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-size: 14px;
}

.cart__qty {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.cart__qty button {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: none;
  line-height: 1;
}

.cart__line-remove {
  border: 0;
  background: none;
  padding: 0;
  color: var(--ink-muted);
  font-size: 13px;
  text-decoration: underline;
}

.cart__total {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  font-size: 18px;
}

.cart__checkout {
  margin-top: 24px;
  text-align: center;
}

.cart__note {
  margin-top: 12px;
  color: var(--ink-muted);
  font-size: 13px;
  text-align: center;
}

.cart__empty {
  padding: 40px 0;
  text-align: center;
  color: var(--ink-muted);
}

/* --- Formulaire de contact --------------------------------------------- */

.contact {
  padding: 80px 16px;
}

@media (max-width: 767px) {
  .contact {
    padding: 40px 16px;
  }
}

.contact__title {
  margin-bottom: 40px;
  text-align: center;
}

.form {
  width: 100%;
  max-width: 606px;
  margin: 0 auto;
}

.form__field {
  margin-bottom: 22px;
}

.form__field label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.form__field input,
.form__field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  font: inherit;
  font-size: 16px;
  color: var(--ink);
}

.form__field input::placeholder,
.form__field textarea::placeholder {
  color: var(--placeholder);
}

.form__field input:focus,
.form__field textarea:focus {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}

.form__field textarea {
  min-height: 108px;
  resize: vertical;
}

.form__error {
  display: block;
  margin-top: 6px;
  color: rgb(214, 49, 99);
  font-size: 13px;
}

.form__error:empty {
  display: none;
}

.form__submit {
  text-align: center;
}

.form__status {
  margin-top: 16px;
  text-align: center;
  font-size: 15px;
}

/* --- Footer ------------------------------------------------------------ */

.footer {
  padding: 40px 16px;
}

.footer__inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  /* Reprend le calage du site d'origine : bloc contacts à 192px du bord,
     icônes sociales à 950px, dans un conteneur de 1224px. */
  padding-left: 192px;
  padding-right: 164px;
}

@media (max-width: 1023px) {
  .footer__inner {
    padding-left: 0;
    padding-right: 0;
  }
}

@media (max-width: 767px) {
  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
  }
}

.footer__title {
  margin-bottom: 8px;
  font-family: var(--font-primary);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
}

@media (max-width: 767px) {
  .footer__title {
    font-size: 18px;
  }
}

.footer p {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.3;
}

.footer p:last-child {
  margin-bottom: 0;
}

@media (max-width: 767px) {
  .footer p {
    font-size: 16px;
  }
}

.footer .socials svg {
  width: 21px;
  height: 21px;
}

/* --- Page 404 ---------------------------------------------------------- */

.notfound {
  padding: 120px 16px;
  text-align: center;
}

.notfound p {
  margin: 16px 0 32px;
  color: var(--ink-muted);
}

/* --- Tunnel de commande ------------------------------------------------- */

.cart__promo {
  margin: 24px 0;
}

.cart__promo label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.cart__promo-row {
  display: flex;
  gap: 8px;
}

.cart__promo-row input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.cart__promo-status {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.cart__total--discount span:last-child {
  color: var(--ink-soft);
}

.cart__total--grand {
  padding-top: 12px;
  border-top: 1px solid var(--line-faint);
  font-size: 20px;
}

.cart__form {
  margin-top: 40px;
}

.cart__form-title {
  margin-bottom: 24px;
  font-size: 28px;
}

.cart__form .form__field select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  font: inherit;
  font-size: 16px;
  color: var(--ink);
}

.cart__done {
  padding: 40px 0;
  text-align: center;
}

.cart__done p {
  margin: 12px 0;
}
