/*
 * T2T Dark Mode – Matériel 0.2.3 — compatibilité Matériel Hub 0.30.04
 * Ne s'applique qu'au mode sombre. Classes réelles extraites du Hub.
 * Les photos, les logos des vendeurs, les pastilles couleur et les graphes
 * de composition des bois gardent leur rendu natif.
 */

/* Variables T2T communes. Plusieurs composants du Hub utilisent encore
 * --t2t-* : fournir des valeurs sombres seulement dans sa propre surface. */
html[data-t2t-theme="dark"] body.t2tdmm-material-site {
    --t2t-text: #f2f6fb;
    --t2t-muted: #b9c9da;
    --t2t-border: #344b65;
    --t2t-blue-soft: #163754;
}

/* Grands panneaux, cartes catalogue, fiches produits et contenu éditorial. */
html[data-t2t-theme="dark"] :is(
    .t2tmh-material-archive, .t2tmh-entity-archive-main, .t2tmh-entity-article,
    .t2tmh-directory-hero, .t2tmh-directory-empty,
    .t2tmh-product-card, .t2tmh-type-card, .t2tmh-player-card,
    .t2tmh-player-profile, .t2tmh-profile-equipment, .t2tmh-player-empty,
    .t2tmh-product-archived, .t2tmh-community, .t2tmh-community-grid > div,
    .t2tmh-editorial-highlights > div, .t2tmh-blade-meta, .t2tmh-blade-profile,
    .t2tmh-manufacturer-rating-grid > div, .t2tmh-similar-card,
    .t2tmh-offers-panel, .t2tmh-offers-meta, .t2tmh-offer,
    .t2tmh-vendor-review, .t2tmh-vendor-review-editor,
    .t2tmh-price-chart, .t2tmh-rating-form-wrap,
    .t2tmh-chart-status, .t2tmh-manufacturer-filters,
    .t2tmh-catalog-filters-v2, .t2tmh-catalog-filters-v3,
    .t2tmh-equipment-picker, .t2tmh-equipment-results, .t2tmh-equipment-result,
    .t2tmh-promo-access, .t2tmh-promo-filters,
    .t2tmh-entity-column, .t2tmh-entity-accordion-brand,
    .t2tmh-entity-profile-head, .t2tmh-entity-product-card,
    .t2tmh-entity-gallery figure, .t2tmh-directory-brand-filter,
    .t2tmh-directory-card, .t2tmh-directory-kpis span,
    .t2tmh-vendor-opinions, .t2tmh-vendor-opinions-score,
    .t2tmh-review-login, .t2tmh-vendor-review-form,
    .t2tmh-no-public-review, .t2tmh-vendor-contact-card,
    .t2tmh-vendor-contact-item, .t2tmh-vendor-contact-locked,
    .t2tmh-vendor-storefront, .t2tmh-vendor-store-filters,
    .t2tmh-product-metrics > span, .t2tmh-sidebar-favorites,
    .t2tmh-sidebar-favorite-item, .t2tmh-favorites-login,
    .t2tmh-racket-popover, .t2tmh-racket-page, .t2tmh-racket-slot,
    .t2tmh-racket-selected, .t2tmh-racket-result,
    .t2tmh-compare-dock, .t2tmh-compare-chip, .t2tmh-compare-dialog,
    .t2tmh-brand-table-section, .t2tmh-brand-table-heading,
    .t2tmh-color-filter-options, .t2tmh-product-review-cta,
    .t2tmh-community-login, .t2tmh-user-review-empty,
    .t2tmh-blade-same-composition, .t2tmh-same-composition-filter,
    .t2tmh-blade-composition-form, .t2tmh-blade-contributor,
    .t2tmh-partner-promo-card, .t2tmh-vendor-benefits-card,
    .t2tmh-vendor-benefit, .t2tmh-offers-premium,
    .t2tmh-offer-variant-filters,
    .t2tmh-secondhand-card, .t2tmh-secondhand-sell,
    .t2tmh-dashboard-card, .t2tmh-private-contact,
    .t2tmh-review-explainer, .t2tmh-trusted-card,
    .t2tmh-seller-profile-head, .t2tmh-top-card,
    .t2tmh-evaluation-card, .t2tmh-seller-reviews,
    .t2tmh-seller-review, .t2tmh-sell-product-card
) {
    background: var(--t2tdmm-surface) !important;
    color: var(--t2tdmm-text) !important;
    border-color: var(--t2tdmm-border) !important;
    box-shadow: none !important;
}

