.speedimp-formats {
    padding: 18px;
    background: #f8faf9;
    border: 1px solid #dce8df;
    border-radius: 12px;
    margin-bottom: 20px;
}

.speedimp-formats h3 {
    color: #16803c;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
}

.speedimp-formats-choix {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.speedimp-formats-choix button {
    padding: 9px 14px;
    background: #fff;
    border: 1px solid #cbd5d1;
    border-radius: 7px;
    cursor: pointer;
}

.speedimp-formats-choix button.actif {
    background: #16803c;
    color: #fff;
    border-color: #16803c;
}

.speedimp-format-apercu {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 15px;
    min-height: 155px;
}

#speedimp-format-visuel {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 145px;
}

.speedimp-format-feuille {
    background: white;
    border: 2px solid #16803c;
    box-shadow: 3px 4px 8px rgba(0,0,0,.12);
    flex-shrink: 0;
}

#speedimp-format-dimensions {
    font-weight: 600;
    color: #334155;
}

@media (max-width: 480px) {
    .speedimp-format-apercu {
        gap: 12px;
    }
}

/* Speedimptarif — harmonisation graphique avec Speedthese */
.speedimp-formats {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
}

.speedimp-formats h3 {
    color: #00853f;
    font-weight: 700;
    text-align: left;
    font-size: 17px;
}

.speedimp-formats-choix button {
    background: #fff;
    color: #333;
    border: 2px solid #dedede;
    border-radius: 8px;
    padding: 10px 15px;
    font-weight: 600;
    transition: background-color .15s, border-color .15s;
}

.speedimp-formats-choix button:hover {
    border-color: #16833a;
}

.speedimp-formats-choix button.actif {
    background: #16833a;
    color: #fff;
    border-color: #16833a;
}

.speedimp-impression {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #e5e5e5;
}

.speedimp-format-feuille {
    border-color: #16833a;
}

/* Sélecteur illustré Noir et blanc / Couleur */
.speedimp-couleur {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #e5e5e5;
}

.speedimp-couleur-choix {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.speedimp-couleur-choix button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: #fff;
    color: #333;
    border: 2px solid #dedede;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.speedimp-couleur-choix button img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.speedimp-couleur-choix button:hover {
    border-color: #16833a;
}

.speedimp-couleur-choix button.actif {
    background: #16833a;
    color: #fff;
    border-color: #16833a;
}

/* Papiers réservés au noir et blanc */
.speedimp-grammage-choix button:disabled {
    opacity: .35;
    cursor: not-allowed;
    background: #f2f2f2;
    color: #777;
    border-color: #ddd;
}

/* Pelliculage illustré — présentation identique au Livre */
.speedimp-pelliculage-choix {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.speedimp-pelliculage-choix button {
    min-width: 0;
    padding: 10px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
}

.speedimp-pelliculage-choix button img {
    display: block;
    width: 100%;
    max-height: 110px;
    object-fit: contain;
    margin: 8px auto;
}

.speedimp-pelliculage-choix button strong {
    display: block;
    font-size: 13px;
}

.speedimp-pelliculage-choix button.actif {
    border-color: #16833a;
    background: #edf7f0;
}

.speedimp-pelliculage[hidden] {
    display: none !important;
}

/* Pelliculage désactivé hors 350 g */
.speedimp-pelliculage-inactif .speedimp-pelliculage-choix {
    opacity: .4;
}
.speedimp-pelliculage-inactif .speedimp-pelliculage-choix button {
    cursor: not-allowed;
}
.speedimp-pelliculage h3 small {
    font-size: 12px;
    font-weight: 400;
    color: #777;
}

/* Description dynamique du papier */
#speedimp-infos-papiers {
    margin-top: 14px;
    padding: 16px 18px;
    background: #edf7f0;
    border: 1px solid #c9e8d1;
    border-left: 4px solid #16833a;
    border-radius: 8px;
}
.speedimp-info-papier[hidden] { display: none !important; }
.speedimp-info-papier strong {
    display: block;
    color: #00853f;
    margin-bottom: 6px;
}
.speedimp-info-papier p {
    margin: 0;
    line-height: 1.55;
}

/* Tableau des quantités Flyers — présentation du Livre */
#speedimp-tableau-quantites {
    margin-bottom: 24px;
}

#speedimp-tableau-quantites h3 {
    color: #11853b;
    font-size: 17px;
    font-weight: 700;
    text-align: left;
    margin-bottom: 12px;
}

