/* IdeasWood Product Options — product page.
 * Scoped under .iwpo with enough specificity to survive Divi's form styles. */
.iwpo {
	--iwpo-accent: #378682;
	--iwpo-text: #333;
	--iwpo-muted: #666;
	--iwpo-line: #e5e5e5;
	--iwpo-soft: #f6f8f8;
	--iwpo-radius: 8px;
	--iwpo-img: 96px;
	clear: both;
	width: 100%;
	margin: 0 0 1.5em;
	color: var(--iwpo-muted);
	font-size: 15px;
	line-height: 1.5;
	text-align: left;
}
.iwpo *, .iwpo *::before, .iwpo *::after { box-sizing: border-box; }
.iwpo [hidden] { display: none !important; }

/* Sections (accordion) */
.iwpo .iwpo-section { border-top: 1px solid var(--iwpo-line); }
.iwpo .iwpo-section:last-of-type { border-bottom: 1px solid var(--iwpo-line); }
.iwpo .iwpo-section__head {
	display: flex; align-items: center; gap: .75em; width: 100%;
	padding: 14px 2px; margin: 0; background: none; border: 0; border-radius: 0;
	color: var(--iwpo-text); font: inherit; font-weight: 600; font-size: 16px; text-align: left;
	cursor: default; box-shadow: none; text-transform: none; letter-spacing: 0;
}
.iwpo button.iwpo-section__head { cursor: pointer; }
.iwpo button.iwpo-section__head:hover, .iwpo button.iwpo-section__head:focus { background: none; color: var(--iwpo-accent); }
.iwpo button.iwpo-section__head:focus-visible { outline: 2px solid var(--iwpo-accent); outline-offset: 2px; }
.iwpo .iwpo-section__title { flex: 0 1 auto; }
.iwpo .iwpo-section__picked {
	flex: 1 1 auto; min-width: 0; color: var(--iwpo-accent); font-weight: 400; font-size: 14px;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right;
}
.iwpo .iwpo-chev { flex: 0 0 auto; width: 10px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: -4px 4px 0 0; transition: transform .2s; }
.iwpo .is-collapsed .iwpo-chev { transform: rotate(-45deg); margin-top: 0; }
.iwpo .iwpo-section__body { padding: 0 0 16px; }
.iwpo .is-collapsed .iwpo-section__body { display: none; }
.iwpo .iwpo-section:not(.is-collapsible) .iwpo-section__body { padding-top: 12px; }
.iwpo .iwpo-section__desc { margin: 0 0 10px; font-size: 14px; }

