/**
 * "Complete your project" list, its pop-up and the total in the price block. Add to Basket is the theme's, untouched.
 * Loaded only on product pages that have parts.
 *
 * @author    PrestaChamps <support@prestachamps.com>
 * @copyright 2026 PrestaChamps
 * @license   Proprietary
 */
/* the variables also on the total, which lives in the theme's price block (outside .pchca) */
.pchca, .pchca-modal, .pchca-ptotal {
    --pchca-orange: #e8531a;
    --pchca-orange-h: #d04817;
    --pchca-green: #1a9a6a;
    --pchca-green-soft: #f2faf6;
    --pchca-red: #c62828;
    --pchca-red-soft: #fff6f6;
    --pchca-dark: #2a2a2a;
    --pchca-muted: #777;
    --pchca-border: #e2e0db;
    --pchca-soft: #fafaf8;
}
.pchca[hidden], .pchca [hidden] { display: none !important; }
/* the same 14 px above "Complete your project:", under it and under the list as between the product's option selects */
.pchca { width: 100%; max-width: 100%; margin: 14px 0; box-sizing: border-box; }
.pchca *, .pchca *::before, .pchca *::after, .pchca-modal *, .pchca-modal *::before, .pchca-modal *::after { box-sizing: border-box; }
.pchca-title { font-size: 14px; font-weight: 700; color: var(--pchca-dark); margin: 0 0 14px; }
.pchca-list { display: flex; flex-direction: column; gap: 8px; container-type: inline-size; }

/* one row per part: image, name + tag, "N options" (or the chosen option + Change), Add + / Added ✓. The whole row opens
   the pop-up; on hover its outline turns orange with a soft shadow, as the shop's other cards do */