.speedimp-quantites-grille {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.speedimp-quantite-entete {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    font-weight: 700;
}

.speedimp-quantite-ligne {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    color: #333;
}

.speedimp-quantite-ligne:hover {
    border-color: #16833a;
}

.speedimp-quantite-ligne.actif {
    border: 2px solid #16833a;
    background: #edf7f0;
}

.speedimp-quantite-prix {
    color: #11853b;
    font-weight: 700;
}

.speedimp-quantite-personnalisee {
    margin-top: 15px;
    padding: 16px;
    background: #f7f9f8;
    border: 1px solid #d5e5da;
    border-radius: 10px;
}

.speedimp-quantite-personnalisee label {
    display: block;
    color: #11853b;
    font-weight: 700;
    margin-bottom: 10px;
}

#speedimp-quantite-saisie {
    width: 110px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

#speedimp-prix-personnalise {
    color: #11853b;
    margin-left: 12px;
}

.speedimp-quantite-personnalisee small {
    display: block;
    margin-top: 10px;
}

/* Speedimptarif — configurateur sur deux colonnes */
.speedimp-colonnes {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: start;
}

.speedimp-options {
    min-width: 0;
}

.speedimp-colonne-prix {
    min-width: 0;
    position: sticky;
    top: 20px;
}

@media (max-width: 991px) {
    .speedimp-colonnes {
        grid-template-columns: 1fr;
    }

    .speedimp-colonne-prix {
        position: static;
    }
}

/* Produit 7 — masquer les éléments d'achat PrestaShop natifs */
body.product-id-7 .product-prices,
body.product-id-7 .product-add-to-cart,
body.product-id-7 .product-quantity,
body.product-id-7 .product-actions .add-to-cart,
body.product-id-7 .wishlist-button-add {
    display: none !important;
}

/* Flyers — structure identique au Livre */
.speedimp-colonnes {
    display: grid;
    grid-template-columns: minmax(420px, 2fr) minmax(320px, 1fr);
    gap: 30px;
    align-items: start;
    width: 100%;
    box-sizing: border-box;
}

.speedimp-options,
.speedimp-colonne-prix {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 25px;
    box-sizing: border-box;
    min-width: 0;
}

.speedimp-colonne-prix {
    position: sticky;
    top: 20px;
    height: fit-content;
}

@media (max-width: 850px) {
    .speedimp-colonnes {
        grid-template-columns: minmax(0, 1fr);
    }

    .speedimp-colonne-prix {
        position: static;
    }
}

/* Produit 7 — remplacer la fiche standard par Speedimptarif */
body.product-id-7 .js-product-container {
    display: none !important;
}

body.product-id-7 .speedimp-configurateur {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Flyers — zone de dépôt PDF */
.speedimp-pdf-section {
    margin-bottom: 24px;
}

.speedimp-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 180px;
    padding: 24px;
    border: 2px dashed #16833a;
    border-radius: 12px;
    background: #f2faf4;
    color: #333;
    text-align: center;
    cursor: pointer;
}

.speedimp-dropzone:hover,
.speedimp-dropzone.survol {
    background: #e4f4e8;
    border-color: #00853f;
}

.speedimp-drop-icon {
    font-size: 42px;
    color: #00853f;
}

#speedimp-pdf-nom {
    color: #00853f;
    font-weight: 700;
    overflow-wrap: anywhere;
}

#speedimp-pdf-apercu {
    margin-top: 20px;
}

#speedimp-pdf-frame {
    width: 100%;
    height: 450px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

#speedimp-pdf-apercu[hidden] {
    display: none !important;
}

/* Flyers — conserver le visualiseur des formats */
.speedimp-format-apercu {
    display: flex;
    align-items: center;
    min-height: 155px;
}

#speedimp-format-visuel {
    display: block;
    position: relative;
    width: 120px;
    min-width: 120px;
    height: 145px;
    flex: 0 0 120px;
}

#speedimp-format-dimensions {
    flex: 1;
    min-width: 0;
}

/* Adaptation PDF : même style que les descriptions de papier */
#speedimp-adaptation:not([hidden]) {
  display: block;
  background: #edf8ee;
  border: 1px solid #b9dfbe;
  border-radius: 12px;
  padding: 16px 20px;
  margin: 16px 0;
  color: #245c30;
}

#speedimp-adaptation strong {
  display: block;
  font-weight: 700;
  margin-bottom: 9px;
}

#speedimp-adaptation p {
  margin: 0 0 12px;
  line-height: 1.5;
}

#speedimp-adaptation label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

#speedimp-adaptation input[type="checkbox"] {
  margin-top: 4px;
  accent-color: #27843c;
}

