/* Print Shop product configurator. Colours come from the theme's custom properties, with brand fallbacks. */
.tp-cfg {
	--tp-primary: var(--wp--preset--color--primary, #1f2937);
	--tp-primary-dark: var(--wp--preset--color--primary-dark, #111827);
	--tp-ink: var(--wp--preset--color--ink, #111827);
	--tp-muted: var(--wp--preset--color--muted, #4b5563);
	--tp-line: var(--wp--preset--color--line, #d1d5db);
	--tp-tint: var(--wp--preset--color--tint, #f3f4f6);
	--tp-white: #fff;
	margin-top: 8px;
}
.tp-cfg__form { display: flex; flex-direction: column; gap: 22px; margin: 0; }
.tp-cfg__group { border: 0; margin: 0; padding: 0; min-width: 0; }
.tp-cfg__group[hidden] { display: none; }
.tp-cfg__legend { font-weight: 700; font-size: 15px; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; width: 100%; }
.tp-cfg__current { font-weight: 400; color: var(--tp-muted); }
.tp-cfg__cutoff { margin-left: auto; font-size: 14px; color: var(--tp-primary-dark); }
.tp-cfg__choices { display: flex; flex-wrap: wrap; gap: 10px; }
.tp-cfg__loading { color: var(--tp-muted); font-size: 15px; }

/* Choice buttons (radio inputs kept for keyboard and screen readers). */
.tp-choice, .tp-speed { position: relative; cursor: pointer; }
.tp-choice input, .tp-speed input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.tp-choice__label {
	display: inline-flex; flex-direction: column; justify-content: center; min-height: 46px; min-width: 64px; box-sizing: border-box;
	padding: 10px 16px; border: 1px solid var(--tp-line); border-radius: 12px; background: var(--tp-white);
	font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--tp-ink); text-align: center;
}
.tp-choice__label small { display: block; font-size: 12px; font-weight: 400; color: var(--tp-muted); }
.tp-choice:hover .tp-choice__label { border-color: var(--tp-primary); }
.tp-choice input:checked + .tp-choice__label { border: 2px solid var(--tp-primary); padding: 9px 15px; background: var(--tp-tint); color: var(--tp-primary-dark); font-weight: 700; }
.tp-choice input:focus-visible + .tp-choice__label, .tp-speed input:focus-visible + .tp-speed__label { outline: 3px solid var(--tp-primary-dark); outline-offset: 2px; }
.tp-choice input:disabled + .tp-choice__label { display: none; }
.tp-choice.is-unavailable .tp-choice__label { border-style: dashed; color: var(--tp-muted); font-weight: 400; }
.tp-cfg__group--single .tp-choice__label { border: 0; padding: 0; min-height: 0; background: none; color: var(--tp-ink); font-weight: 400; }
.tp-cfg__group--single .tp-choice input:checked + .tp-choice__label { border: 0; padding: 0; background: none; color: var(--tp-ink); font-weight: 400; }
/* Text options with many or long choices become one dropdown (configurator.js asSelect); the radios stay hidden. */
.tp-cfg__group.is-select .tp-cfg__choices, .tp-cfg__group.is-select .tp-cfg__more { display: none; }
.tp-cfg__group.is-select .tp-cfg__current { display: none; } /* The dropdown already shows the choice. */

/* Styled dropdown (configurator.js dropdown()): a button showing the choice, and a listbox panel under it. */
.tp-dd { position: relative; max-width: 460px; }
.tp-dd__button {
	display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 52px; box-sizing: border-box;
	padding: 12px 16px; border: 1px solid var(--tp-line); border-radius: 12px; background: var(--tp-white); color: var(--tp-ink);
	font: inherit; font-size: 15px; font-weight: 600; text-align: left; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s;
}
.tp-dd__button:hover { border-color: var(--tp-ink); }
.tp-dd__button:focus-visible { outline: 3px solid var(--tp-primary-dark); outline-offset: 2px; }
.tp-dd.is-open .tp-dd__button { border-color: var(--tp-primary); box-shadow: 0 0 0 3px var(--tp-tint); }
.tp-dd__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-dd__chevron { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--tp-tint); position: relative; transition: transform 0.2s; }
.tp-dd__chevron::before { content: ""; position: absolute; left: 50%; top: 45%; width: 7px; height: 7px; border-right: 2px solid var(--tp-primary); border-bottom: 2px solid var(--tp-primary); transform: translate(-50%, -50%) rotate(45deg); }
.tp-dd.is-open .tp-dd__chevron { transform: rotate(180deg); }
.tp-dd__list {
	position: absolute; z-index: 25; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
	max-height: 320px; overflow-y: auto; background: var(--tp-white); border: 1px solid var(--tp-line); border-radius: 14px;
	box-shadow: 0 16px 40px rgba(11, 11, 18, 0.16); outline: none;
}
.tp-dd__list[hidden] { display: none; }
.tp-dd__option { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 11px 40px 11px 14px; border-radius: 9px; cursor: pointer; color: var(--tp-ink); font-size: 15px; line-height: 1.3; }
.tp-dd__option.is-active { background: #f4f4f7; }
.tp-dd__option[aria-selected="true"] { background: var(--tp-tint); color: var(--tp-primary-dark); font-weight: 700; }
.tp-dd__option[aria-selected="true"]::after { content: ""; position: absolute; right: 16px; top: 50%; width: 6px; height: 11px; border-right: 2px solid var(--tp-primary); border-bottom: 2px solid var(--tp-primary); transform: translateY(-65%) rotate(45deg); }
.tp-dd__note { font-size: 12px; font-weight: 400; color: var(--tp-muted); }
@media (prefers-reduced-motion: reduce) { .tp-dd__button, .tp-dd__chevron { transition: none; } }

/* Long tile lists: one row, the second fading out, then "Show all N options" (configurator.js fold). */
.tp-cfg__choices { position: relative; }
.tp-cfg__choices.is-faded { overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 3.5em), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 3.5em), transparent); }
.tp-cfg__more { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 9px 16px; border: 1px solid var(--tp-line); border-radius: 999px; background: var(--tp-white); color: var(--tp-ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.tp-cfg__more::after { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.tp-cfg__more[aria-expanded="true"]::after { transform: translateY(2px) rotate(-135deg); }
.tp-cfg__more:hover { border-color: var(--tp-ink); }
.tp-cfg__more:focus-visible { outline: 3px solid var(--tp-primary-dark); outline-offset: 2px; }
.tp-cfg__more[hidden] { display: none; }

/* Option icons (Helloprint's displayType): small ones sit beside the text, large ones make picture tiles. */
.tp-choice__icon { display: block; flex: none; object-fit: contain; }
.tp-cfg__group--icon-small .tp-choice__label { flex-direction: row; align-items: center; gap: 8px; text-align: left; }
.tp-cfg__group--icon-small .tp-choice__icon { width: 28px; height: 28px; }
.tp-cfg__group--icon-large .tp-cfg__choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.tp-cfg__group--icon-large .tp-choice__label { display: flex; align-items: center; gap: 6px; width: 100%; height: 100%; justify-content: flex-start; padding-top: 12px; }
.tp-cfg__group--icon-large .tp-choice input:checked + .tp-choice__label { padding-top: 11px; }
.tp-cfg__group--icon-large .tp-choice__icon { width: 64px; height: 64px; }
.tp-cfg__group--single .tp-cfg__current { display: none; }

[data-role="quantities"] .tp-choice__label small { margin-top: 2px; }
[data-role="quantities"] .tp-cfg__select { min-width: 0; flex: 1 1 200px; }
.tp-cfg__select { font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--tp-line); background: var(--tp-white); color: var(--tp-ink); min-width: 220px; max-width: 100%; }

/* Delivery speeds. */
.tp-cfg__speeds { display: flex; flex-direction: column; gap: 10px; }
.tp-speed__label { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 18px; border: 1px solid var(--tp-line); border-radius: 14px; background: var(--tp-white); }
.tp-speed:hover .tp-speed__label { border-color: var(--tp-primary); }
.tp-speed input:checked + .tp-speed__label { border: 2px solid var(--tp-primary); padding: 14px 17px; background: var(--tp-tint); }
.tp-speed__name strong { display: block; font-size: 16px; }
.tp-speed__name span { display: block; font-size: 14px; color: var(--tp-muted); }
.tp-speed__price { font-size: 18px; white-space: nowrap; }

/* Artwork. */
.tp-cfg__artwork { border: 2px dashed #9ca3af; border-radius: 16px; background: var(--tp-white); padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.tp-cfg__artwork-label strong { display: block; font-size: 16px; }
.tp-cfg__artwork-label span { display: block; font-size: 14px; color: var(--tp-muted); }
.tp-cfg__file { font: inherit; font-size: 15px; max-width: 100%; min-height: 44px; }
.tp-cfg__file::file-selector-button { font: inherit; font-weight: 700; padding: 9px 16px; margin-right: 12px; border-radius: 999px; border: 1px solid var(--tp-primary); background: var(--tp-white); color: var(--tp-primary); cursor: pointer; }

/* Summary. */
.tp-cfg__summary { background: var(--tp-white); border: 1px solid var(--wp--preset--color--line, #e5e7eb); border-radius: 18px; padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.tp-cfg__total { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.tp-cfg__line { font-size: 16px; color: var(--tp-muted); }
.tp-cfg__price { font-size: 30px; font-weight: 800; white-space: nowrap; }
.tp-cfg__price small { font-size: 16px; font-weight: 600; color: var(--tp-muted); }
.tp-cfg__group--qty .tp-cfg__choices { min-height: 48px; }
.tp-choice__hint { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tp-cfg__speeds:empty { min-height: 220px; }
.tp-cfg__actions { min-height: 56px; }
.tp-cfg__vat { font-size: 13px; color: var(--tp-muted); text-align: right; margin-top: -10px; }
.tp-cfg__vat:empty { display: none; }
.tp-cfg__add { width: 100%; font: inherit; font-size: 18px; font-weight: 700; padding: 16px; border-radius: 999px; border: 0; background: var(--tp-primary); color: var(--tp-white); cursor: pointer; }
.tp-cfg__add:hover { background: var(--tp-primary-dark); }
.tp-cfg__help { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 14px; font-weight: 700; }
.tp-cfg__message { margin: 0; padding: 12px 14px; border-radius: 12px; background: #fff4dc; color: var(--tp-ink); font-size: 15px; }
.tp-cfg.is-loading .tp-cfg__speeds, .tp-cfg.is-loading .tp-cfg__summary .tp-cfg__total { opacity: 0.55; transition: opacity 0.2s; }

.tp-specs { width: 100%; border-collapse: collapse; font-size: 15px; }
.tp-specs th, .tp-specs td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--wp--preset--color--line, #e5e7eb); }
.tp-specs th { width: 30%; font-weight: 700; }