/* Surfaces imbriquées, onglets et cartes sélectionnables. */
html[data-t2t-theme="dark"] :is(
    .t2tmh-type-card.is-active, .t2tmh-directory-card.is-partner,
    .t2tmh-offer.is-best, .t2tmh-offer.is-partner,
    .t2tmh-sidebar-favorites.is-active, .t2tmh-racket-trigger.is-active,
    .t2tmh-subtype-pill, .t2tmh-filter-range,
    .t2tmh-characteristic-meta > span, .t2tmh-profile-rating,
    .t2tmh-vendor-contact-note, .t2tmh-vendor-store-categories a,
    .t2tmh-occasion-pill, .t2tmh-secondhand-secure,
    .t2tmh-offer-promo, .t2tmh-promo-sizes,
    .t2tmh-promo-size, .t2tmh-promo-size-more,
    .t2tmh-vendor-benefit-code code, .t2tmh-offer-promo code,
    .t2tmh-partner-promo-codes code, .t2tmh-partner-promo-codes span,
    .t2tmh-compare-loading, .t2tmh-compare-no-image,
    .t2tmh-blade-profile-restored, .t2tmh-chart-status.is-info
) {
    background: var(--t2tdmm-surface-2) !important;
    color: var(--t2tdmm-text) !important;
    border-color: var(--t2tdmm-border) !important;
}
html[data-t2t-theme="dark"] :is(
    .t2tmh-type-card, .t2tmh-subtype-pill,
    .t2tmh-directory-card, .t2tmh-racket-result,
    .t2tmh-occasion-pill, .t2tmh-vendor-store-categories a,
    .t2tmh-blade-same-composition
):hover {
    background: var(--t2tdmm-surface-3) !important;
    border-color: #6284a4 !important;
}
html[data-t2t-theme="dark"] :is(
    .t2tmh-entity-button.is-partner, .t2tmh-entity-entrypoint-brand,
    .t2tmh-mobile-filter-toggle, .t2tmh-racket-trigger,
    .t2tmh-racket-profile-link, .t2tmh-sidebar-racket-shortcut a
) {
    background-color: var(--t2tdmm-surface-2) !important;
    border-color: var(--t2tdmm-border) !important;
    color: var(--t2tdmm-link) !important;
}

/* Les textes du Hub ont parfois des couleurs codées en dur, plus spécifiques
 * que les règles génériques du socle. Ne pas recolorer les icônes, scores,
 * évaluations étoiles, drapeaux ou pastilles de statut. */
html[data-t2t-theme="dark"] :is(
    .t2tmh-directory-hero h1, .t2tmh-entity-page-title,
    .t2tmh-entity-column h3, .t2tmh-entity-entrypoint b,
    .t2tmh-vendor-opinions-heading h2, .t2tmh-vendor-opinions-score > strong,
    .t2tmh-public-reviews > h3, .t2tmh-no-public-review strong,
    .t2tmh-review-login strong, .t2tmh-review-form-head strong,
    .t2tmh-review-text strong, .t2tmh-review-form legend,
    .t2tmh-vendor-contact-item strong, .t2tmh-vendor-contact-locked strong,
    .t2tmh-vendor-popular > h3, .t2tmh-product-metrics strong,
    .t2tmh-sidebar-favorites-head a, .t2tmh-offer-vendor > strong,
    .t2tmh-offer-price strong, .t2tmh-offers-meta strong,
    .t2tmh-chart-summary strong, .t2tmh-compare-dialog h2,
    .t2tmh-profile-rating strong, .t2tmh-profile-rating b,
    .t2tmh-review-author strong, .t2tmh-brand-table-heading,
    .t2tmh-public-review-head > strong, .t2tmh-blade-profile h3
) {
    color: var(--t2tdmm-text) !important;
    text-shadow: none !important;
}
html[data-t2t-theme="dark"] :is(
    .t2tmh-directory-hero > p, .t2tmh-directory-hero .t2tmh-eyebrow,
    .t2tmh-vendor-opinions-heading p, .t2tmh-vendor-opinions-heading .t2tmh-eyebrow,
    .t2tmh-vendor-opinions-score small, .t2tmh-public-review-body p,
    .t2tmh-vendor-contact-item > span, .t2tmh-vendor-contact-note,
    .t2tmh-vendor-storefront > .t2tmh-section-heading p,
    .t2tmh-sidebar-favorite-product, .t2tmh-chart-summary,
    .t2tmh-secondhand-location, .t2tmh-secondhand-desc,
    .t2tmh-secondhand-heading p, .t2tmh-secondhand-empty,
    .t2tmh-evaluations-intro, .t2tmh-review-head time,
    .t2tmh-review-comment, .t2tmh-review-product,
    .t2tmh-sell-product-copy p, .t2tmh-sell-product-copy span,
    .t2tmh-seller-reviews p, .t2tmh-transaction-help,
    .t2tmh-secondhand-seller, .t2tmh-dashboard-card span,
    .t2tmh-evaluation-main span, .t2tmh-evaluation-published,
    .t2tmh-vendor-review-product small, .t2tmh-seller-profile-head p,
    .t2tmh-top-explainer, .t2tmh-reviews-directory-intro
) {
    color: var(--t2tdmm-muted) !important;
}