/* Formats non disponibles après analyse du PDF */
.speedimp-formats-choix button:disabled {
  background: #d5d5d5 !important;
  border: 2px solid #b7b7b7 !important;
  color: #858585 !important;
  opacity: 0.55 !important;
  filter: grayscale(100%) !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
}

.speedimp-formats-choix button:disabled * {
  color: #858585 !important;
}


/* Explication affichée après tentative de sélection */
#speedimp-info-formats-bloques:not([hidden]) {
  display: block;
  background: #f1f1f1;
  border: 1px solid #d5d5d5;
  border-radius: 10px;
  padding: 12px 15px;
  margin: 12px 0;
  color: #555;
  font-size: 13px;
  line-height: 1.5;
}

/* Format incompatible : aspect désactivé, clic explicatif autorisé */
.speedimp-formats-choix button.speedimp-format-bloque {
  background: #d5d5d5 !important;
  border: 2px solid #b7b7b7 !important;
  color: #858585 !important;
  opacity: 0.55 !important;
  filter: grayscale(100%) !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
}
.speedimp-formats-choix button.speedimp-format-bloque * {
  color: #858585 !important;
}

/* Messages de format : présentation identique */
#speedimp-adaptation:not([hidden]),
#speedimp-info-formats-bloques:not([hidden]) {
  font-size: 13px;
  line-height: 1.5;
  padding: 12px 15px;
  margin: 12px 0;
}

/* Aperçu PDF.js — Flyers */
#speedimp-pdf-frame.speedimp-pages-pdf {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  padding: 15px;
  background: #f3f4f5;
  border-radius: 10px;
}

.speedimp-page-pdf {
  position: relative;
  max-width: 100%;
  height: auto;
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
}

.speedimp-page-pdf canvas {
  display: block;
  max-width: 100%;
}

.speedimp-zone-jaune {
  position: absolute;
  border: 2px dashed #e6b800;
  background: rgba(255, 215, 0, .10);
  pointer-events: none;
  box-sizing: border-box;
}

#speedimp-zone-acceptation:not([hidden]) {
  display: block;
  margin-top: 15px;
  padding: 12px 15px;
  background: #edf8ee;
  border: 1px solid #b9dfbe;
  border-radius: 10px;
  font-size: 13px;
}

#speedimp-zone-acceptation label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

#speedimp-zone-acceptee {
  margin-top: 3px;
  accent-color: #27843c;
}


/* Correction aperçu PDF.js : hauteur automatique */
#speedimp-pdf-frame.speedimp-pages-pdf {
  height: auto !important;
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.speedimp-page-pdf {
  flex-shrink: 0;
}

/* Zone de tranquillité : zone extérieure jaune hachurée */
.speedimp-page-pdf {
  overflow: hidden !important;
}

.speedimp-zone-jaune {
  background: transparent !important;
  border: 2px dashed #e6b800 !important;
  box-shadow: 0 0 0 100px rgba(255, 215, 0, .18) !important;
  clip-path: none !important;
}

.speedimp-zone-jaune::before {
  content: "";
  position: absolute;
  inset: -100px;
  padding: 100px;
  box-sizing: border-box;
  pointer-events: none;
  background: repeating-linear-gradient(
    135deg,
    rgba(90, 90, 90, .28) 0px,
    rgba(90, 90, 90, .28) 2px,
    transparent 2px,
    transparent 8px
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
}

.speedimp-zone-jaune[hidden] {
  display: none !important;
}

/* SPEEDIMPTARIF — Zone PDF harmonisée avec Speedthese */
.speedimp-dropzone.speedimp-dropzone-pdf {
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    gap:8px;
    width:100%;
    min-height:180px;
    padding:20px;
    border:2px dashed #b8b8b8;
    border-radius:12px;
    background:#fafafa;
    cursor:pointer;
    transition:all .25s ease;
    box-sizing:border-box;
    text-align:center;
}

.speedimp-dropzone.speedimp-dropzone-pdf:hover {
    border-color:#00853f;
    background:#f2fff6;
    transform:scale(1.01);
}

.speedimp-dropzone-pdf .speedimp-drop-icon-svg svg {
    fill:none;
    stroke:#00853f;
    stroke-width:1.7;
    stroke-linecap:round;
    stroke-linejoin:round;
}

.speedimp-dropzone-pdf .speedimp-drop-title {
    font-size:24px;
    font-weight:bold;
    margin-bottom:2px;
}

.speedimp-dropzone-pdf .speedimp-drop-subtitle {
    font-size:16px;
    color:#666;
}

.speedimp-dropzone-pdf .speedimp-drop-link {
    color:#00853f;
    font-weight:bold;
    text-decoration:underline;
}

.speedimp-dropzone-pdf:hover .speedimp-drop-link {
    color:#00652e;
}

.speedimp-dropzone-pdf .speedimp-drop-filename {
    margin-top:10px;
    max-width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    font-size:15px;
    font-weight:bold;
    color:#00853f;
}


/* SPEEDIMPTARIF — Bouton ajouter au panier */
.speedimp-panier {
    margin-top: 24px;
    text-align: center;
}

.speedimp-btn-panier {
    display: block;
    width: 100%;
    padding: 17px 24px;
    background: #00853f;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 19px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s ease;
}

.speedimp-btn-panier:hover:not(:disabled) {
    background: #006b32;
}

.speedimp-btn-panier:disabled {
    background: #a9b5ae;
    cursor: not-allowed;
    opacity: .7;
}

#speedimp-panier-message {
    margin-top: 10px;
    font-size: 14px;
}


