/**
 * Fiche produit en fenêtre (configurateur).
 *
 * Deux colonnes : visuel à gauche, contenu à droite. L'image est bornée pour ne jamais
 * dominer la fenêtre, et le contenu défile seul si la description est longue.
 */

.config-fiche { position: fixed; inset: 0; z-index: 1000000; display: none; }
.config-fiche.est-ouverte { display: block; }
.config-fiche__fond { position: absolute; inset: 0; background: rgba(40, 38, 25, .5); backdrop-filter: blur(2px); }

.config-fiche__boite {
	position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
	display: flex; flex-direction: column;
	width: min(820px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 48px));
	padding: 32px 36px;
	border-radius: 24px; background: #fff;
	box-shadow: 0 30px 70px rgba(50, 46, 25, .28);
	font-family: 'Basic Sans', 'basic-sans', sans-serif; color: #4A4A3F;
}
/* Le contenu (visuel + texte) est injecté par AJAX : c'est lui qui porte les deux colonnes. */
.config-fiche__contenu {
	display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 30px;
	flex: 1 1 auto; min-height: 0;
}

.config-fiche__fermer {
	position: absolute; top: 14px; right: 16px;
	width: 34px; height: 34px; padding: 0;
	border: none; border-radius: 50%; background: #F4F2E7;
	color: #8A8570; font-size: 1.25rem; line-height: 1; cursor: pointer;
	transition: background .2s, color .2s;
}
.config-fiche__fermer:hover { background: #BFAE41; color: #fff; }

/* Visuel : carré, jamais plus haut que la fenêtre */
.config-fiche__media {
	align-self: start;
	width: 240px; aspect-ratio: 1 / 1;
	border-radius: 16px; overflow: hidden; background: #F7F5EC;
}
.config-fiche__media img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Contenu : défile seul */
.config-fiche__corps { min-width: 0; overflow-y: auto; padding-right: 4px; }
.config-fiche__corps::-webkit-scrollbar { width: 6px; }
.config-fiche__corps::-webkit-scrollbar-thumb { background: rgba(191, 174, 65, .4); border-radius: 6px; }

.config-fiche__titre {
	margin: 0 0 6px;
	font-family: 'TheSeasons', serif; font-size: 1.5rem; font-weight: 400; line-height: 1.2;
}
.config-fiche__ref { margin: 0 0 18px; color: #8A8570; font-size: .85rem; letter-spacing: .02em; }

.config-fiche__description { font-size: .9rem; line-height: 1.55; color: #55554A; }
.config-fiche__description p { margin: 0 0 10px; }
.config-fiche__description ul { margin: 0 0 10px; padding-left: 18px; }
.config-fiche__description li { margin-bottom: 4px; }

.config-fiche__attributs { display: grid; gap: 0; margin: 18px 0 0; padding: 0; list-style: none; }
.config-fiche__attributs li {
	display: flex; justify-content: space-between; gap: 18px;
	padding: 9px 0; border-bottom: 1px solid rgba(85, 94, 80, .1);
	font-size: .87rem;
}
.config-fiche__attributs li:first-child { border-top: 1px solid rgba(85, 94, 80, .1); }
.config-fiche__attributs span { color: #8A8570; }
.config-fiche__attributs strong { font-weight: 700; text-align: right; }

.config-fiche__actions {
	display: flex; flex-wrap: wrap; align-items: center; gap: 18px;
	margin-top: 24px; padding-top: 20px; border-top: 1px solid rgba(85, 94, 80, .12);
}
.config-fiche__ajouter {
	display: inline-flex; align-items: center; justify-content: center;
	padding: 13px 28px; border-radius: 40px; background: #BFAE41; color: #fff;
	font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; text-decoration: none;
	transition: opacity .2s;
}
.config-fiche__ajouter:hover { opacity: .9; color: #fff; }
.config-fiche__ajouter.disabled { opacity: .45; pointer-events: none; }
.config-fiche__complete { color: #8A8570; font-size: .85rem; text-decoration: underline; }
.config-fiche__complete:hover { color: #BFAE41; }

.config-fiche__chargement { grid-column: 1 / -1; margin: 40px auto; color: #8A8570; }

body.config-fiche-ouverte { overflow: hidden; }

@media (max-width: 760px) {
	.config-fiche__boite { max-height: calc(100vh - 32px); padding: 24px 20px; }
	.config-fiche__contenu { grid-template-columns: minmax(0, 1fr); gap: 18px; overflow-y: auto; }
	.config-fiche__corps { overflow: visible; }
	.config-fiche__media { width: 180px; margin: 0 auto; }
	.config-fiche__titre { font-size: 1.25rem; }
	.config-fiche__actions { gap: 12px; }
	.config-fiche__ajouter { width: 100%; }
}

/* Le bouton garde sa largeur de contenu (les styles génériques du thème l'étiraient) */
.config-fiche .config-fiche__actions { align-items: center; }
.config-fiche a.config-fiche__ajouter { flex: 0 0 auto; width: auto; align-self: flex-start; }
.config-fiche .config-fiche__media { padding: 14px; }
@media (max-width: 760px) {
	.config-fiche a.config-fiche__ajouter { width: 100%; justify-content: center; }
}

/* style.css impose « width: 100% !important » à .add-request-quote-button (utile sur les
   fiches produit, pas ici) : dans la fenêtre, le bouton reprend la largeur de son texte. */
.config-fiche a.config-fiche__ajouter.add-request-quote-button {
	width: auto !important;
	padding: 13px 28px !important;
	font-size: .8rem !important;
	border-radius: 40px !important;
	min-height: 0 !important;
}
@media (max-width: 760px) {
	.config-fiche a.config-fiche__ajouter.add-request-quote-button { width: 100% !important; }
}

/* Croix de fermeture : centrage géométrique (le glyphe « × » n'est pas centré sur sa ligne) */
.config-fiche .config-fiche__fermer {
	display: inline-flex; align-items: center; justify-content: center;
	font-size: 0; line-height: 0;
}
.config-fiche .config-fiche__fermer::before {
	content: ''; display: block; width: 14px; height: 14px;
	background-color: currentColor;
	-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'%3E%3Cpath d='M5 5l14 14M19 5L5 19'/%3E%3C/svg%3E") center/14px 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'%3E%3Cpath d='M5 5l14 14M19 5L5 19'/%3E%3C/svg%3E") center/14px no-repeat;
}
