/* =====================================================================
   DÉTAIL PRODUIT — mise en page compacte style Alibaba
   Ordinateur : [galerie + vendeur] [infos] [carte d'action collante]
   Tablette   : [galerie + vendeur] [infos + carte d'action]
   Mobile     : une colonne, diaporama existant
   Couleurs du thème TokTok conservées.
   ===================================================================== */

/* Page : largeur maximale et fond neutre */
.pd.container-detaileproduit {
    max-width: calc(1320px + var(--raf-barre, 60px));
    margin-top: 16px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 16px 24px calc(var(--raf-barre, 60px) + 16px);
    box-sizing: border-box;
    font-family: var(--font-family-base);
    color: var(--text-color);
}

/* Grille principale */
.pd-grille {
    display: grid;
    grid-template-columns: minmax(0, 470px) minmax(0, 1fr) 300px;
    grid-template-areas: "media infos action";
    gap: 20px;
    align-items: start;
    margin-top: 12px;
}
.pd-col-media { grid-area: media; min-width: 0; }
.pd-col-infos { grid-area: infos; min-width: 0; }
.pd-col-action { grid-area: action; min-width: 0; }

/* ---------- Galerie (ordinateur) ---------- */
.pd-galerie {
    position: relative;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
}
/* Colonne de vignettes (défilante si beaucoup de photos) */
.pd-vignettes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 412px;
    overflow-y: auto;
    scrollbar-width: none;
}
.pd-vignettes::-webkit-scrollbar { display: none; }
.pd-vignette {
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s ease;
}
.pd-vignette img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    color: transparent;
}
.pd-vignette--active,
.pd-vignette:hover {
    border: 2px solid var(--titre-color);
}
/* Grande image carrée, photo entière sur fond clair */
.pd-image-principale {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    background: #f5f5f5;
    overflow: hidden;
}
.pd-image-principale img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    color: transparent;
}
.pd-sans-media {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    margin: 0;
    font-size: 13px;
    color: #6b7280;
}
/* Flèches rondes sur la grande image */
.pd-fleche {
    position: absolute;
    top: 50%;
    width: 32px;
    height: 32px;
    margin-top: -16px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
    font-size: 20px;
    line-height: 1;
    color: #111827;
    cursor: pointer;
}
.pd-fleche--prec { left: 10px; }
.pd-fleche--suiv { right: 10px; }

/* Diaporama mobile masqué sur grand écran */
.pd .mobile-media-container { display: none; }

/* ---------- Carte vendeur ---------- */
.pd-vendeur {
    margin-top: 14px;
    padding: 12px;
    border-radius: 12px;
    background: #f7f7f8;
}
.pd-vendeur-tete {
    display: flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
}
.pd-vendeur-photo {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #e5e7eb;
}
.pd-vendeur-photo--vide {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--titre-color);
}
.pd-vendeur-texte {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}
.pd-vendeur-nom {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: underline;
    color: #111827;
}
.pd-vendeur-meta {
    font-size: 11.5px;
    color: #6b7280;
}
.pd-vendeur-fleche { color: #9ca3af; }
.pd-vendeur-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 10px;
    padding: 10px;
    border-radius: 10px;
    background: #ffffff;
}
.pd-vendeur-stats div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.pd-vendeur-stats strong {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
}
.pd-vendeur-stats span {
    font-size: 11px;
    color: #6b7280;
}

