/* Fiche produit Batterieland (affiche_detail_article_MODELE.php). Chargé après brand.css. */

.pd {
    --pd-ink: #141c3d;
    --pd-ink-2: #4a5275;
    --pd-muted: #5d6487;
    --pd-plaque: #233da8;
    --pd-plaque-hover: #1b3190;
    --pd-rule: #dfe3f3;
    --pd-field: #c9cfe8;
    --pd-veil: #eef1fd;
    --pd-zebra: #f6f7fd;
    --pd-ok: #1d7a4b;
    --pd-wait: #9a5b00;
    --pd-ease: cubic-bezier(0.23, 1, 0.32, 1);
    --pd-sticky: 136px;
    --line: #4d67e8;
    --line-ink: #3550d6;

    max-width: 1240px;
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 40px) clamp(56px, 8vw, 104px);
    color: var(--pd-ink);
    font-family: "Barlow", "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 17px;
    line-height: 1.55;
    font-variant-numeric: tabular-nums;
}
.pd[data-line="c"] {
    --line: #965fc3;
    --line-ink: #7d45ad;
}
.pd ::selection { background: #e3d5f0; color: var(--pd-ink); }
.pd :focus-visible { outline: 3px solid #965fc3; outline-offset: 3px; border-radius: 4px; }

.pd svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

/* ---------- Fil d'Ariane ---------- */
.pd-crumbs {
    padding: 32px 0 16px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--pd-muted);
}
.pd-crumbs a,
.pd-crumbs .fil_14 {
    color: var(--pd-ink-2);
    font-size: inherit;
    text-decoration: none;
}
.pd-crumbs .noir_14 { color: var(--pd-muted); font-size: inherit; }
@media (hover: hover) and (pointer: fine) {
    .pd-crumbs a:hover { color: var(--pd-plaque); text-decoration: underline; text-underline-offset: 3px; }
}

/* ---------- Bloc principal ---------- */
.pd-main {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(360px, 5fr);
    gap: clamp(24px, 4vw, 56px);
    align-items: start;
}

.pd-gallery {
    position: sticky;
    top: calc(var(--pd-sticky) + 16px);
}
.pd-stage {
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1;
    padding: 8%;
    background: #fff;
    border-radius: 16px;
    box-shadow: inset 0 0 0 1px rgba(20, 28, 61, 0.06);
    overflow: hidden;
}
.pd-stage img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 180ms ease;
}
.pd-stage img.is-swapping { opacity: 0; }

.pd-thumbs {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}
.pd-thumb {
    width: 72px;
    height: 72px;
    padding: 6px;
    background: #fff;
    border: 0;
    border-radius: 10px;
    box-shadow: inset 0 0 0 1px var(--pd-rule);
    cursor: pointer;
    transition: box-shadow 160ms var(--pd-ease), transform 160ms var(--pd-ease);
}
.pd-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pd-thumb[aria-current="true"] { box-shadow: inset 0 0 0 2px var(--line); }
.pd-thumb:active { transform: scale(0.96); }

/* ---------- Colonne d'achat ---------- */
.pd-buy { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.pd .pd-title {
    margin: 0;
    font-family: "Barlow Semi Condensed", "Barlow", "Segoe UI", Arial, sans-serif;
    font-size: clamp(1.625rem, 2.4vw, 2.125rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: var(--pd-ink);
    text-align: left;
    text-wrap: balance;
}

.pd-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 20px;
    margin: -8px 0 0;
    font-size: 0.9375rem;
    color: var(--pd-muted);
}
.pd-stock {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}
.pd-stock::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}
.pd-stock--ok { color: var(--pd-ok); }
.pd-stock--ok::before { box-shadow: 0 0 0 4px rgba(29, 122, 75, 0.14); }
.pd-stock--delai { color: var(--pd-wait); }
.pd-stock--epuise { color: #b3261e; }

/* Bandeau énergie : dessiné comme un pack, les cellules portent les valeurs */
.pd-energy {
    position: relative;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(min-content, 1fr);
    margin: 0;
    background: #fff;
    border-radius: 14px;
    box-shadow: inset 0 0 0 1px var(--pd-rule);
}
.pd-energy__tile {
    padding: 14px 14px 12px;
    min-width: 0;
}
.pd-energy__tile + .pd-energy__tile { box-shadow: inset 1px 0 0 var(--pd-rule); }
.pd-energy dt {
    margin: 0 0 2px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--pd-muted);
    white-space: nowrap;
}
.pd-energy dd {
    margin: 0;
    font-family: "Barlow Semi Condensed", "Barlow", Arial, sans-serif;
    font-size: clamp(1.375rem, 2vw, 1.75rem);
    font-weight: 700;
    line-height: 1.1;
    color: var(--line-ink);
    white-space: nowrap;
}
.pd-energy abbr {
    font-size: 0.6em;
    font-weight: 600;
    text-decoration: none;
    color: var(--pd-ink-2);
}
.pd-energy dd.is-text {
    padding-top: 0.25em;
    font-size: 1.125rem;
    line-height: 1.2;
    white-space: normal;
}
.pd-energy-raw {
    margin: 0;
    font-weight: 600;
    color: var(--pd-ink-2);
}

