/* ==========================================================================
   TalabaStore T27 — mode sombre
   Activé par html[data-theme="dark"] : réglage du téléphone / ordinateur, ou bouton lune/soleil (mémorisé).
   ========================================================================== */

html[data-theme="dark"] {
	color-scheme: dark;
	--t27-bg: #0B1512;
	--t27-card: #12201B;
	--t27-card-2: #172822;
	--t27-deep: #07100D;
	--t27-text: #E7F1ED;
	--t27-on-accent: #06120E;
	--wp--preset--color--white: #0B1512;
	--wp--preset--color--surface: #101D19;
	--wp--preset--color--ink: #E7F1ED;
	--wp--preset--color--ink-soft: #B6C8C1;
	--wp--preset--color--muted: #96ABA3;
	--wp--preset--color--dark-muted: #96ABA3;
	--wp--preset--color--mint: #143029;
	--wp--preset--color--teal-tint: #122D28;
	--wp--preset--color--line: #22372F;
	--wp--preset--color--amber-soft: #2B2411;
	--wp--preset--color--danger: #F97066;
	--wp--preset--color--danger-soft: #3A1815;
	--wp--preset--color--primary: #34C3AB;
	--wp--preset--color--primary-dark: #5BD6C1;
	--wp--preset--gradient--mint-wash: linear-gradient(180deg, #12221D 0%, #0B1512 100%);
}
html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] body { background: var(--t27-bg); color: var(--t27-text); }
html[data-theme="dark"] ::selection { background: rgba(52, 195, 171, .35); }