/* Fields */
.iwpo .iwpo-field { margin: 0 0 14px; }
.iwpo .iwpo-field:last-child { margin-bottom: 0; }
.iwpo .iwpo-field__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5em 1em; margin: 0 0 8px; }
.iwpo .iwpo-field__label { color: var(--iwpo-text); font-weight: 600; }
.iwpo .iwpo-section:not(.is-collapsible) .iwpo-field__label:only-child { font-size: 15px; }
.iwpo .iwpo-req { color: #b32d2e; text-decoration: none; border: 0; }
.iwpo .iwpo-help { font-size: 13px; color: var(--iwpo-accent); text-decoration: underline; }
.iwpo .iwpo-field__desc { margin: -2px 0 10px; font-size: 13.5px; }
.iwpo .iwpo-field__error { margin-top: 6px; color: #b32d2e; font-size: 13px; font-weight: 600; }
.iwpo .iwpo-field.has-error .iwpo-choices,
.iwpo .iwpo-field.has-error select { outline: 2px solid #b32d2e; outline-offset: 4px; border-radius: var(--iwpo-radius); }
.iwpo .iwpo-errors { margin: 0 0 12px; padding: 10px 12px; border-radius: var(--iwpo-radius); background: #fcf0f1; color: #8a1f22; font-weight: 600; }

/* Choices */
.iwpo .iwpo-choices { display: grid; gap: 10px; grid-template-columns: repeat(var(--iwpo-cols, 4), minmax(0, 1fr)); }
.iwpo .iwpo-cols-1 { --iwpo-cols: 1; } .iwpo .iwpo-cols-2 { --iwpo-cols: 2; } .iwpo .iwpo-cols-3 { --iwpo-cols: 3; }
.iwpo .iwpo-cols-4 { --iwpo-cols: 4; } .iwpo .iwpo-cols-5 { --iwpo-cols: 5; } .iwpo .iwpo-cols-6 { --iwpo-cols: 6; }
.iwpo .iwpo-img--s { --iwpo-img: 64px; } .iwpo .iwpo-img--m { --iwpo-img: 96px; }
.iwpo .iwpo-img--l { --iwpo-img: 150px; } .iwpo .iwpo-img--xl { --iwpo-img: 220px; }

.iwpo .iwpo-choice {
	position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0;
	margin: 0; padding: 8px; border: 1px solid var(--iwpo-line); border-radius: var(--iwpo-radius);
	background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s;
	color: var(--iwpo-muted); font-weight: 400;
}
.iwpo .iwpo-choice:hover { border-color: #bbb; }
.iwpo .iwpo-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.iwpo .iwpo-choice:has(input:checked) { border-color: var(--iwpo-accent); box-shadow: 0 0 0 1px var(--iwpo-accent); background: var(--iwpo-soft); }
.iwpo .iwpo-choice:has(input:focus-visible) { outline: 2px solid var(--iwpo-accent); outline-offset: 2px; }
.iwpo .iwpo-choice__media { position: relative; display: block; width: 100%; aspect-ratio: 1 / 1; max-height: calc(var(--iwpo-img) * 1.6); border-radius: calc(var(--iwpo-radius) - 3px); overflow: hidden; background: var(--iwpo-soft); }
.iwpo .iwpo-choice__media img { display: block; width: 100%; height: 100%; object-fit: cover; margin: 0; border: 0; max-width: none; }
.iwpo .iwpo-fit--contain .iwpo-choice__media img { object-fit: contain; }
.iwpo .iwpo-choice__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.iwpo .iwpo-choice__label { color: var(--iwpo-text); font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.iwpo .iwpo-choice__price { color: var(--iwpo-accent); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.iwpo .iwpo-choice__desc { font-size: 13px; line-height: 1.45; }
.iwpo .iwpo-choice__desc p { margin: 0 0 .4em; padding: 0; }
.iwpo .iwpo-choice__links { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; }
.iwpo .iwpo-choice__links a { color: var(--iwpo-accent); text-decoration: underline; }
.iwpo .iwpo-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.iwpo .iwpo-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; background: var(--iwpo-badge, var(--iwpo-accent)); color: #fff; font-size: 11px; font-weight: 600; line-height: 1.6; }
.iwpo .iwpo-choice__media + .iwpo-choice__body .iwpo-badges { position: absolute; top: 12px; left: 12px; }

/* tick */
.iwpo .iwpo-check { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--iwpo-accent); opacity: 0; transform: scale(.6); transition: .15s; }
.iwpo .iwpo-check::after { content: ""; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.iwpo .iwpo-choice:has(input:checked) .iwpo-check { opacity: 1; transform: none; }

/* zoom button */
.iwpo .iwpo-zoom { position: absolute; left: 6px; bottom: 6px; width: 28px; height: 28px; padding: 0; margin: 0; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; cursor: zoom-in; opacity: .85; line-height: 1; font-size: 0; min-width: 0; box-shadow: none; }
.iwpo .iwpo-zoom::before { content: ""; position: absolute; left: 8px; top: 7px; width: 9px; height: 9px; border: 2px solid #fff; border-radius: 50%; }
.iwpo .iwpo-zoom::after { content: ""; position: absolute; left: 18px; top: 17px; width: 2px; height: 6px; background: #fff; transform: rotate(-45deg); }
.iwpo .iwpo-zoom:hover { opacity: 1; }
.iwpo .iwpo-zoom__count { position: absolute; right: -6px; top: -6px; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; background: var(--iwpo-accent); color: #fff; font-size: 10px; line-height: 16px; text-align: center; }

/* layout: cards — big image left, text right */
.iwpo .iwpo-layout--cards { grid-template-columns: repeat(min(var(--iwpo-cols), 2), minmax(0, 1fr)); }
.iwpo .iwpo-layout--cards .iwpo-choice { flex-direction: row; align-items: flex-start; gap: 12px; padding: 10px; }
.iwpo .iwpo-layout--cards .iwpo-choice__media { flex: 0 0 var(--iwpo-img); width: var(--iwpo-img); height: var(--iwpo-img); aspect-ratio: auto; }
.iwpo .iwpo-layout--cards .iwpo-badges { position: static !important; }

/* layout: list — radio-like rows */
.iwpo .iwpo-layout--list { grid-template-columns: 1fr; gap: 6px; }
.iwpo .iwpo-layout--list .iwpo-choice { flex-direction: row; align-items: center; gap: 10px; padding: 9px 12px; }
.iwpo .iwpo-layout--list .iwpo-choice__body { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; flex: 1; }
.iwpo .iwpo-layout--list .iwpo-choice__label { flex: 1 1 auto; }
.iwpo .iwpo-layout--list .iwpo-choice__desc, .iwpo .iwpo-layout--list .iwpo-choice__links { flex-basis: 100%; }
.iwpo .iwpo-layout--list .iwpo-choice__media.is-small { flex: 0 0 44px; width: 44px; height: 44px; }
.iwpo .iwpo-layout--list .iwpo-check, .iwpo .iwpo-layout--list .iwpo-zoom { display: none; }
.iwpo .iwpo-choice__mark { flex: 0 0 18px; width: 18px; height: 18px; border: 2px solid #aaa; border-radius: 50%; background: #fff; }
.iwpo .iwpo-field--checkbox .iwpo-choice__mark, .iwpo .iwpo-choices[role=group] .iwpo-choice__mark { border-radius: 4px; }
.iwpo .iwpo-choice:has(input:checked) .iwpo-choice__mark { border-color: var(--iwpo-accent); background: var(--iwpo-accent); box-shadow: inset 0 0 0 3px #fff; }

/* layout: swatch — small images only, label in tooltip */
.iwpo .iwpo-layout--swatch { display: flex; flex-wrap: wrap; gap: 8px; }
.iwpo .iwpo-layout--swatch .iwpo-choice { width: calc(var(--iwpo-img) * .7); padding: 3px; }
.iwpo .iwpo-layout--swatch .iwpo-choice__body { display: none; }
.iwpo .iwpo-layout--swatch .iwpo-zoom { display: none; }

/* select, quantity, text */
.iwpo select.iwpo-select, .iwpo .iwpo-qty__input, .iwpo textarea.iwpo-text {
	width: 100%; max-width: 100%; padding: 10px 12px; border: 1px solid #ccc; border-radius: var(--iwpo-radius);
	background: #fff; color: var(--iwpo-text); font: inherit; font-size: 15px; height: auto; box-shadow: none;
}
.iwpo .iwpo-qty { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.iwpo .iwpo-qty__input { width: 120px; }
.iwpo .iwpo-qty__price { font-size: 13px; }

/* Summary */
.iwpo .iwpo-summary { margin: 18px 0 0; padding: 14px 16px; border-radius: var(--iwpo-radius); background: var(--iwpo-soft); }
.iwpo .iwpo-summary__row, .iwpo .iwpo-summary__lines li { display: flex; justify-content: space-between; gap: 12px; }
.iwpo .iwpo-summary__lines { margin: 6px 0; padding: 6px 0; list-style: none; border-top: 1px dashed var(--iwpo-line); border-bottom: 1px dashed var(--iwpo-line); font-size: 13px; }
.iwpo .iwpo-summary__lines:empty { display: none; }
.iwpo .iwpo-summary__lines li { padding: 2px 0; margin: 0; list-style: none; }
.iwpo .iwpo-summary__lines li span:last-child { white-space: nowrap; }
.iwpo .iwpo-summary__total { margin-top: 6px; color: var(--iwpo-text); font-size: 18px; font-weight: 700; }
.iwpo .iwpo-summary__total span:last-child { color: var(--iwpo-accent); }
.iwpo .iwpo-summary.is-pending .iwpo-summary__total span:last-child { font-size: 13px; font-weight: 400; color: var(--iwpo-muted); }
.iwpo .iwpo-summary__note { font-size: 12px; text-align: right; }

/* Lightbox */
.iwpo-lb { position: fixed; inset: 0; z-index: 999999; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.88); }
.iwpo-lb[hidden] { display: none; }
html.iwpo-lb-open { overflow: hidden; }
.iwpo-lb__fig { margin: 0; max-width: 92vw; max-height: 88vh; text-align: center; }
.iwpo-lb__fig img { display: block; max-width: 92vw; max-height: 80vh; margin: 0 auto; object-fit: contain; }
.iwpo-lb__fig figcaption { margin-top: 10px; color: #eee; font-size: 15px; }
.iwpo-lb button { position: absolute; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 34px; line-height: 1; width: 52px; height: 52px; border-radius: 50%; cursor: pointer; padding: 0; }
.iwpo-lb button:hover { background: rgba(255,255,255,.25); }
.iwpo-lb__close { top: 16px; right: 16px; }
.iwpo-lb__prev { left: 16px; top: 50%; transform: translateY(-50%); }
.iwpo-lb__next { right: 16px; top: 50%; transform: translateY(-50%); }
.iwpo-lb.is-single .iwpo-lb__prev, .iwpo-lb.is-single .iwpo-lb__next { display: none; }
.iwpo-lb__count { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: #ccc; font-size: 13px; }

@media (max-width: 767px) {
	.iwpo .iwpo-choices { grid-template-columns: repeat(min(var(--iwpo-cols), 3), minmax(0, 1fr)); }
	.iwpo .iwpo-layout--cards { grid-template-columns: 1fr; }
	.iwpo .iwpo-layout--list { grid-template-columns: 1fr; }
	.iwpo .iwpo-section__picked { display: none; }
}
@media (max-width: 420px) {
	.iwpo .iwpo-choices:not(.iwpo-layout--list):not(.iwpo-layout--cards) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.iwpo .iwpo-field__head.is-label-hidden .iwpo-field__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.iwpo .iwpo-field__head.is-label-hidden:not(:has(.iwpo-help)) { margin: 0; }
/* magnifier icon (replaces the CSS-drawn one) */
.iwpo .iwpo-zoom::before, .iwpo .iwpo-zoom::after { content: none; }
.iwpo .iwpo-zoom { background: rgba(0,0,0,.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6'/%3E%3Cpath d='M15 15l5 5M10.5 8v5M8 10.5h5'/%3E%3C/svg%3E") center / 16px no-repeat; }
.iwpo .iwpo-zoom:hover { background-color: rgba(0,0,0,.8); }

/* ── Block title + "below" position (full width under the description, like ideaswood.com) ── */
.iwpo .iwpo-title { display: none; margin: 0 0 14px; padding: 0; color: var(--iwpo-text); font-size: 24px; font-weight: 700; line-height: 1.3; }
.iwpo.is-below { clear: both; margin: 32px 0; padding: 24px 28px; border: 1px solid var(--iwpo-line); border-radius: 12px; background: #fff; }
.iwpo.is-below .iwpo-title { display: block; }
.iwpo.is-below .iwpo-section__head { font-size: 17px; padding: 16px 2px; }
/* more room → more, larger image cards per row, images always above the text */
.iwpo.is-below .iwpo-layout--grid { grid-template-columns: repeat(auto-fill, minmax(max(140px, calc(var(--iwpo-img) * 1.5)), 1fr)); }
.iwpo.is-below .iwpo-layout--cards { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.iwpo.is-below .iwpo-choice__media { max-height: none; }
.iwpo.is-below .iwpo-summary { margin-top: 20px; }
/* buy bar: sticks to the bottom of the screen while the options are on screen */
.iwpo .iwpo-buybar { position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px;
	margin: 16px -28px -24px; padding: 14px 28px; border-top: 1px solid var(--iwpo-line); border-radius: 0 0 12px 12px;
	background: rgba(255,255,255,.97); box-shadow: 0 -6px 16px rgba(0,0,0,.06); }
.iwpo .iwpo-buybar__total { color: var(--iwpo-text); font-size: 15px; }
.iwpo .iwpo-buybar__sum { margin-left: 6px; color: var(--iwpo-accent); font-size: 22px; font-weight: 700; }
.iwpo .iwpo-buybar__btn { margin: 0; padding: 12px 28px; border: 0; border-radius: 6px; background: var(--iwpo-accent); color: #fff; font-size: 16px; font-weight: 600; cursor: pointer; }
.iwpo .iwpo-buybar__btn:hover { filter: brightness(.95); color: #fff; }
.iwpo-jump { display: block; margin: 0 0 12px; color: var(--iwpo-accent, #378682); font-weight: 600; text-decoration: underline; }
@media (max-width: 767px) {
	.iwpo.is-below { margin: 20px 0; padding: 16px; }
	.iwpo .iwpo-buybar { margin: 16px -16px -16px; padding: 12px 16px; }
	.iwpo.is-below .iwpo-layout--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.iwpo .iwpo-buybar__sum { font-size: 18px; }
}
