/*
 * Product customization — shared storefront styles (Jovenca + Josuper).
 * Colours resolve through whichever theme scope the block sits in: the product
 * page (--pd-*), the cart (--cart-*), then the theme roots (--jv-* / --t-*).
 */
.pc-form, .pc-lines, .pc-box {
    --pc-ink: var(--pd-ink, var(--cart-ink, var(--jv-ink, var(--t-title-color, #1E1B16))));
    --pc-muted: var(--pd-muted, var(--cart-muted, var(--jv-ink-3, var(--t-text-color, #6E6459))));
    --pc-line: var(--pd-line, var(--cart-line, var(--jv-line, var(--t-card-border-color, #DED6C6))));
    --pc-paper: var(--pd-paper, var(--cart-paper, var(--jv-paper, var(--t-bg, #FFFFFF))));
    --pc-soft: var(--pd-bone, var(--pd-cream, var(--cart-bone, var(--jv-bone, #F5F1E8))));
    --pc-brand: var(--pd-brand, var(--cart-sage, var(--jv-sage, var(--t-link-color, #46553F))));
    --pc-danger: var(--pd-danger, #B3261E);
    --pc-r: var(--pd-r-control, var(--jv-radius-control, 10px));
    --pc-t: .2s cubic-bezier(.2, .7, .2, 1);
}

/* ---------------- Product page form ---------------- */
.pc-form {
    margin: 0 0 18px;
    padding: 16px;
    border: 1px solid var(--pc-line);
    border-radius: calc(var(--pc-r) + 4px);
    background: var(--pc-paper);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.pc-form__head { display: flex; align-items: flex-start; gap: 10px; }
.pc-form__icon {
    width: 32px; height: 32px; flex-shrink: 0; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--pc-soft); color: var(--pc-brand);
}
.pc-form__icon svg { width: 18px; height: 18px; }
.pc-form__title { font-weight: 700; color: var(--pc-ink); font-size: 15px; line-height: 1.35; }
.pc-form__sub { color: var(--pc-muted); font-size: 13px; line-height: 1.5; }

.pc-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pc-field__label { display: flex; align-items: baseline; gap: 6px; font-size: 14px; font-weight: 600; color: var(--pc-ink); margin: 0; }
.pc-field__req { color: var(--pc-danger); font-weight: 700; }
.pc-field__opt { color: var(--pc-muted); font-weight: 400; font-size: 12px; }

.pc-input {
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid var(--pc-line);
    border-radius: var(--pc-r);
    background: var(--pc-paper);
    color: var(--pc-ink);
    font: inherit;
    font-size: 15px;
    line-height: 1.5;
    transition: border-color var(--pc-t), box-shadow var(--pc-t);
    box-sizing: border-box;
}
.pc-input--area { min-height: 92px; resize: vertical; }
.pc-input:focus { outline: none; border-color: var(--pc-brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc-brand) 16%, transparent); }
.pc-field.is-invalid .pc-input, .pc-field.is-invalid .pc-drop { border-color: var(--pc-danger); }

.pc-field__foot { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--pc-muted); line-height: 1.5; }
.pc-field__count { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.pc-field__err { margin: 0; font-size: 13px; color: var(--pc-danger); line-height: 1.4; }
.pc-field__err[hidden] { display: none; }

.pc-drop {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    padding: 14px;
    border: 1.5px dashed var(--pc-line);
    border-radius: var(--pc-r);
    background: var(--pc-soft);
    cursor: pointer;
    transition: border-color var(--pc-t), background var(--pc-t);
    margin: 0;
}
.pc-drop[hidden] { display: none; }
.pc-drop:hover, .pc-drop.is-over { border-color: var(--pc-brand); }
.pc-drop:focus-within { border-color: var(--pc-brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc-brand) 16%, transparent); }
.pc-drop__icon {
    width: 40px; height: 40px; flex-shrink: 0; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--pc-paper); color: var(--pc-brand); border: 1px solid var(--pc-line);
}
.pc-drop__icon svg { width: 20px; height: 20px; }
.pc-drop__text { display: flex; flex-direction: column; min-width: 0; }
.pc-drop__cta { font-weight: 600; color: var(--pc-ink); font-size: 14px; }
.pc-drop__hint { font-size: 12px; color: var(--pc-muted); }
.pc-drop__input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }

.pc-file {
    display: flex; align-items: center; gap: 12px;
    padding: 10px;
    border: 1px solid var(--pc-line);
    border-radius: var(--pc-r);
    background: var(--pc-paper);
}
.pc-file[hidden] { display: none; }
.pc-file__thumb {
    width: 52px; height: 52px; flex-shrink: 0; border-radius: calc(var(--pc-r) - 2px); overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--pc-soft); color: var(--pc-muted);
}
.pc-file__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-file__thumb svg { width: 24px; height: 24px; }
.pc-file__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pc-file__name { font-size: 14px; font-weight: 600; color: var(--pc-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-file__size { font-size: 12px; color: var(--pc-muted); text-align: start; }
.pc-file__ok { color: var(--pc-brand); font-weight: 600; }
.pc-file__bar { display: block; height: 4px; border-radius: 999px; background: var(--pc-soft); overflow: hidden; }
.pc-file__bar span { display: block; height: 100%; width: 0; background: var(--pc-brand); transition: width .15s linear; }
.pc-file__remove {
    width: 36px; height: 36px; flex-shrink: 0; border-radius: 999px;
    border: 1px solid var(--pc-line); background: var(--pc-paper); color: var(--pc-ink);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.pc-file__remove svg { width: 16px; height: 16px; }
.pc-file__remove:hover { border-color: var(--pc-danger); color: var(--pc-danger); }

/* ---------------- Cart / order line preview ---------------- */
.pc-lines {
    display: flex; flex-direction: column; gap: 6px;
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: var(--pc-r);
    background: var(--pc-soft);
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}
.pc-line { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pc-line + .pc-line { padding-top: 6px; border-top: 1px dashed var(--pc-line); }
.pc-line__label { font-size: 11px; line-height: 1.4; color: var(--pc-muted); }
.pc-line__value {
    font-size: 13px; line-height: 1.45; font-weight: 600; color: var(--pc-ink);
    white-space: pre-wrap; overflow-wrap: anywhere;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.pc-line__file {
    display: flex; align-items: center; gap: 8px; min-width: 0;
    padding: 0; border: 0; background: none; cursor: pointer; text-align: start; color: var(--pc-ink); font: inherit;
}
.pc-line__thumb {
    width: 40px; height: 40px; flex-shrink: 0; border-radius: 8px; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--pc-paper); border: 1px solid var(--pc-line); color: var(--pc-muted);
}
.pc-line__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-line__thumb svg { width: 20px; height: 20px; }
.pc-line__name { font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pc-line__file:hover .pc-line__name { color: var(--pc-brand); }
.pc-lines--compact { padding: 6px 8px; gap: 4px; }
.pc-lines--compact .pc-line__thumb { width: 30px; height: 30px; }
.pc-lines--compact .pc-line__value { -webkit-line-clamp: 2; font-size: 12px; }

/* ---------------- Lightbox ---------------- */
html.pc-lock { overflow: hidden; }
.pc-box {
    position: fixed; inset: 0; z-index: 100000;
    background: rgba(12, 10, 8, .78);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.pc-box__panel { width: fit-content; min-width: min(360px, 100%); max-width: min(920px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 10px; }
.pc-box__bar { display: flex; align-items: center; gap: 10px; color: #fff; }
.pc-box__name { flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-box__dl {
    color: #fff; font-size: 13px; font-weight: 600; text-decoration: none;
    padding: 8px 14px; border: 1px solid rgba(255, 255, 255, .4); border-radius: 999px;
}
.pc-box__dl:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.pc-box__close {
    width: 40px; height: 40px; border-radius: 999px; border: 0; padding: 0; cursor: pointer;
    background: rgba(255, 255, 255, .14); color: #fff; display: inline-flex; align-items: center; justify-content: center;
}
.pc-box__close svg { width: 20px; height: 20px; }
.pc-box__media { min-height: 0; display: flex; align-items: center; justify-content: center; }
.pc-box__media img, .pc-box__media video { max-width: 100%; max-height: calc(100vh - 110px); border-radius: 10px; display: block; background: #000; }

@media (max-width: 575px) {
    .pc-form { padding: 14px; }
    .pc-drop { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .pc-form *, .pc-box * { transition: none !important; }
}
