/**
 * Product Composer — Etxe Beroi
 * Galerie custom + overlay mockup/motif + selecteur placements
 */

/* ══════════════════════════════════════
   GALERIE CUSTOM
   ══════════════════════════════════════ */

.eb-gallery {
	display: block !important;
	width: 100%;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.eb-gallery__main {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	border-radius: 8px;
	overflow: hidden;
	background: #f8f8f8;
	margin-bottom: 12px;
}

.eb-gallery__slide {
	display: none;
	line-height: 0;
}

.eb-gallery__slide--active {
	display: block;
}

/* Toutes les images principales ont la meme taille */
.eb-gallery__slide > img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	display: block;
}

/* ── Thumbnails ── */
.eb-gallery__thumbs {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.eb-gallery__thumb {
	width: 72px;
	border-radius: 6px;
	overflow: hidden;
	cursor: pointer;
	border: 2px solid transparent;
	transition: border-color 0.2s ease;
	background: #f8f8f8;
	text-align: center;
}

.eb-gallery__thumb:hover {
	border-color: #9CA3AF;
}

.eb-gallery__thumb--active {
	border-color: #1A1A1A;
}

.eb-gallery__thumb > img {
	width: 100%;
	height: 68px;
	object-fit: cover;
	display: block;
}

.eb-gallery__thumb-label {
	display: block;
	font-size: 10px;
	line-height: 1;
	padding: 3px 0 4px;
	color: #4A5568;
	font-weight: 600;
}

/* ══════════════════════════════════════
   COMPOSITE OVERLAY
   ══════════════════════════════════════ */

.eb-composer {

	position: relative;
	width: 100%;
	line-height: 0;
}

/* Fond degrade sur les slides composites (mockup+motif) */
.eb-gallery__slide .eb-composer {
	background: radial-gradient(ellipse at 50% 45%, #ffffff 0%, #f0f0f0 55%, #e2e2e2 100%);
}

.eb-composer__mockup {
	display: block;
	width: 100%;
	height: auto;
}

.eb-composer__motif {
	position: absolute;
	pointer-events: none;
	transition: top 0.4s ease, left 0.4s ease, width 0.4s ease, transform 0.4s ease;
}

/* ── PiP (picture-in-picture) ── */
.eb-gallery__pip {
	position: absolute;
	bottom: 12px;
	right: 12px;
	width: 90px;
	border-radius: 6px;
	overflow: hidden;
	border: 2px solid #fff;
	box-shadow: 0 2px 8px rgba(0,0,0,0.2);
	cursor: pointer;
	z-index: 5;
	background: #f8f8f8;
	transition: transform 0.2s ease;
}

.eb-gallery__pip:hover {
	transform: scale(1.05);
}

.eb-composer--pip {
	width: 100%;
	line-height: 0;
}

.eb-composer--pip .eb-composer__mockup {
	width: 100%;
	height: auto;
	display: block;
}

.eb-gallery__pip-label {
	display: block;
	font-size: 9px;
	line-height: 1;
	padding: 3px 0 4px;
	text-align: center;
	color: #4A5568;
	font-weight: 600;
	background: #fff;
}

/* ── Thumb composite ── */
.eb-composer--thumb {
	width: 100%;
	height: 68px;
	overflow: hidden;
}

.eb-composer--thumb .eb-composer__mockup {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.eb-composer--thumb .eb-composer__motif {
	transition: none;
}

/* ══════════════════════════════════════
   SELECTEUR COMBO PLACEMENT (style swatch)
   ══════════════════════════════════════ */

/* Masquer le lien Effacer sur les produits composer */
.has-eb-composer .reset_variations {
	display: none !important;
}

/* Uniformiser l'espacement des lignes de la table variations */
.has-eb-composer table.variations tr td.value {
	padding-bottom: 12px;
}

/* Placement dans la table (injecte par JS) */
.has-eb-composer table.variations tr.eb-placement-row td.value {
	padding-top: 4px;
}

/* Espace entre la table variations et le bloc ajouter au panier */
.has-eb-composer .single_variation_wrap {
	padding-top: 30px !important;
}

/* Placement hors table (fallback PHP si JS ne tourne pas) */
.eb-placement-wrap {
	padding: 8px 0 4px;
}

.eb-placement-label {
	display: block;
	font-weight: 700;
	font-size: 14px;
	margin-bottom: 8px;
	color: #1A1A1A;
}

/* Fallback : quand le placement reste dans single_variation_wrap */
.single_variation_wrap > .eb-placement-wrap {
	padding: 12px 0 30px;
}

.eb-combo-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.eb-combo-item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 18px;
	border: 2px solid #d1d5db;
	border-radius: 50px;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
	user-select: none;
}

.eb-combo-item:hover {
	border-color: #9CA3AF;
	background: #f9fafb;
}

.eb-combo-item.selected {
	border-color: #2D6A4F;
	box-shadow: 0 0 0 2px #2D6A4F;
	background: #F0FDF4;
}

.eb-combo-item__label {
	white-space: nowrap;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	color: #4a5568;
}

.eb-combo-item.selected .eb-combo-item__label {
	color: #2D6A4F;
	font-weight: 700;
}

/* ══════════════════════════════════════
   ADMIN : PAGE MOCKUPS
   ══════════════════════════════════════ */

.eb-mockups-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 20px;
	margin-top: 20px;
}

.eb-mockup-card {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 6px;
	padding: 16px;
}

.eb-mockup-card h3 {
	margin: 0 0 12px;
	font-size: 14px;
	text-transform: capitalize;
}

.eb-mockup-card .eb-mockup-slot {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 10px;
}

.eb-mockup-card .eb-mockup-slot label {
	min-width: 50px;
	font-weight: 600;
	font-size: 13px;
}

.eb-mockup-card .eb-mockup-preview {
	width: 80px;
	height: 80px;
	object-fit: contain;
	border: 1px solid #eee;
	border-radius: 4px;
	background: #fafafa;
}

.eb-mockup-card .eb-mockup-preview--empty {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 80px;
	height: 80px;
	border: 2px dashed #ddd;
	border-radius: 4px;
	color: #999;
	font-size: 12px;
}

/* ══════════════════════════════════════
   ADMIN : META BOX MOTIF
   ══════════════════════════════════════ */

.eb-motif-wrap {
	text-align: center;
	padding: 10px;
}

.eb-motif-preview {
	max-width: 200px;
	max-height: 200px;
	border: 1px solid #eee;
	border-radius: 4px;
	margin-bottom: 10px;
	background: repeating-conic-gradient(#f0f0f0 0% 25%, #fff 0% 50%) 50% / 16px 16px;
}

.eb-motif-preview--empty {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 200px;
	height: 120px;
	border: 2px dashed #ddd;
	border-radius: 4px;
	color: #999;
	font-size: 13px;
	margin: 0 auto 10px;
	background: repeating-conic-gradient(#f0f0f0 0% 25%, #fff 0% 50%) 50% / 16px 16px;
}
