/* ==========================================================================
   1.8.381 — Designer product configurator (body.idx-configurator, set only on
   Chamevo designer products by inc/configurator.php). Loads after
   product-customizer.css. Chamevo is styled only through its public --cv-*
   tokens and exported ::part()s; the rail behaviour lives in configurator.js.
   ========================================================================== */
body.idx-configurator {
	--idxcz-header: 52px;
	--idxcz-admin: 0px;
	--idxcz-top: calc(var(--idxcz-header) + var(--idxcz-admin));
	--idxcz-gap: 12px;
	--idxcz-cookie: 0px; /* 1.8.385 — height reserved for the cookie banner while it is showing */
	--idxcz-h: max(520px, calc(100vh - var(--idxcz-top) - 2 * var(--idxcz-gap) - var(--idxcz-cookie)));
	--idxcz-panel-w: 272px;
	--idxcz-rail-w: 70px;
}
body.idx-configurator.admin-bar { --idxcz-admin: 32px; }
@media (max-width: 782px) { body.idx-configurator.admin-bar { --idxcz-admin: 46px; } }

/* ---------- 1. Compact chrome ---------- */
body.idx-configurator .site-announce,
body.idx-configurator .dtf-announce { display: none !important; }
body.idx-configurator .site-header .idx-breadcrumbs,
body.idx-configurator .site-header nav[aria-label="Breadcrumb"],
body.idx-configurator .site-header .breadcrumbs { display: none !important; }
body.idx-configurator .site-header .site-header__inner,
body.idx-configurator .site-header.is-scrolled .site-header__inner {
	min-height: var(--idxcz-header) !important; height: var(--idxcz-header);
	width: auto; max-width: none; margin: 0; padding: 0 clamp(10px, 1.4vw, 18px);
	gap: .75rem;
}
body.idx-configurator .site-branding__logo--default,
body.idx-configurator .site-branding__logo--default img,
body.idx-configurator .site-branding__logo--default .custom-logo,
body.idx-configurator .site-branding img.site-branding__logo--default,
body.idx-configurator .site-branding svg.site-branding__logo--default { height: 34px !important; max-width: 170px !important; }
body.idx-configurator .site-header.is-scrolled .site-branding img.site-branding__logo--scroll,
body.idx-configurator .site-header.is-scrolled .site-branding__logo--scroll { height: 24px !important; max-width: 130px !important; }
body.idx-configurator .site-nav__trigger { font-size: .8rem; }
body.idx-configurator .site-header__actions { gap: .5rem !important; flex-wrap: nowrap !important; }
body.idx-configurator .header-account { font-size: .78rem !important; padding: .3rem .6rem !important; }
body.idx-configurator .header-cart,
body.idx-configurator .site-header.is-scrolled .header-cart { width: 36px !important; height: 36px !important; }
body.idx-configurator .header-cart__icon svg,
body.idx-configurator .site-header.is-scrolled .header-cart__icon svg { width: 18px !important; height: 18px !important; }
body.idx-configurator .lang-switch a,
body.idx-configurator .lang-switch span { font-size: .72rem; }

/* ---------- 2. Full-width app layout ---------- */
body.idx-configurator #shop-content.section { padding: var(--idxcz-gap) 0 calc(var(--idxcz-gap) * 1.5); }
body.idx-configurator #shop-content.section > .container {
	width: auto !important; max-width: none !important; margin: 0 !important;
	padding-left: clamp(8px, 1vw, 14px) !important; padding-right: clamp(8px, 1vw, 14px) !important;
}
body.idx-configurator div.product { gap: var(--idxcz-gap); }

/* Desktop: designer | product panel, both exactly one viewport tall, nothing below. */
@media (min-width: 1024px) {
	body.idx-configurator div.product {
		grid-template-columns: minmax(0, 1fr) clamp(270px, 20vw, 296px); /* 1.8.384: was clamp(300px, 24vw, 340px) */
		grid-template-rows: var(--idxcz-h);
		align-items: stretch;
	}
	body.idx-configurator div.product .cha-product-designer-wrapper { height: var(--idxcz-h); }
	body.idx-configurator cv-customizer {
		--cv-customizer-height: var(--idxcz-h);
		--cv-customizer-max-height: none;
		--cv-customizer-min-height: 520px;
		height: 100%;
	}
	/* 4. Product panel: compact, fully in view, scrolls inside itself, never overlaps. */
	body.idx-configurator div.product div.summary.entry-summary,
	body.admin-bar.idx-configurator div.product div.summary.entry-summary {
		position: relative; top: auto;
		align-self: stretch;
		max-height: var(--idxcz-h); overflow-y: auto; overscroll-behavior: contain;
		scrollbar-width: thin; scrollbar-color: #b9bdd0 transparent;
	}
}