.pchca-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1.5px solid var(--pchca-border); border-radius: 8px; background: #fff; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.pchca-item--required { border-color: var(--pchca-red); background: var(--pchca-red-soft); }
.pchca-item--added { border-color: var(--pchca-green); background: var(--pchca-green-soft); }
@media (hover: hover) {
    .pchca-item:hover { border-color: var(--pchca-orange); box-shadow: 0 4px 14px rgba(0, 0, 0, .07); }
    .pchca-item:hover .pchca-add-plus { background: var(--pchca-orange-h); }
}
.pchca-img { width: 44px; height: 44px; border: 1px solid var(--pchca-border); border-radius: 6px; flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #f4f3f0; }
.pchca-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pchca-info { flex: 1; min-width: 0; }
.pchca-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.pchca-label { font-size: 13.5px; font-weight: 700; color: var(--pchca-dark); line-height: 1.25; overflow-wrap: anywhere; }
/* may wrap inside its pill as a last resort (a browser without container queries, a very narrow column): never runs
   under Add + */
.pchca-tag { display: inline-block; max-width: 100%; padding: 2px 8px; border-radius: 10px; background: #ecebe7; color: #666; font-size: 11px; font-weight: 700; line-height: 1.35; letter-spacing: normal; text-transform: none; white-space: normal; }
.pchca-tag--req { background: var(--pchca-red); color: #fff; }
.pchca-item--added .pchca-tag { display: none; }
.pchca-meta { font-size: 12px; color: var(--pchca-muted); margin-top: 2px; overflow-wrap: anywhere; }
.pchca-chosen { color: var(--pchca-dark); }
.pchca-change { padding: 0; border: none; background: none; color: var(--pchca-dark); font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; }
.pchca-change:hover { color: var(--pchca-orange); }

.pchca-add { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 2px 0 4px; background: none; border: none; color: var(--pchca-orange); font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
/* the "+" is drawn with two bars, not a font glyph: the shop's font sits its "+" off centre in the box */
.pchca-add-plus { position: relative; display: inline-block; width: 20px; height: 20px; border-radius: 4px; background: var(--pchca-orange); font-size: 0; line-height: 0; }
.pchca-add-plus::before, .pchca-add-plus::after { content: ''; position: absolute; left: 5px; top: 9px; width: 10px; height: 2px; border-radius: 1px; background: #fff; }
.pchca-add-plus::after { transform: rotate(90deg); }
/* a narrow buy box (desktop windows ~1024-1240 px wide give a ~215-235 px list): the "+" box without the word, so the
   name column keeps room for "Required to fit"; the word stays for screen readers and the whole row is clickable */
@container (max-width: 249px) {
    .pchca-add-text { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
}
.pchca-add:hover .pchca-add-plus { background: var(--pchca-orange-h); }
.pchca-add:focus { outline: none; }
.pchca-add:focus-visible { outline: 2px solid #1a6fab; outline-offset: 2px; }
.pchca-add.pchca-added { color: var(--pchca-green); }
.pchca-add-check { position: relative; display: inline-block; width: 22px; height: 22px; border-radius: 50%; background: var(--pchca-green); }
.pchca-add-check::after { content: ''; position: absolute; left: 8px; top: 4px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }

.pchca-note { margin-top: 8px; padding: 7px 10px; font-size: 12px; color: var(--pchca-green); border-radius: 6px; background: var(--pchca-green-soft); }
.pchca-note--warn { color: #7a4a00; background: #fff6e6; }

/* the pop-up: every option of the part, a quantity, Add to project / Update + Remove */
.pchca-modal { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(20, 20, 20, .45); }
.pchca-modal-box { width: 100%; max-width: 440px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: #fff; border-radius: 10px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); overflow: hidden; }
.pchca-modal-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--pchca-border); }
.pchca-modal-head img { width: 48px; height: 48px; object-fit: contain; border: 1px solid var(--pchca-border); border-radius: 6px; background: #f4f3f0; }
.pchca-modal-titles { flex: 1; min-width: 0; }
.pchca-modal-title { font-size: 15px; font-weight: 700; color: var(--pchca-dark); }
.pchca-modal-sub { font-size: 12px; color: var(--pchca-muted); overflow-wrap: anywhere; }
.pchca-modal-x { width: 32px; height: 32px; border: none; background: none; font-size: 24px; line-height: 1; color: var(--pchca-muted); cursor: pointer; }
.pchca-modal-x:hover { color: var(--pchca-dark); }
.pchca-opts { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 6px; border: 2px solid transparent; }
.pchca-opts--missing { border-color: var(--pchca-red); border-radius: 8px; }
.pchca-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 1.5px solid var(--pchca-border); border-radius: 7px; background: #fff; text-align: left; font: inherit; cursor: pointer; }
.pchca-opt:hover { border-color: #bdbab3; }
.pchca-opt:focus { outline: none; }
.pchca-opt:focus-visible { outline: 2px solid #1a6fab; outline-offset: 1px; }
.pchca-opt--on { border-color: var(--pchca-orange); background: #fff7f3; }
.pchca-opt-dot { width: 16px; height: 16px; flex-shrink: 0; border: 2px solid #bdbab3; border-radius: 50%; }
.pchca-opt--on .pchca-opt-dot { border-color: var(--pchca-orange); box-shadow: inset 0 0 0 3px #fff; background: var(--pchca-orange); }
.pchca-opt-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--pchca-dark); overflow-wrap: anywhere; }
.pchca-opt-ref { font-weight: 400; color: var(--pchca-muted); }
.pchca-opt-price { font-size: 13px; font-weight: 700; color: var(--pchca-dark); white-space: nowrap; }
.pchca-opt-price small { font-weight: 400; color: var(--pchca-muted); }
.pchca-modal-foot { padding: 10px 14px 14px; border-top: 1px solid var(--pchca-border); background: var(--pchca-soft); }
.pchca-mtotal { font-size: 13px; color: var(--pchca-dark); margin-bottom: 8px; }
.pchca-mtotal--muted { color: var(--pchca-muted); }
.pchca-mrow { display: flex; gap: 6px; align-items: center; }
.pchca-qty { display: flex; align-items: center; border: 1.5px solid var(--pchca-border); border-radius: 6px; overflow: hidden; flex-shrink: 0; background: #fff; }
.pchca-qty button { width: 30px; height: 36px; border: none; background: #f0efeb; font-size: 15px; cursor: pointer; color: var(--pchca-dark); padding: 0; }
.pchca-qty button:hover { background: #e5e4df; }
.pchca-qty input { width: 38px; height: 36px; border: none; border-left: 1px solid var(--pchca-border); border-right: 1px solid var(--pchca-border); text-align: center; font-size: 14px; padding: 0; }
.pchca-confirm { flex: 1; min-width: 0; height: 36px; background: var(--pchca-orange); color: #fff; border: none; border-radius: 6px; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.pchca-confirm:hover { background: var(--pchca-orange-h); }
.pchca-cancel { height: 36px; padding: 0 12px; background: #fff; border: 1.5px solid var(--pchca-border); border-radius: 6px; font-size: 12.5px; color: var(--pchca-muted); cursor: pointer; flex-shrink: 0; }
.pchca-cancel:hover { border-color: #aaa; color: var(--pchca-dark); }

/* price block with parts chosen: the product + parts total in place of the product's own price lines */
.pchca-priced .product__product-price > :not(.pchca-ptotal) { display: none !important; }
.pchca-priced #lyoshowvatfree { display: none !important; }
.pchca-ptotal { width: 100%; text-align: right; }
.pchca-ptotal-ex { line-height: 1.1; }
.pchca-ptotal-val { font-size: 30px; font-weight: 800; color: var(--pchca-orange); }
.pchca-ptotal-tax { font-size: 13px; color: var(--pchca-muted); }
.pchca-ptotal-inc { margin-top: 4px; font-size: 13px; color: var(--pchca-muted); }

/* the parts are the product's related products, which the theme would also show as a "You might also like" carousel
   (never used on this shop before, its layout is broken): the list replaces it on these pages */
.product-accessories.slick_section { display: none !important; }