.pd-fit {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--pd-veil);
    border-radius: 12px;
    font-size: 0.9375rem;
    line-height: 1.45;
    color: var(--pd-ink-2);
    text-decoration: none;
    font-family: inherit;
    letter-spacing: normal;
    transition: background-color 160ms ease;
}
.pd-fit svg { width: 24px; height: 24px; color: var(--line-ink); }
.pd-fit strong { color: var(--pd-ink); font-weight: 600; }
@media (hover: hover) and (pointer: fine) {
    .pd-fit:hover { background: #e4e9fc; }
    .pd-fit:hover span { text-decoration: underline; text-underline-offset: 3px; }
}

/* Prix + panier */
.pd-order { display: flex; flex-direction: column; gap: 16px; }
.pd-order form { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.pd-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 10px;
    margin: 0;
}
.pd-price__amount {
    font-family: "Barlow Semi Condensed", "Barlow", Arial, sans-serif;
    font-size: clamp(2.25rem, 3.4vw, 2.75rem);
    font-weight: 700;
    line-height: 1;
    color: var(--pd-ink);
}
.pd-price__tax { font-weight: 600; color: var(--pd-ink-2); }
.pd-price__ht { flex-basis: 100%; font-size: 0.875rem; color: var(--pd-muted); }

.pd-order select {
    width: 100%;
    height: 48px;
    padding: 0 40px 0 14px;
    border: 1px solid var(--pd-field);
    border-radius: 8px;
    background-color: #fff;
    font: inherit;
    font-size: 1rem;
    color: var(--pd-ink);
}

.pd .pd-cta {
    position: relative;
    display: block;
    width: 100%;
    height: 58px;
    padding: 0 24px;
    overflow: hidden;
    background: var(--pd-plaque);
    color: #fff;
    border: 0;
    border-radius: 12px;
    box-shadow: none;
    font-family: "Barlow Semi Condensed", "Barlow", Arial, sans-serif;
    font-size: 1.3125rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background-color 160ms ease, transform 160ms var(--pd-ease);
}
.pd .pd-cta::before { display: none; }
@media (hover: hover) and (pointer: fine) {
    .pd .pd-cta:hover { background: var(--pd-plaque-hover); transform: none; box-shadow: none; }
}
.pd .pd-cta:active { transform: scale(0.97); }
.pd-cta__label {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 100%;
}
.pd-cta__label svg { width: 22px; height: 22px; stroke-width: 1.8; }

/* Le bouton se charge pendant l'ajout au panier */
.pd-cta__charge {
    position: absolute;
    inset: 0;
    background: var(--line);
    clip-path: inset(0 100% 0 0);
    transition: clip-path 200ms ease-out;
}
.pd-cta.is-loading { pointer-events: none; }
.pd-cta.is-loading .pd-cta__charge {
    clip-path: inset(0 12% 0 0);
    transition: clip-path 900ms var(--pd-ease);
}
.pd-cta.is-done .pd-cta__charge {
    clip-path: inset(0 0 0 0);
    transition: clip-path 160ms ease-out;
}
.pd-cta.is-done { background: var(--pd-plaque); }

/* Réassurance */
.pd-promises {
    display: grid;
    gap: 2px;
    margin: 4px 0 0;
    padding: 12px 0 0;
    list-style: none;
    border-top: 1px solid var(--pd-rule);
}
.pd-promises li {
    display: grid;
    grid-template-columns: 24px 1fr;
    align-items: center;
    column-gap: 12px;
    padding: 8px 0;
    font-size: 0.9375rem;
    line-height: 1.4;
    color: var(--pd-ink-2);
}
.pd-promises svg { width: 22px; height: 22px; color: var(--pd-plaque); }
.pd-promises strong { font-weight: 600; color: var(--pd-ink); }
.pd-pay {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}
.pd-pay img {
    width: 64px;
    height: 38px;
    padding: 4px 6px;
    object-fit: contain;
    background: #fff;
    border-radius: 6px;
    box-shadow: inset 0 0 0 1px var(--pd-rule);
}
.pd-pay img:last-child { width: 96px; }

.pd-help {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--pd-ink-2);
}
.pd-help a,
.pd-filter__empty a {
    font-weight: 600;
    color: var(--pd-plaque);
    white-space: nowrap;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

/* ---------- Navigation de sections ---------- */
.pd-tabs {
    position: sticky;
    top: var(--pd-sticky);
    z-index: 10;
    display: flex;
    gap: 32px;
    margin-top: clamp(40px, 6vw, 72px);
    background: #f4f6ff;
    box-shadow: inset 0 -1px 0 var(--pd-rule);
    overflow-x: auto;
    scrollbar-width: none;
}
.pd-tabs::-webkit-scrollbar { display: none; }
.pd-tabs a {
    position: relative;
    padding: 16px 0 14px;
    font-family: "Barlow Semi Condensed", "Barlow", Arial, sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--pd-ink-2);
    text-decoration: none;
    white-space: nowrap;
    transition: color 160ms ease;
}
.pd-tabs a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--line);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 200ms var(--pd-ease);
}
.pd-tabs a[aria-current="true"] { color: var(--pd-ink); }
.pd-tabs a[aria-current="true"]::after { transform: scaleX(1); }
@media (hover: hover) and (pointer: fine) {
    .pd-tabs a:hover { color: var(--pd-ink); }
}