/* Speedimptarif — Choix du dépôt de fichier */
.speedimp-depot-choix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
  margin-bottom: 15px;
}

.speedimp-depot-choix > .speedimp-dropzone,
.speedimp-depot-choix > .speedimp-pdf-ulterieur {
  width: 100%;
  min-height: 160px;
  height: 100%;
  box-sizing: border-box;
}

.speedimp-pdf-ulterieur {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 20px;
  border: 2px dashed #b8ddc3;
  border-radius: 10px;
  background: #f8fcf9;
  cursor: pointer;
}

.speedimp-pdf-ulterieur:hover,
.speedimp-pdf-ulterieur:has(input:checked) {
  background: #edf7f0;
  border-color: #32854c;
}

.speedimp-pdf-ulterieur input {
  width: 20px;
  height: 20px;
  accent-color: #32854c;
}

.speedimp-ulterieur-titre {
  font-weight: 700;
  color: #245c38;
}

.speedimp-ulterieur-description {
  font-size: 12px;
  color: #555;
}

@media (max-width: 650px) {
  .speedimp-depot-choix {
    grid-template-columns: 1fr;
  }
}

/* Speedimptarif : deux blocs de dépôt côte à côte */
.speedimp-pdf-section .speedimp-depot-choix {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 16px !important;
    align-items: stretch !important;
    width: 100% !important;
}

.speedimp-pdf-section .speedimp-depot-choix > .speedimp-dropzone,
.speedimp-pdf-section .speedimp-depot-choix > .speedimp-pdf-ulterieur {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 175px !important;
    height: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

.speedimp-pdf-ulterieur .speedimp-ulterieur-titre {
    font-size: 17px !important;
    line-height: 1.4 !important;
    font-weight: 700 !important;
}

.speedimp-pdf-ulterieur .speedimp-ulterieur-description {
    font-size: 13px !important;
    line-height: 1.5 !important;
}

@media (max-width: 650px) {
    .speedimp-pdf-section .speedimp-depot-choix {
        grid-template-columns: 1fr !important;
    }
}


/* Speedimptarif — visualiseur de formats A3 à A6 */
.speedimp-format-apercu {
    min-height: 190px;
    align-items: center;
}

#speedimp-format-visuel {
    width: 145px;
    min-width: 145px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 145px;
}

#speedimp-format-visuel .speedimp-format-feuille {
    max-width: 100%;
    max-height: 100%;
    box-sizing: border-box;
}
.speedimp-quantite-personnalisee label { text-align: left !important; justify-self: start !important; margin-left: 0 !important; }


/* Validation de la zone de tranquillité */
#speedimp-zone-acceptation:not([hidden]) {
  padding: 16px 18px;
  background: #f0f9f2;
  border: 1px solid #b8dec2;
  border-left: 4px solid #298747;
  border-radius: 10px;
}
#speedimp-zone-acceptation label {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  width: 100%;
  margin: 0;
  text-align: left;
  cursor: pointer;
}
#speedimp-zone-acceptee {
  width: 21px;
  height: 21px;
  min-width: 21px;
  margin: 0;
  accent-color: #298747;
  cursor: pointer;
}
#speedimp-zone-acceptation .speedimp-zone-texte {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}
#speedimp-zone-acceptation .speedimp-zone-texte strong {
  color: #23733b;
  font-size: 15px;
  font-weight: 700;
}
#speedimp-zone-acceptation .speedimp-zone-texte small {
  color: #485b4d;
  font-size: 13px;
  line-height: 1.5;
}


