/*
 * On product pages that carry customization options (.dcp-block is only
 * rendered by the module when the product actually has groups/text config),
 * the theme's native price recap ("js-product-prices") is redundant with -
 * and can even contradict - our own "Prix de la personnalisation" total, so
 * it is hidden. :has() is supported by all current evergreen browsers; the
 * JS fallback right below covers older ones.
 */
body:has(.dcp-block) .js-product-prices {
    display: none !important;
}

/*
 * The "Options choisies" cart recap combines every chosen option (per
 * group) and the custom text line into ONE customized_data value,
 * separated by real line breaks (see controllers/front/addtocart.php).
 * Elementor's cart widget - like most theme text blocks - collapses
 * whitespace on inline/block text by default, so without this rule those
 * line breaks would render as plain spaces. This is loaded on every
 * front-office page (not just product pages) since the cart widget this
 * targets can appear anywhere (header, cart page, etc.).
 */
.elementor-cart__product-attr {
    white-space: pre-line;
}

.dcp-block {
    margin: 20px 0;
    padding: 15px 0;
    border-top: 1px solid #eee;
}
.dcp-group {
    margin-bottom: 20px;
}
.dcp-group-title {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: .03em;
    margin-bottom: 10px;
}
.dcp-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.dcp-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 110px;
    padding: 10px;
    border: 2px solid #e5e5e5;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    position: relative;
    transition: border-color .15s ease;
}
.dcp-option:hover {
    border-color: #ccc;
}
.dcp-option input {
    position: absolute;
    top: 8px;
    left: 8px;
}
.dcp-option:has(input:checked) {
    border-color: #c9a24b;
    background: #fbf6ea;
}
.dcp-option-visual {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
}
.dcp-option-visual img {
    max-width: 100%;
    max-height: 100%;
}
.dcp-option-name {
    font-size: 12px;
    line-height: 1.3;
}
.dcp-option-price {
    font-size: 12px;
    font-weight: 600;
    color: #c9a24b;
}
.dcp-text-block {
    margin-bottom: 20px;
}
.dcp-group-description {
    font-size: 12px;
    color: #888;
    margin: -6px 0 10px;
    line-height: 1.4;
}
.dcp-text-input {
    width: 100%;
    max-width: 400px;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 12px;
}
.dcp-fonts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}
.dcp-font-choice {
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 6px 14px;
    cursor: pointer;
}
.dcp-font-choice input {
    margin-right: 6px;
}
.dcp-font-choice:has(input:checked) {
    border-color: #c9a24b;
    background: #fbf6ea;
}
.dcp-preview-wrap {
    padding: 15px;
    background: #fafafa;
    border-radius: 6px;
    min-height: 70px;
}
.dcp-preview-label {
    display: block;
    font-size: 12px;
    color: #999;
    margin-bottom: 6px;
}
.dcp-preview {
    font-size: 42px;
    line-height: 1.1;
    color: #c9a24b;
}
.dcp-total {
    font-size: 16px;
    font-weight: 700;
    margin: 15px 0;
}
.dcp-total-price {
    color: #c9a24b;
}
.dcp-add-to-cart {
    width: 100%;
}
.dcp-message {
    margin-top: 10px;
    color: #d9534f;
    font-size: 13px;
}