/* ---------- Sections ---------- */
.pd-section {
    padding-top: clamp(40px, 5vw, 56px);
    scroll-margin-top: calc(var(--pd-sticky) + 56px);
}
.pd-section h2 {
    margin: 0 0 20px;
    font-family: "Barlow Semi Condensed", "Barlow", Arial, sans-serif;
    font-size: clamp(1.5rem, 2.4vw, 2rem);
    font-weight: 700;
    line-height: 1.1;
    color: var(--pd-ink);
    text-align: left;
}
.pd-section h3 {
    margin: 0 0 8px;
    font-family: "Barlow Semi Condensed", "Barlow", Arial, sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--pd-ink);
}

.pd-specs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    gap: 20px 40px;
    align-items: start;
    padding: 24px 20px 16px;
    background: #fff;
    border-radius: 16px;
    box-shadow: inset 0 0 0 1px rgba(20, 28, 61, 0.06);
}
.pd-specs__group h3 { padding: 0 12px; }
.pd-specs dl { margin: 0; max-width: 680px; }
.pd-specs dl > div {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: 16px;
    padding: 10px 12px;
    border-radius: 8px;
}
.pd-specs dl > div:nth-child(odd) { background: var(--pd-zebra); }
.pd-specs dt { color: var(--pd-ink-2); }
.pd-specs dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.pd-lead { margin: -8px 0 20px; max-width: 65ch; color: var(--pd-ink-2); }

.pd-filter { max-width: 420px; margin-bottom: 20px; }
.pd-filter label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.9375rem;
}
.pd-filter input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 1px solid var(--pd-field);
    border-radius: 8px;
    background: #fff;
    font: inherit;
    color: var(--pd-ink);
    transition: box-shadow 160ms ease, border-color 160ms ease;
}
.pd-filter input::placeholder { color: var(--pd-muted); }
.pd-filter input:focus { outline: none; border-color: var(--line); box-shadow: 0 0 0 3px rgba(77, 103, 232, 0.2); }
.pd-filter__empty { margin: 12px 0 0; font-size: 0.9375rem; color: var(--pd-ink-2); }