/* ---------- 4. Compact product panel (all widths) ---------- */
body.idx-configurator div.product div.summary.entry-summary { padding: 12px 14px; gap: 8px; border-width: 1.5px; }
body.idx-configurator div.product .summary .product_title { font-size: clamp(1rem, 1.15vw, 1.15rem); }
body.idx-configurator div.product .summary > p.price,
body.idx-configurator div.product .summary .woocommerce-variation-price .price { padding: 7px 11px; font-size: 1.15rem; gap: .1rem .5rem; border-radius: 7px; }
body.idx-configurator div.product .summary > p.price::before,
body.idx-configurator div.product .summary .woocommerce-variation-price .price::before { font-size: .6rem; }
body.idx-configurator div.product .woocommerce-product-details__short-description { font-size: .78rem; line-height: 1.42; }
body.idx-configurator div.product .woocommerce-product-details__short-description p { margin-bottom: .4rem; }
body.idx-configurator div.product .woocommerce-product-details__short-description p:first-child > strong:only-child { padding: .18rem .55rem; font-size: .7rem; border-radius: 6px; }
body.idx-configurator div.product form.variations_form { padding-top: 8px; border-top-width: 1.5px; }
body.idx-configurator div.product table.variations { margin-bottom: 2px; }
body.idx-configurator div.product table.variations tr { margin-bottom: 8px; }
body.idx-configurator div.product table.variations th.label label { margin-bottom: 4px; font-size: .66rem; }
body.idx-configurator .idxpc-choices { gap: 5px; }
body.idx-configurator .idxpc-chip { min-height: 32px; padding: .25rem .6rem; gap: .35rem; font-size: .8rem; border-radius: 7px; border-width: 1.25px; }
body.idx-configurator .idxpc-chip__dot { width: 13px; height: 13px; }
body.idx-configurator div.product .reset_variations { margin-top: 2px; font-size: .75rem; }
body.idx-configurator div.product .single_variation_wrap { gap: 8px; }
body.idx-configurator div.product .woocommerce-variation-add-to-cart { gap: 8px; }
body.idx-configurator div.product form.cart .quantity input.qty { width: 4rem !important; min-height: 42px; font-size: .95rem; }
body.idx-configurator div.product form.cart .single_add_to_cart_button { min-height: 42px; font-size: .9rem !important; box-shadow: inset 0 -3px 0 var(--pc-navy); }
body.idx-configurator div.product .product_meta { display: none; }
body.idx-configurator div.product > .woocommerce-tabs { display: none; } /* belt and braces; the PHP filter removes them */

/* ---------- 3. Nested left tool rail ---------- */
body.idx-configurator cv-customizer { --cv-mainbar-width: var(--idxcz-rail-w); }
body.idx-configurator cv-customizer.idxcz-icons { --idxcz-rail-w: 58px; }
body.idx-configurator cv-customizer::part(mainbar) { background: #fff; }
body.idx-configurator cv-customizer::part(mainbar-item) { border-radius: 8px; }
/* Panel anchored to the rail (both modes): full main-area height, beside the rail. */
body.idx-configurator cv-customizer.idxcz-ready:not([data-layout-size="sm"])::part(module-panel) {
	position: absolute !important;
	left: var(--idxcz-rail-w) !important;
	top: var(--idxcz-main-top, 40px) !important;
	height: var(--idxcz-main-h, calc(100% - 80px)) !important;
	max-height: none !important;
	width: var(--idxcz-panel-w) !important;
	transform: none !important;
	opacity: 1 !important; pointer-events: auto !important;
	border: 0 !important; border-right: 1px solid #d6d9e6 !important;
	z-index: 40;
}
/* Pinned = full flyout docked open; the canvas area is pushed over. */
body.idx-configurator cv-customizer.idxcz-ready.idxcz-pinned:not([data-layout-size="sm"])::part(module-panel) {
	border-radius: 0 !important; box-shadow: none !important;
	animation: none;
}
body.idx-configurator cv-customizer.idxcz-ready.idxcz-pinned:not([data-layout-size="sm"])::part(canvas-area) {
	margin-left: var(--idxcz-panel-w);
	transition: margin-left .2s ease;
}
/* Icon mode = hover pop-out over the canvas edge. */
body.idx-configurator cv-customizer.idxcz-ready.idxcz-icons:not([data-layout-size="sm"])::part(module-panel) {
	border-radius: 0 10px 10px 0 !important;
	border: 1.5px solid #0f143a !important; border-left: 0 !important;
	box-shadow: 18px 0 40px -18px rgba(15, 20, 58, .45) !important;
	z-index: 70;
	animation: idxcz-pop .16s ease-out;
}
@keyframes idxcz-pop { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
	body.idx-configurator cv-customizer::part(module-panel) { animation: none !important; }
	body.idx-configurator cv-customizer::part(canvas-area) { transition: none !important; }
}

/* ---------- Tablet / phone ---------- */
@media (max-width: 1023px) {
	body.idx-configurator div.product div.summary.entry-summary { position: static; max-height: none; overflow: visible; }
	body.idx-configurator cv-customizer { --cv-customizer-height: min(680px, calc(100vh - var(--idxcz-top) - 24px)); --cv-customizer-max-height: none; --cv-customizer-min-height: 460px; }
	body.idx-configurator .site-nav__trigger { font-size: .74rem; }
}
@media (max-width: 600px) {
	body.idx-configurator { --idxcz-header: 52px; }
	body.idx-configurator cv-customizer { --cv-customizer-height: min(560px, calc(100vh - var(--idxcz-top) - 20px)); --cv-customizer-min-height: 420px; }
	body.idx-configurator .idxpc-chip { min-height: 38px; }
}