/* ---------- Colonne infos ---------- */
.pd-titre {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
    color: #1c2b33;
}
.pd-sous-ligne {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 6px 0 10px;
    font-size: 12.5px;
    color: #4b5563;
}
.pd-sep { color: #d1d5db; }
.pd-etoiles {
    color: #f59e0b;
    letter-spacing: 1px;
    font-size: 13px;
}
.pd-etoile-vide { color: #d1d5db; }
.pd-lien-vendeur {
    color: #1677ff;
    text-decoration: underline;
}
.pd-type { color: #6b7280; }

/* Bloc prix (séparé par des filets, comme Alibaba) */
.pd-prix-bloc {
    padding: 12px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}
.pd-promo-etiquette {
    display: inline-block;
    margin-bottom: 6px;
    padding: 2px 6px;
    background: #dc2626;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
}
.pd-prix {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
}
.pd-prix-montant {
    font-size: 24px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
    color: #111827;
    font-variant-numeric: tabular-nums;
}
.pd-prix-devise {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
}
.pd-prix-barre {
    font-size: 13px;
    color: #9ca3af;
    text-decoration: line-through;
}
.pd-commission {
    margin: 6px 0 0;
    font-size: 12px;
    font-weight: 500;
    color: #1677ff;
}
/* Paliers de réduction / tarifs (colonnes comme les prix par quantité) */
.pd-paliers {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 10px;
}
.pd-palier {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.pd-palier strong {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}
.pd-palier span {
    font-size: 11.5px;
    color: #6b7280;
}
.pd-palier-titre {
    margin: 6px 0 0;
    font-size: 11.5px;
    color: #6b7280;
}
.pd-alerte {
    margin: 10px 0 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fef3c7;
    font-size: 12.5px;
    color: #92400e;
}

/* Sections (Couleur, Taille, Attributs, Description) */
.pd-section {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}
.pd-section:last-child { border-bottom: none; }
.pd-section-titre {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
    color: #1c2b33;
}
.pd-pastilles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.pd-couleur {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    box-shadow: inset 0 0 0 2px #ffffff;
}
.pd-taille {
    padding: 4px 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 12.5px;
    color: #111827;
    background: #ffffff;
}
.pd-equipements { margin-top: 10px; }

/* Attributs clés : grille 3 colonnes sur fond gris clair */
.pd-attributs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 16px;
    padding: 12px;
    border-radius: 10px;
    background: #f7f7f8;
}
.pd-attributs div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.pd-attributs span {
    font-size: 11.5px;
    color: #6b7280;
}
.pd-attributs strong {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    overflow-wrap: anywhere;
}

/* Liste (tranches) */
.pd-liste {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
}
.pd-statut {
    margin-left: 6px;
    font-size: 12px;
    color: #4b5563;
}

/* Description */
.pd-description {
    font-size: 13px;
    line-height: 1.55;
    color: #1c2b33;
}

/* ---------- Carte d'action (droite, collante) ---------- */
.pd-action {
    position: sticky;
    top: calc(var(--header-total-height, 90px) + 12px);
    padding: 14px;
    border: 1px solid #e4e6eb;
    border-radius: 10px;
    background: var(--bg-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.pd-action-bloc {
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}
.pd-action-titre {
    margin: 0 0 6px;
    font-size: 13.5px;
    font-weight: 600;
    color: #111827;
}
.pd-action-texte {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.45;
    color: #4b5563;
}
.pd-garanties {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.pd-garanties li {
    display: flex;
    gap: 8px;
    font-size: 12px;
    line-height: 1.4;
    color: #4b5563;
}
.pd-garanties i {
    flex: 0 0 auto;
    margin-top: 2px;
    color: #16a34a;
}
.pd-garanties strong {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #111827;
}

/* Boutons (pilule pleine + contour, comme Alibaba ; couleur des boutons du site) */
.pd-boutons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pd-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    transition: filter 0.15s ease, background 0.15s ease;
}
.pd-btn--plein {
    border: none;
    background: #007bff;
    color: #ffffff;
}
.pd-btn--plein:hover { filter: brightness(1.06); }
.pd-btn--plein:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}
.pd-btn--contour {
    border: 1px solid #1c2b33;
    background: #ffffff;
    color: #111827;
}
.pd-btn--contour:hover { background: #f9fafb; }
.pd-btn--whatsapp {
    border: 1px solid #25d366;
    background: #ffffff;
    color: #128c4a;
}
.pd-btn--whatsapp:hover { background: #f0fdf4; }
.pd-action-note {
    margin: 10px 0 0;
    font-size: 11px;
    line-height: 1.4;
    color: #9ca3af;
}

/* Titre des produits similaires */
.pd-similaires-titre {
    margin: 24px 0 8px;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

/* ---------- Tablette : carte d'action sous les infos ---------- */
@media (max-width: 1099px) {
    .pd-grille {
        grid-template-columns: minmax(0, 400px) minmax(0, 1fr);
        grid-template-areas:
            "media infos"
            "media action";
    }
    .pd-action { position: static; }
    .pd-attributs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Mobile : une colonne, diaporama existant ---------- */
@media (max-width: 768px) {
    .pd.container-detaileproduit {
        padding: 0 10px 24px;
        margin-left: 0;
        margin-right: 0;
    }
    .pd-grille {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "media"
            "infos"
            "action";
        gap: 12px;
        margin-top: 6px;
    }
    .pd-galerie { display: none; }
    .pd .mobile-media-container {
        display: flex;
        justify-content: center;
        border-radius: 12px;
        background: #f5f5f5;
    }
    .pd .post-media-mobile { height: 300px; }
    .pd-titre { font-size: 16px; }
    .pd-prix-montant { font-size: 24px; }
    .pd-attributs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pd-action {
        padding: 14px;
        box-shadow: none;
    }
}
