/* =========================================================
   Diwan Reem — mode sombre (au choix de la cliente)
   Activé par <html data-theme="sombre">. Les couleurs de la marque
   sont transposées : fond Nuit, texte Perle, accents Champagne.
   ========================================================= */

/* ---------- Bouton lune / soleil ---------- */
.diwan-entete__actions {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	justify-self: end;
}
.diwan-theme {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--wp--preset--color--nuit);
	cursor: pointer;
	transition: background-color 200ms ease, transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}
.diwan-theme:hover {
	background-color: var(--wp--preset--color--perle-profond);
}
.diwan-theme:active {
	transform: scale(0.92);
}
.diwan-theme:focus-visible {
	outline: 2px solid var(--wp--preset--color--bronze);
	outline-offset: 2px;
}
.diwan-theme__soleil {
	display: none;
}
[data-theme="sombre"] .diwan-theme__lune {
	display: none;
}
[data-theme="sombre"] .diwan-theme__soleil {
	display: block;
}
@media (prefers-reduced-motion: no-preference) {
	.diwan-theme svg {
		transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
	}
	.diwan-theme:hover svg {
		transform: rotate(-20deg);
	}
	/* Passage clair ↔ sombre en fondu, uniquement pendant le changement */
	.diwan-theme-transition,
	.diwan-theme-transition *,
	.diwan-theme-transition *::before,
	.diwan-theme-transition *::after {
		transition: background-color 400ms ease, color 400ms ease, border-color 400ms ease !important;
	}
}

/* ---------- Palette sombre ---------- */
[data-theme="sombre"] {
	color-scheme: dark;
	--wp--preset--color--perle: #16101B;
	--wp--preset--color--perle-profond: #231B29;
	--wp--preset--color--nuit: #F2EAE2;
	--wp--preset--color--gris-chaud: #B9AFA6;
	--wp--preset--color--bronze: #CCAF98;
	--wp--preset--color--champagne: #CCAF98;
	--wp--preset--color--zellige: #2F5A57;
	--wp--preset--color--blanc: #FFFFFF;
}
[data-theme="sombre"] body {
	background-color: #16101B;
	color: #F2EAE2;
}

/* Boutons : au survol, champagne sur nuit (au lieu de « nuit » devenu clair) */
[data-theme="sombre"] .wp-element-button:hover,
[data-theme="sombre"] .wp-block-button__link:hover,
[data-theme="sombre"] .wc-block-components-product-button__button:not(:disabled):hover,
[data-theme="sombre"] .woocommerce button.button:not(:disabled):hover,
[data-theme="sombre"] .woocommerce #place_order:hover,
[data-theme="sombre"] .diwan-achat-rapide__bouton:hover,
[data-theme="sombre"] .diwan-whatsapp-fixe:hover {
	background-color: #CCAF98 !important;
	color: #16101B !important;
}
[data-theme="sombre"] .diwan-conseil__calculer,
[data-theme="sombre"] .diwan-conseil__choisir {
	border-color: #F2EAE2;
	color: #F2EAE2;
}
[data-theme="sombre"] .diwan-conseil__calculer:hover,
[data-theme="sombre"] .diwan-conseil__choisir:hover {
	background: #CCAF98;
	border-color: #CCAF98;
	color: #16101B;
}
[data-theme="sombre"] .wp-block-button.is-style-diwan-lien .wp-block-button__link:hover {
	background-color: transparent !important;
	color: #CCAF98 !important;
}

/* Champs de saisie (commande, calculateur) */
[data-theme="sombre"] input[type="text"],
[data-theme="sombre"] input[type="tel"],
[data-theme="sombre"] input[type="email"],
[data-theme="sombre"] input[type="number"],
[data-theme="sombre"] input[type="search"],
[data-theme="sombre"] select,
[data-theme="sombre"] textarea,
[data-theme="sombre"] .diwan-conseil__champ input {
	background-color: #231B29 !important;
	color: #F2EAE2 !important;
	border-color: #6B645C !important;
}
[data-theme="sombre"] ::placeholder {
	color: #8E857C;
}

/* Section « La maison » : reste la plus sombre de la page */
[data-theme="sombre"] .diwan-maison {
	background-color: #0D0911 !important;
	color: #F2EAE2 !important;
}
[data-theme="sombre"] .diwan-maison .has-perle-color {
	color: #F2EAE2 !important;
}

/* Ouverture 3D : pastilles en verre sombre */
[data-theme="sombre"] .diwan-scene .diwan-puce {
	background: rgba(22, 16, 27, 0.72);
	color: #F2EAE2;
	border-color: rgba(204, 175, 152, 0.55);
}
[data-theme="sombre"] .diwan-hero3d {
	background:
		radial-gradient(120% 70% at 70% 30%, rgba(204, 175, 152, 0.14), transparent 60%),
		#16101B;
}
[data-theme="sombre"] .diwan-calque--cadre {
	filter: brightness(1.6);
}

/* Cartes produits : les photos gardent leur fond ivoire, posées comme des tirages */
[data-theme="sombre"] .wc-block-components-product-image img,
[data-theme="sombre"] .wp-block-woocommerce-product-image img {
	background: #F2EAE2;
}

/* Mini-panier (tiroir), fenêtre d'achat rapide, accordéons */
[data-theme="sombre"] .wc-block-components-drawer,
[data-theme="sombre"] .wc-block-mini-cart__drawer .components-modal__content,
[data-theme="sombre"] .wc-block-mini-cart__template-part {
	background-color: #16101B !important;
	color: #F2EAE2 !important;
}
[data-theme="sombre"] .diwan-modale {
	background: #16101B;
	color: #F2EAE2;
}
[data-theme="sombre"] .diwan-faq__item {
	border-bottom-color: #3A3040;
}

/* Lien et filets */
[data-theme="sombre"] a:where(:not(.wp-element-button):not(.diwan-achat-rapide__bouton):not(.diwan-whatsapp-fixe):not(.wc-block-mini-cart__button)) {
	color: #CCAF98;
}
[data-theme="sombre"] .diwan-epuisees__alerte {
	color: #8FC3BD;
}
[data-theme="sombre"] .diwan-question-whatsapp a {
	color: #8FC3BD;
}

/* Logos (repli instantané pour les navigateurs qui le permettent ; sinon le script change l'image) */
[data-theme="sombre"] .diwan-entete__logo img[src*="name-one-colour-night"] {
	content: url("../images/diwan-reem-name-one-colour-pearl.png");
}