/* Formulaires (recherche, filtres, variants, avis, seconde main, espace
 * vendeur) avec saisie visible + curseur + autofill dans Chromium/WebKit. */
html[data-t2t-theme="dark"] :is(
    .t2tmh-material-archive, .t2tmh-entity-article,
    .t2tmh-catalog-filters-v2, .t2tmh-catalog-filters-v3,
    .t2tmh-vendor-storefront, .t2tmh-vendor-portal,
    .t2tmh-racket-page, .t2tmh-secondhand-section,
    .t2tmh-secondhand-shell, .t2tmh-compare-dialog,
    .t2tmh-community, .t2tmh-offers-panel,
    .t2tmh-blade-composition-form, .t2tmh-review-form
) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),select,textarea),
html[data-t2t-theme="dark"] .t2tdmm-material-auto-input {
    background: var(--t2tdmm-input) !important;
    color: var(--t2tdmm-text) !important;
    border-color: #55728e !important;
    caret-color: var(--t2tdmm-text) !important;
    -webkit-text-fill-color: var(--t2tdmm-text) !important;
    color-scheme: dark;
}
html[data-t2t-theme="dark"] :is(.t2tmh-material-archive,.t2tmh-entity-article,.t2tmh-racket-page,.t2tmh-secondhand-shell,.t2tmh-vendor-portal,.t2tmh-compare-dialog) :is(input,textarea)::placeholder,
html[data-t2t-theme="dark"] .t2tdmm-material-auto-input::placeholder {
    color: #b1c4d9 !important;
    -webkit-text-fill-color: #b1c4d9 !important;
    opacity: 1 !important;
}
html[data-t2t-theme="dark"] :is(.t2tmh-material-archive,.t2tmh-entity-article,.t2tmh-racket-page,.t2tmh-secondhand-shell,.t2tmh-vendor-portal,.t2tmh-compare-dialog) :is(input,textarea):-webkit-autofill,
html[data-t2t-theme="dark"] .t2tdmm-material-auto-input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #0c1b2e inset !important;
    -webkit-text-fill-color: #f2f6fb !important;
    caret-color: #f2f6fb !important;
    transition: background-color 9999s ease-out 0s;
}
html[data-t2t-theme="dark"] :is(.t2tmh-material-archive,.t2tmh-entity-article,.t2tmh-racket-page,.t2tmh-secondhand-shell,.t2tmh-vendor-portal,.t2tmh-compare-dialog) :is(select,option) {
    background-color: var(--t2tdmm-input);
    color: var(--t2tdmm-text);
}

