/* ============================================================
   seo-fixes.css — Correctifs SEO/UX frontend
   À inclure dans main.css ou charger séparément dans base.twig
   ============================================================ */


/* ── 1. TOUCH TARGETS MOBILE ──────────────────────────────── */
/* Tous les boutons et liens-boutons : min 48×48px (WCAG 2.5.5) */

.uk-button,
.alf-btn,
.alf-tel-btn,
[class*="uk-button"] {
  min-height: 48px;
  min-width: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-left: 1.2em;
  padding-right: 1.2em;
}

/* Liens de navigation dans le menu mobile */
.uk-navbar-nav > li > a,
.uk-nav > li > a {
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* Lien téléphone header */
.alf-tel-link {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.alf-tel-link:hover,
.alf-tel-link:focus {
  text-decoration: underline;
}


/* ── 2. HEADER STICKY COMPACT SUR MOBILE ─────────────────── */
/* Réduit le padding et la taille du logo sur petits écrans    */

@media (max-width: 960px) {

  .uk-navbar-container {
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .uk-navbar-left .uk-logo img,
  .uk-navbar-left .uk-logo svg {
    height: 30px;
    width: auto;
  }

  /* Header sticky : reste compact en position fixe */
  .uk-sticky-fixed .uk-navbar-container {
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .uk-sticky-fixed .uk-logo img {
    height: 28px;
  }
}


/* ── 3. BOUTON FLOTTANT MOBILE (CTA appel) ────────────────── */

.alf-mobile-cta {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
}

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

  /* Masquer le sticky devis sur mobile — "Appeler" prend le relais */
  #sticky-cta {
    display: none !important;
  }

  /* Marge basse sur les pages pour éviter que le CTA masque du contenu */
  body {
    padding-bottom: 80px;
  }
}

.alf-mobile-cta__link {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #e63946;
  color: #fff;
  padding: 13px 20px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  min-height: 48px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.alf-mobile-cta__link:hover,
.alf-mobile-cta__link:focus {
  background: #c1121f;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  text-decoration: none;
  color: #fff;
}

.alf-mobile-cta__link svg {
  flex-shrink: 0;
}


/* ── 4. FACADE YOUTUBE ────────────────────────────────────── */

.alf-yt-facade:hover .alf-yt-facade__play {
  background: rgb(255, 0, 0) !important;
}

.alf-yt-facade:focus-visible {
  outline: 3px solid #005fcc;
  outline-offset: 2px;
}


/* ── 5. IMAGES : ratio de réserve pour éviter layout shift ── */
/* Évite le Cumulative Layout Shift (CLS) avant chargement     */

img {
  max-width: 100%;
  height: auto;
}

/* Bloc image avec dimensions connues : reserve l'espace */
img[width][height] {
  aspect-ratio: attr(width) / attr(height);
}


/* ── 6. PAGES PRODUIT ─────────────────────────────────── */

/* Typographie produit — échelle modeste (sous-section, pas top-section) */
.alf-product-main {
  font-size: 17px;
  line-height: 1.8;
  color: #264946;
}
.alf-product-main h1 {
  font-size: 2rem;
  line-height: 1.3;
}
@media (min-width: 960px) {
  .alf-product-main h1 {
    font-size: 2.5rem;
  }
}
.alf-product-main h2 {
  font-size: 1.625rem;
}
@media (min-width: 960px) {
  .alf-product-main h2 {
    font-size: 1.75rem;
  }
}
.alf-product-main .uk-margin-xlarge-top {
  margin-top: 40px !important;
}

/* Bouton Devis — plein vert (primaire) */
.alf-btn-sm {
  font-size: 0.9rem;
  padding: 12px 20px;
  min-height: 48px;
  border-radius: 0;
  cursor: pointer;
}

/* Bouton générique alf-button — cursor pointer */
.alf-button {
  cursor: pointer;
}

/* Bouton PDF — outline vert (secondaire) */
.alf-btn-pdf {
  background: transparent;
  color: #b2c034;
  border: 2px solid #b2c034;
  border-radius: 0;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 12px 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  text-decoration: none;
  text-align: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.alf-btn-pdf:hover,
.alf-btn-pdf:focus {
  background: #b2c034;
  color: #fff;
  text-decoration: none;
}

/* Teaser produit */
.alf-product-teaser {
  font-size: 1.05rem;
  color: #264946;
}

/* Cards produits similaires — clickable */
.alf-product-main .alf-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  height: 100%;
}
.alf-product-main .alf-card-link:hover {
  text-decoration: none;
  color: inherit;
}
.alf-product-main .uk-card {
  border-radius: 0;
  overflow: hidden;
  cursor: pointer;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.alf-product-main .uk-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #264946;
  line-height: 1.3;
  margin-bottom: 4px;
}
.alf-product-main .uk-card-title .alf-card-category {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7c7a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.alf-product-main .uk-card-media-top {
  background: #fff;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  padding: 10px;
  box-sizing: border-box;
}
.alf-product-main .uk-card-media-top img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.alf-product-main .uk-card-body {
  flex: 1;
  text-align: center;
}
.alf-product-main .alf-card-features {
  text-align: left;
  margin-top: 10px;
  margin-bottom: 14px;
}
.alf-product-main .alf-card-features li {
  display: flex;
  align-items: baseline;
  font-size: 0.8rem;
  color: #555;
  line-height: 1.4;
}
.alf-product-main .alf-card-features li img {
  width: 6px;
  height: 9px;
  flex-shrink: 0;
  position: relative;
  top: 1px;
}
.alf-product-main .uk-card-body .alf-button-product {
  width: 100%;
  margin-top: auto;
}
.alf-product-main .uk-card:hover .alf-button-product {
  border-color: #264946;
  color: #264946;
}

/* H2 section produits similaires */
.alf-product-main .alf-section-title {
  position: relative;
  padding-bottom: 12px;
  margin-bottom: 8px;
}
.alf-product-main .alf-section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: #b2c034;
  border-radius: 2px;
}

/* Badges/pictos — section flat sur fond blanc, alignée sur le langage de la home */
.alf-badges-section {
  padding: 30px 20px;
}
.alf-badges-row {
  gap: 20px;
}
.alf-badge {
  background: #fff;
  border-radius: 0;
  padding: 24px 20px;
}
.alf-badge-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 16px;
}
.alf-badge-title {
  font-weight: 700;
  font-size: 16px;
  color: #2b2e32;
  margin-bottom: 8px;
}
.alf-badge-desc {
  font-size: 14px;
  color: #1c1a1a;
  line-height: 1.6;
}

/* Galerie produit (style Prosignal) */
.alf-gallery-main {
  display: block;
  position: relative;
  border-radius: 0;
  overflow: hidden;
  cursor: zoom-in;
  border: 1px solid #e8e8e8;
  background: #fff;
}
.alf-gallery-main img {
  display: block;
  width: 100%;
  height: auto;
}
.alf-gallery-main::after {
  content: "";
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  background: rgba(38, 73, 70, 0.6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Ccircle fill='none' stroke='%23fff' stroke-width='1.5' cx='9' cy='9' r='7'/%3E%3Cpath fill='none' stroke='%23fff' stroke-width='1.5' d='M14 14l4 4'/%3E%3Cpath fill='none' stroke='%23fff' stroke-width='1.5' d='M9 6v6M6 9h6'/%3E%3C/svg%3E") no-repeat center;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}
.alf-gallery-main:hover::after {
  opacity: 1;
}
.alf-gallery-thumbs {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.alf-gallery-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 0;
  border: 2px solid #e8e8e8;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, opacity 0.2s;
}
.alf-gallery-thumb:hover {
  opacity: 0.8;
}
.alf-gallery-thumb.active {
  border-color: #b2c034;
}


@media (max-width: 767px) {
  .alf-btn-pdf,
  .alf-btn-sm {
    width: 100%;
    justify-content: center;
  }
  .alf-product-main h1 {
    font-size: 1.75rem;
  }
  .alf-product-main h2 {
    font-size: 1.5rem;
  }

  /* Badges mobile — pleine largeur, compacts */
  .alf-badges-section {
    padding: 20px 12px;
  }
  .alf-badges-section .uk-grid > div {
    width: 100% !important;
  }
  .alf-badge {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    text-align: left;
  }
  .alf-badge-img {
    width: 50px;
    height: 50px;
    margin-bottom: 0;
    flex-shrink: 0;
  }
  .alf-badge-title {
    font-size: 14px;
    margin-bottom: 4px;
  }
  .alf-badge-desc {
    font-size: 13px;
  }
}