/* Sections « encre » : restent sombres (plus profondes que la page), textes clairs */
html[data-theme="dark"] .has-ink-background-color { background-color: var(--t27-deep) !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), inset 0 -1px 0 rgba(255, 255, 255, .04); }
html[data-theme="dark"] .has-white-color { color: #F2F8F5 !important; }
html[data-theme="dark"] .has-white-background-color { background-color: var(--t27-card) !important; }

/* Boutons : fond turquoise clair, texte sombre (lisible) */
html[data-theme="dark"] .wp-element-button,
html[data-theme="dark"] .wp-block-button__link { color: var(--t27-on-accent); }
html[data-theme="dark"] .wp-block-button.is-style-dark .wp-block-button__link,
html[data-theme="dark"] .t27-pill--ink,
html[data-theme="dark"] .wp-block-query-pagination span.current,
html[data-theme="dark"] .woocommerce-pagination span.current,
html[data-theme="dark"] .t27-404__art::after { background: #E7F1ED; color: var(--t27-on-accent) !important; }
html[data-theme="dark"] .wp-block-button.is-style-ghost .wp-block-button__link,
html[data-theme="dark"] .wp-block-button.is-style-outline .wp-block-button__link { background: transparent; color: var(--t27-text); box-shadow: inset 0 0 0 1.5px var(--wp--preset--color--line); border-color: var(--wp--preset--color--line); }
html[data-theme="dark"] .wp-block-button.is-style-amber .wp-block-button__link,
html[data-theme="dark"] .t27-cart .wc-block-mini-cart__badge,
html[data-theme="dark"] .wc-block-components-product-sale-badge { color: #1A1300 !important; }
html[data-theme="dark"] .wp-block-button.is-style-ghost-dark .wp-block-button__link { color: #F2F8F5; }

/* En-tête, navigation du bas, recherche */
html[data-theme="dark"] .t27-header { background: rgba(11, 21, 18, .9); border-bottom-color: var(--wp--preset--color--line); }
html[data-theme="dark"] .t27-search .wp-block-search__button,
html[data-theme="dark"] .t27-search .wp-block-search__inside-wrapper:focus-within,
html[data-theme="dark"] .t27-search.is-open .wp-block-search__inside-wrapper,
html[data-theme="dark"] .t27-cart .wc-block-mini-cart__button { background: var(--t27-card) !important; color: var(--t27-text); }
html[data-theme="dark"] .t27-search-big .wp-block-search__inside-wrapper { background: var(--t27-card) !important; }
html[data-theme="dark"] .t27-lang a.is-active { background: var(--t27-card-2); color: var(--t27-text); }
@media (max-width: 781px) {
	html[data-theme="dark"] .t27-bnav { background: rgba(11, 21, 18, .96); border-top-color: var(--wp--preset--color--line); box-shadow: 0 -10px 30px rgba(0, 0, 0, .35); }
	html[data-theme="dark"] .t27-bnav__item--card .t27-bnav__icon { border-color: var(--t27-bg); color: var(--t27-on-accent); }
}

/* Logo : version claire en mode sombre */
.t27-logo-dark { display: none !important; }
html[data-theme="dark"] .t27-logo .t27-logo-dark { display: inline-block !important; }
html[data-theme="dark"] .t27-logo .custom-logo:not(.t27-logo-dark) { display: none !important; }

/* Cartes, panneaux, pastilles */
html[data-theme="dark"] .wp-block-group.is-style-card,
html[data-theme="dark"] .wc-block-product,
html[data-theme="dark"] .t27-cpt-faq .wp-block-details,
html[data-theme="dark"] .is-style-pill { background: var(--t27-card); border-color: var(--wp--preset--color--line); }
html[data-theme="dark"] .wp-block-group.is-style-card { box-shadow: none; }
html[data-theme="dark"] .t27-cpt-actor.is-you { background: var(--t27-deep) !important; box-shadow: inset 0 0 0 1px rgba(52, 195, 171, .35), 0 24px 50px rgba(0, 0, 0, .4); }
html[data-theme="dark"] .t27-cpt-actor.is-you h3 { color: #F2F8F5; }
html[data-theme="dark"] .t27-cpt-steps li::before,
html[data-theme="dark"] .t27-step__icon { color: var(--t27-on-accent); }
html[data-theme="dark"] .t27-install__icon { background: #F2F8F5; }
html[data-theme="dark"] .t27-cpt-phone img,
html[data-theme="dark"] .t27-cpt-screen img,
html[data-theme="dark"] .t27-cpt-hero__visual img { filter: drop-shadow(0 18px 34px rgba(0, 0, 0, .5)); }

/* Chargement */
html[data-theme="dark"] .t27-loader__veil { background: rgba(7, 16, 13, .55); }
html[data-theme="dark"] .t27-loader__badge { background: var(--t27-card); }
html[data-theme="dark"] .screen-reader-text:focus { background: var(--t27-card); }

/* Formulaires (WordPress, WooCommerce, extensions) */
html[data-theme="dark"] input[type="text"], html[data-theme="dark"] input[type="email"], html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] input[type="number"], html[data-theme="dark"] input[type="password"], html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="url"], html[data-theme="dark"] input[type="date"], html[data-theme="dark"] select, html[data-theme="dark"] textarea,
html[data-theme="dark"] .select2-container--default .select2-selection--single,
html[data-theme="dark"] .wc-block-components-text-input input, html[data-theme="dark"] .wc-blocks-components-select__select {
	background-color: var(--t27-card) !important; color: var(--t27-text) !important; border-color: var(--wp--preset--color--line) !important;
}
html[data-theme="dark"] ::placeholder { color: #7F958D; }
html[data-theme="dark"] .select2-dropdown, html[data-theme="dark"] .select2-results__option { background: var(--t27-card); color: var(--t27-text); }
html[data-theme="dark"] .wc-block-components-text-input label, html[data-theme="dark"] .wc-blocks-components-select__label { color: var(--wp--preset--color--muted) !important; }

/* WooCommerce : tableaux, notices, panier, paiement, compte */
html[data-theme="dark"] .woocommerce table.shop_table, html[data-theme="dark"] .woocommerce table.shop_table th, html[data-theme="dark"] .woocommerce table.shop_table td,
html[data-theme="dark"] table, html[data-theme="dark"] th, html[data-theme="dark"] td { border-color: var(--wp--preset--color--line) !important; }
html[data-theme="dark"] #payment, html[data-theme="dark"] .woocommerce-checkout #payment, html[data-theme="dark"] .woocommerce form.login, html[data-theme="dark"] .woocommerce form.register,
html[data-theme="dark"] .woocommerce-MyAccount-navigation, html[data-theme="dark"] .wc-block-components-sidebar-layout .wc-block-components-main,
html[data-theme="dark"] .wc-block-checkout__sidebar, html[data-theme="dark"] .wc-block-components-order-summary { background: var(--t27-card) !important; color: var(--t27-text); border-color: var(--wp--preset--color--line) !important; }
html[data-theme="dark"] #payment div.payment_box { background: var(--t27-card-2) !important; color: var(--t27-text); }
html[data-theme="dark"] #payment div.payment_box::before { border-bottom-color: var(--t27-card-2) !important; }
html[data-theme="dark"] .woocommerce-message, html[data-theme="dark"] .woocommerce-info, html[data-theme="dark"] .woocommerce-error,
html[data-theme="dark"] .wc-block-components-notice-banner { background: var(--t27-card) !important; color: var(--t27-text) !important; }
html[data-theme="dark"] .wc-block-components-notice-banner.is-error { background: var(--wp--preset--color--danger-soft) !important; }
html[data-theme="dark"] .wc-block-components-notice-banner.is-success { background: #12302A !important; }
html[data-theme="dark"] .wc-block-components-notice-banner > svg { fill: #fff; }
html[data-theme="dark"] .woocommerce ul.order_details li, html[data-theme="dark"] .wc-block-order-confirmation-summary-list-item__key { color: var(--wp--preset--color--muted); }
html[data-theme="dark"] .wc-block-components-product-price del, html[data-theme="dark"] del { color: var(--wp--preset--color--muted); }
html[data-theme="dark"] .wc-block-components-radio-control__option, html[data-theme="dark"] .wc-block-components-radio-control-accordion-option { box-shadow: inset 0 0 0 1px var(--wp--preset--color--line) !important; }
html[data-theme="dark"] .wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"],
html[data-theme="dark"] .wc-block-components-radio-control__input { background: var(--t27-card) !important; border-color: #4A6159 !important; }
html[data-theme="dark"] .wp-block-woocommerce-product-image-gallery img, html[data-theme="dark"] .wc-block-components-product-image img,
html[data-theme="dark"] .woocommerce-product-gallery img { background: #fff; }

/* Bouton lune / soleil */
.t27-theme-toggle { display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0; border-radius: 50%; border: 1.5px solid var(--wp--preset--color--line); background: transparent; color: var(--wp--preset--color--ink); cursor: pointer; transition: transform .25s, border-color .2s, background .2s; flex: none; }
.t27-theme-toggle:hover { border-color: var(--wp--preset--color--brand-teal); transform: rotate(-12deg); }
.t27-theme-toggle:focus-visible { outline: 2px solid var(--wp--preset--color--brand-teal); outline-offset: 2px; }
.t27-theme-toggle svg { width: 20px; height: 20px; }
.t27-theme-toggle .t27-sun { display: none; }
html[data-theme="dark"] .t27-theme-toggle .t27-sun { display: block; color: #FFC857; }
html[data-theme="dark"] .t27-theme-toggle .t27-moon { display: none; }
@media (max-width: 781px) { .t27-theme-toggle { width: 38px; height: 38px; } }
html.t27-theme-anim, html.t27-theme-anim * { transition: background-color .35s ease, color .35s ease, border-color .35s ease !important; }
/* Photos produits : tuile claire (les visuels détourés restent lisibles). */
html[data-theme="dark"] .wc-block-product .wc-block-components-product-image,
html[data-theme="dark"] .wc-block-grid__product-image, html[data-theme="dark"] li.product a img { background: #EEF3F1; }