.pd-models {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.pd-models li {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 8px 14px;
    background: #fff;
    border-radius: 10px;
    box-shadow: inset 0 0 0 1px var(--pd-rule);
    font-size: 0.9375rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.pd-models li::before {
    content: "";
    flex: 0 0 16px;
    height: 16px;
    background: var(--line-ink);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.pd-models li.is-current {
    box-shadow: inset 0 0 0 2px var(--line);
    font-weight: 600;
}
.pd-models li[hidden] { display: none; }

.pd-sub { margin-top: 36px !important; }
.pd-refs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}
.pd-refs a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 4px 12px;
    background: #fff;
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px var(--pd-rule);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--pd-plaque);
    text-decoration: none;
    transition: background-color 160ms ease;
}
@media (hover: hover) and (pointer: fine) {
    .pd-refs a:hover { background: var(--pd-veil); }
}

.pd-prose {
    max-width: 70ch;
    color: var(--pd-ink-2);
}
.pd-prose p { margin: 0 0 1em; }
.pd-prose b,
.pd-prose strong { color: var(--pd-ink); font-weight: 600; }
.pd-prose u { text-decoration: none; }
.pd-prose ul { margin: 0 0 1em; padding-left: 1.25em; }
.pd-prose li { margin-bottom: 0.4em; }
.pd-prose li::marker { color: var(--line); }

/* ---------- Barre d'achat mobile ---------- */
.pd-dock { display: none; }

@media (max-width: 960px) {
    .pd { --pd-sticky: 0px; }
    .pd-main { grid-template-columns: minmax(0, 1fr); }
    .pd-gallery { position: static; }
    .pd-stage { aspect-ratio: 4 / 3; padding: 6%; }
    .pd-tabs { position: static; gap: 24px; }
    .pd-specs { grid-template-columns: minmax(0, 1fr); }

    .pd-dock {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 900;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 10px clamp(16px, 4vw, 40px) calc(10px + env(safe-area-inset-bottom));
        background: #fff;
        box-shadow: 0 -8px 24px rgba(20, 28, 61, 0.1), 0 -1px 0 var(--pd-rule);
        transform: translateY(100%);
        visibility: hidden;
        transition: transform 240ms var(--pd-ease), visibility 0s linear 240ms;
    }
    .pd-dock.is-visible {
        transform: translateY(0);
        visibility: visible;
        transition: transform 240ms var(--pd-ease), visibility 0s;
    }
    .pd-dock__price {
        font-family: "Barlow Semi Condensed", "Barlow", Arial, sans-serif;
        font-size: 1.5rem;
        font-weight: 700;
        white-space: nowrap;
    }
    .pd-dock__price span { font-size: 0.875rem; font-weight: 600; color: var(--pd-ink-2); }
    .pd-dock__btn {
        height: 48px;
        padding: 0 22px;
        background: var(--pd-plaque);
        color: #fff;
        border: 0;
        border-radius: 10px;
        font-family: "Barlow Semi Condensed", "Barlow", Arial, sans-serif;
        font-size: 1.125rem;
        font-weight: 700;
        white-space: nowrap;
        cursor: pointer;
        transition: transform 160ms var(--pd-ease);
    }
    .pd-dock__btn:active { transform: scale(0.97); }
}

@media (max-width: 520px) {
    .pd-energy { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pd-energy__tile + .pd-energy__tile { box-shadow: none; }
    .pd-energy__tile:nth-child(even) { box-shadow: inset 1px 0 0 var(--pd-rule); }
    .pd-energy__tile:nth-child(n + 3) { box-shadow: inset 0 1px 0 var(--pd-rule); }
    .pd-energy__tile:nth-child(4) { box-shadow: inset 1px 1px 0 var(--pd-rule); }
    .pd-energy__tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .pd-models { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pd-specs dl > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
    .pd *,
    .pd *::before,
    .pd *::after { transition-duration: 0ms !important; }
}

/* La bulle de chat remonte au-dessus de la barre d'achat mobile */
@media (max-width: 960px) {
    .chat-toggler { transition: transform 240ms cubic-bezier(0.23, 1, 0.32, 1); }
    body.pd-page .chat-toggler { right: 16px; bottom: 16px; }
    body.pd-page .chat-toggler button { width: 48px; height: 48px; }
    body.pd-dock-on .chat-toggler { transform: translateY(-72px); }
}

.pd-specs:has(> .pd-specs__group:only-child) { max-width: 728px; }