/* Focus clavier, sélection, boutons secondaires et boutons réellement désactivés. */
html[data-t2t-theme="dark"] :is(.t2tmh-material-archive,.t2tmh-entity-article,.t2tmh-secondhand-shell,.t2tmh-compare-dialog,.t2tmh-vendor-portal) :is(a,button,input,select,textarea):focus-visible {
    outline: 2px solid #8bd5ff !important;
    outline-offset: 2px;
}
html[data-t2t-theme="dark"] [class*="t2tmh-"] :is(button,input[type="submit"]):disabled {
    color: #aabacc !important;
    background: #27394c !important;
    border-color: #42556a !important;
    cursor: not-allowed;
}
html[data-t2t-theme="dark"] .t2tmh-racket-popover :is(button,a) {
    background: transparent !important;
    color: var(--t2tdmm-text) !important;
}
html[data-t2t-theme="dark"] .t2tmh-racket-popover :is(button,a):hover {background: var(--t2tdmm-surface-3) !important;}
html[data-t2t-theme="dark"] .t2tmh-racket-popover .is-remove {color: #ff9d9d !important;}

/* Boutons favoris / alerte : états lisibles sans perdre leur signification. */
html[data-t2t-theme="dark"] .t2tmh-favorite-toggle:not(.is-active) {
    background: #1c324a !important;
    border-color: #557089 !important;
    color: #d2e1ef !important;
}
html[data-t2t-theme="dark"] .t2tmh-favorite-toggle.is-active {
    background: #542530 !important;
    border-color: #a74d5e !important;
    color: #ffe4e7 !important;
}
html[data-t2t-theme="dark"] .t2tmh-alert-toggle.is-active {
    background: #4d371b !important;
    border-color: #bc8c40 !important;
    color: #ffedc8 !important;
}
html[data-t2t-theme="dark"] .t2tmh-sidebar-favorite-remove {
    background: #23394f !important;
    color: #e1e9f1 !important;
    border-color: #4c657c !important;
}
html[data-t2t-theme="dark"] .t2tmh-sidebar-favorite-remove:hover {
    background: #783044 !important;
    color: white !important;
    border-color: #c76070 !important;
}

/* Tableaux techniques, comparateur et tableau des marques. */
html[data-t2t-theme="dark"] :is(.t2tmh-compare-table,.t2tmh-brand-table,.t2tmh-rubber-table) {
    background: var(--t2tdmm-surface) !important;
    color: var(--t2tdmm-text) !important;
    border-color: var(--t2tdmm-border) !important;
}
html[data-t2t-theme="dark"] :is(.t2tmh-compare-table,.t2tmh-brand-table,.t2tmh-rubber-table) :is(td,th) {
    color: var(--t2tdmm-text) !important;
    border-color: var(--t2tdmm-border) !important;
}
html[data-t2t-theme="dark"] :is(.t2tmh-compare-table,.t2tmh-brand-table,.t2tmh-rubber-table) thead th {
    background: var(--t2tdmm-surface-3) !important;
}
html[data-t2t-theme="dark"] :is(.t2tmh-compare-table,.t2tmh-brand-table,.t2tmh-rubber-table) tbody tr:nth-child(even) > :is(td,th) {
    background: #172e48 !important;
}
html[data-t2t-theme="dark"] :is(.t2tmh-compare-table,.t2tmh-brand-table,.t2tmh-rubber-table) tbody tr:hover > :is(td,th) {
    background: #27435e !important;
}
html[data-t2t-theme="dark"] .t2tmh-compare-table-scroll {border-color: var(--t2tdmm-border) !important;}
html[data-t2t-theme="dark"] .t2tmh-compare-product-head :is(img,.t2tmh-compare-no-image) {background:#f7f9fc !important;}

/* Graphique d'évolution : conserver le tracé de prix mais adapter le cadre et
 * les libellés SVG (il ne faut PAS filtrer l'image du produit). */
html[data-t2t-theme="dark"] .t2tmh-price-svg {
    background: #0e2239 !important;
    border-color: var(--t2tdmm-border) !important;
}
html[data-t2t-theme="dark"] .t2tmh-price-svg .t2tmh-chart-gridline {stroke: #35516b !important;}
html[data-t2t-theme="dark"] .t2tmh-price-svg .t2tmh-chart-label {fill: #c2d2e3 !important;}
html[data-t2t-theme="dark"] .t2tmh-price-svg .t2tmh-chart-point {fill:#0e2239 !important;}

/* Mise en avant prix/promos. Les remises, disponibilités et badges partenaires
 * doivent rester distinguables et ne pas subir le traitement automatique. */
html[data-t2t-theme="dark"] :is(.t2tmh-offer-price strong,.t2tmh-secondhand-price,.t2tmh-used-catalog-price) {color: #eaf5ff !important;}
html[data-t2t-theme="dark"] :is(.t2tmh-offer-price del,.t2tmh-offer-price small) {color: #bac8d7 !important;}
html[data-t2t-theme="dark"] .t2tmh-badge-best {background:#1c5235 !important;color:#c6f8d7 !important;}
html[data-t2t-theme="dark"] .t2tmh-badge-partner {background:#622d39 !important;color:#ffe0e4 !important;border-color:#9b4958 !important;}
html[data-t2t-theme="dark"] .t2tmh-badge-stock {background:#193e61 !important;color:#d3eaff !important;}
html[data-t2t-theme="dark"] :is(.t2tmh-entity-partner-badge,.t2tmh-secondhand-chip,.t2tmh-trusted-badge) {
    background: #204b36 !important;
    color: #d1f9dd !important;
    border-color: #56856a !important;
}
html[data-t2t-theme="dark"] .t2tmh-entity-column h3 span,
html[data-t2t-theme="dark"] .t2tmh-directory-card-title em {
    background:#203c55 !important;color:#c9dff0 !important;
}
html[data-t2t-theme="dark"] .t2tmh-portal-success,
html[data-t2t-theme="dark"] .t2tmh-secondhand-notice.is-success,
html[data-t2t-theme="dark"] .t2tmh-review-success {
    background:#1c4933 !important;color:#c9f3d6 !important;border-color:#4b8964 !important;
}
html[data-t2t-theme="dark"] .t2tmh-secondhand-notice.is-error,
html[data-t2t-theme="dark"] .t2tmh-compare-error {
    background:#572a34 !important;color:#ffe1e6 !important;border-color:#a65463 !important;
}
html[data-t2t-theme="dark"] :is(.t2tmh-secondhand-private,.t2tmh-approval-expiring) {
    background:#4b381e !important;color:#ffebc4 !important;border-color:#bd9143 !important;
}
html[data-t2t-theme="dark"] .t2tmh-evaluation-card.status-waiting .t2tmh-evaluation-status {
    background:#533e1d !important;color:#fff0ca !important;
}
html[data-t2t-theme="dark"] .t2tmh-evaluation-card.status-sealed .t2tmh-evaluation-status {
    background:#203e64 !important;color:#d9e9ff !important;
}
html[data-t2t-theme="dark"] .t2tmh-evaluation-card.status-visible .t2tmh-evaluation-status {
    background:#1c5235 !important;color:#d8f9e1 !important;
}

/* Les pastilles d'épaisseur, types de mousse et chips neutres sont visibles. */
html[data-t2t-theme="dark"] :is(
    .t2tmh-product-tags a, .t2tmh-occasion-pill,
    .t2tmh-offer-variant-filters label, .t2tmh-subtype-pill,
    .t2tmh-promo-size, .t2tmh-promo-size-more,
    .t2tmh-product-metrics > span
) {border-color:#48647f !important;color:#e4eef7 !important;}

/* Fonds clairs nécessaires à l'identité de la photo/logo : ne jamais inverser,
 * assombrir ou teinter le média d'origine. */
html[data-t2t-theme="dark"] :is(
    .t2tmh-product-summary-image, .t2tmh-product-image,
    .t2tmh-product-media, .t2tmh-image,
    .t2tmh-thumb, .t2tmh-vendor-mark,
    .t2tmh-entity-profile-logo, .t2tmh-directory-card-logo,
    .t2tmh-partner-promo-image, .t2tmh-sell-product-image,
    .t2tmh-type-card-icon, .t2tmh-ittf-artwork,
    .t2tmh-racket-selected img, .t2tmh-sidebar-favorite-product img
) {background: #f7f9fc !important;}
html[data-t2t-theme="dark"] :is(
    .t2tmh-product-summary-image,.t2tmh-product-media,.t2tmh-vendor-mark,
    .t2tmh-entity-profile-logo,.t2tmh-directory-card-logo,.t2tmh-partner-promo-image
) :is(img,picture,svg),
html[data-t2t-theme="dark"] :is(
    .t2tmh-product-summary-image,.t2tmh-product-media,
    .t2tmh-vendor-mark,.t2tmh-entity-profile-logo,
    .t2tmh-directory-card-logo,.t2tmh-partner-promo-image
) img {
    filter:none !important;opacity:1 !important;
}
html[data-t2t-theme="dark"] :is(.t2tmh-color-white,.t2tmh-color-yellow,.t2tmh-color-orange) {filter:none !important;}
/* Les teintes des plis d'un bois représentent une donnée : ne pas les écraser. */
html[data-t2t-theme="dark"] .t2tmh-blade-layer {filter:none !important;}

/* Réduire les animations lorsque le système le demande. */
@media (prefers-reduced-motion: reduce) {
    html[data-t2t-theme="dark"] :is(.t2tmh-type-card,.t2tmh-directory-card,.t2tmh-offer) {
        transition-duration: 0.01ms !important;
    }
}
