/**
 * Styles — module devis CreactiveWeb
 */

.cw-quote-cta,
.cw-quote-basket {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.cw-quote-cta {
    margin: 0 0 12px;
    container-type: inline-size;
    container-name: cw-quote-cta;
}

.cw-quote-cta__intro {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.45;
    color: #5a6570;
}

.cw-quote-cta__login-link {
    font-weight: 700;
    color: #005b8c;
    text-decoration: none;
}

.cw-quote-cta__login-link:hover,
.cw-quote-cta__login-link:focus-visible {
    text-decoration: underline;
}

.cw-quote-cta__actions,
.cw-quote-basket__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.cw-quote-cta__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: auto;
    max-width: 100%;
    min-height: 0;
    height: auto;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    line-height: 1.25;
    background: #fff;
    color: #222;
    white-space: normal;
    text-align: center;
}

/* Bouton login : compact, ne force pas la largeur de colonne */
.cw-quote-cta a.cw-quote-cta__btn--primary,
.cw-quote-cta .cw-quote-cta__btn--primary {
    background: #005b8c;
    color: #fff;
    padding: 6px 12px;
    font-size: 12.5px;
    font-weight: 600;
    flex: 0 1 auto;
    width: fit-content;
    max-width: 100%;
}

.cw-quote-cta a.cw-quote-cta__btn--add,
.cw-quote-cta a.cw-quote-cta__btn--quote {
    text-decoration: none;
}

.cw-quote-cta__btn--add {
    background: #e8f5e9;
    color: #1b5e20;
    border-color: #a5d6a7;
}

.cw-quote-cta__btn--quote {
    background: #fff;
    color: #222;
    border-color: #d1d5db;
}

.cw-quote-cta__btn--ghost {
    background: transparent;
    color: #6b7280;
    border-color: #e5e7eb;
}

.cw-quote-cta__btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cw-quote-cta__feedback {
    margin: 8px 0 0;
    font-size: 13px;
    color: #2f9e44;
}

.cw-quote-cta__feedback.is-error {
    color: #b91c1c;
}

/* Invité : colonne étroite, boutons pleine largeur, moins d’espace perdu */
.cw-quote-cta.is-guest {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.cw-quote-cta.is-guest .cw-quote-cta__intro {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.4;
}

.cw-quote-cta.is-guest .cw-quote-cta__actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

.cw-quote-cta.is-guest .cw-quote-cta__btn,
.cw-quote-cta.is-guest a.cw-quote-cta__btn--primary {
    width: 100%;
    max-width: 100%;
    flex: 0 0 auto;
    justify-content: center;
    padding: 10px 14px;
    font-size: 13px;
    box-sizing: border-box;
}

.cw-quote-cta.is-guest .cw-quote-cta__btn--quote {
    background: #e8f5e9;
    color: #1b5e20;
    border-color: #a5d6a7;
}

.cw-quote-cta.is-guest .cw-quote-cta__feedback {
    margin: 0;
}

/* Colonne produit étroite (sidebar Greenshift) — indépendant du viewport */
@container cw-quote-cta (max-width: 420px) {
    .cw-quote-cta__actions {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .cw-quote-cta a.cw-quote-cta__btn--primary,
    .cw-quote-cta .cw-quote-cta__btn--primary,
    .cw-quote-cta .cw-quote-cta__btn--add,
    .cw-quote-cta .cw-quote-cta__btn--quote {
        width: 100%;
        padding: 10px 12px;
        font-size: 13px;
    }

    .cw-quote-cta.is-logged-in .cw-quote-cta__actions {
        align-items: stretch;
    }
}

/* Viewport mobile */
@media (max-width: 781px) {
    .cw-quote-cta__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cw-quote-cta .cw-quote-cta__btn {
        width: 100%;
    }

    .cw-quote-basket__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cw-quote-basket__actions .cw-quote-cta__btn {
        width: 100%;
    }
}

.cw-quote-basket {
    margin-top: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    background: #fafbfc;
}

.cw-quote-basket__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.cw-quote-basket__count,
.cw-quote-count {
    display: inline-flex;
    min-width: 1.5em;
    padding: 0 6px;
    border-radius: 999px;
    background: #005b8c;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    align-items: center;
    justify-content: center;
}

.cw-quote-basket__list {
    margin-bottom: 12px;
}

.cw-quote-basket__empty {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
}

.cw-quote-basket__item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eef0f2;
    font-size: 13px;
}

.cw-quote-basket__item:last-child {
    border-bottom: 0;
}

.cw-quote-basket__item-name {
    font-weight: 600;
}

.cw-quote-basket__item-meta {
    display: block;
    color: #6b7280;
    font-weight: 400;
    font-size: 12px;
}

.cw-quote-basket__qty {
    width: 56px;
    padding: 4px 6px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
}

.cw-quote-basket__remove {
    border: 0;
    background: transparent;
    color: #b91c1c;
    cursor: pointer;
    font-size: 12px;
    text-decoration: underline;
}

/* Modal — reuse micromodal classes if present; provide minimal fallbacks */
#cw-quote-modal.modal {
    display: none;
}

#cw-quote-modal.modal.is-open {
    display: block;
}

#cw-quote-modal .modal__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 16px;
}

#cw-quote-modal .modal__container,
#cw-quote-modal .cw-quote-modal__container {
    background: #fff;
    border-radius: 10px;
    max-width: min(980px, 96vw);
    width: 100%;
    max-height: 92vh;
    overflow: auto;
    padding: 22px 24px 28px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

#cw-quote-modal .modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef0f2;
}

#cw-quote-modal .modal__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

#cw-quote-modal .modal__close {
    border: 0;
    background: transparent;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    color: #6b7280;
}

.cw-quote-modal__content {
    display: block;
}

.cw-quote-modal__body {
    display: block;
}

.cw-quote-modal__success {
    text-align: center;
    padding: 32px 16px 24px;
}

.cw-quote-modal__success[hidden] {
    display: none !important;
}

.cw-quote-modal__success-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: #e8f5e9;
    color: #1b5e20;
    font-size: 28px;
    line-height: 56px;
    font-weight: 700;
}

.cw-quote-modal__success-title {
    margin: 0 0 10px;
    font-size: 1.35rem;
}

.cw-quote-modal__success-body {
    margin: 0 0 20px;
    color: #5a6570;
    line-height: 1.5;
}

#cw-quote-modal.is-success .cw-quote-modal__body {
    display: none !important;
}

.cw-quote-submit-error {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 6px;
    background: #fdecea;
    color: #b71c1c;
    font-size: 0.95rem;
    line-height: 1.4;
}

.cw-quote-submit-error[hidden] {
    display: none !important;
}

@media (min-width: 820px) {
    .cw-quote-modal__body {
        display: grid;
        grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.1fr);
        gap: 28px;
        align-items: start;
    }

    #cw-quote-modal .modal__container,
    #cw-quote-modal .cw-quote-modal__container {
        overflow: hidden;
        max-height: 90vh;
        display: flex;
        flex-direction: column;
    }

    #cw-quote-modal .cw-quote-modal__content {
        overflow: auto;
        flex: 1;
        min-height: 0;
    }
}

.cw-quote-modal__summary {
    margin-bottom: 16px;
    padding: 12px 14px;
    background: #f5f8fa;
    border-radius: 8px;
    font-size: 13px;
    white-space: normal;
}

.cw-quote-modal__summary-title {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #5a6570;
}

.cw-quote-modal__summary-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cw-quote-modal__summary-item {
    margin: 0 0 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e9ee;
    line-height: 1.35;
}

.cw-quote-modal__summary-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.cw-quote-modal__summary-qty {
    color: #5a6570;
    font-weight: 600;
}

.cw-quote-modal__summary-meta {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: #6b7280;
}

.cw-quote-modal__summary-empty {
    margin: 0;
    color: #6b7280;
}

.cw-quote-modal__cdcli-wrap,
.cw-quote-modal__message-wrap {
    margin: 0 0 16px;
}

.cw-quote-modal__label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #222;
}

.cw-quote-modal__cdcli,
.cw-quote-modal__message {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.4;
    font-family: inherit;
}

.cw-quote-modal__message {
    min-height: 120px;
    resize: vertical;
}

.cw-quote-modal__cdcli[readonly],
#cw-quote-modal .cw-quote-prefilled[readonly] {
    background: #f3f6f8;
    color: #334155;
    cursor: default;
}

.cw-quote-modal__cdcli:focus,
.cw-quote-modal__message:focus {
    outline: 2px solid #005b8c;
    outline-offset: 1px;
    border-color: #005b8c;
}

.cw-quote-modal__hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: #6b7280;
}

/* Fluent Forms dans la modale */
#cw-quote-form-container .ff-btn-submit,
#cw-quote-form-container button[type="submit"] {
    width: 100%;
    min-height: 44px;
    margin-top: 8px;
    font-weight: 600;
}

#cw-quote-form-container .ff-el-form-control,
#cw-quote-form-container input[type="text"],
#cw-quote-form-container input[type="email"],
#cw-quote-form-container input[type="number"],
#cw-quote-form-container textarea {
    width: 100%;
    box-sizing: border-box;
}

#cw-quote-form-container [data-cw-quote-hidden="1"] {
    display: none !important;
}

.cw-quote-basket__hint {
    margin: 10px 0 0;
    font-size: 12px;
    color: #6b7280;
}

.cw-quote-cart-block {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.cw-quote-cart-block--php {
    margin-top: 10px;
    padding-top: 0;
    border-top: 0;
}

.cw-quote-cart-block__btn {
    width: 100%;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 16px;
    font-weight: 600;
    cursor: pointer;
}

.cw-quote-cta__btn--quote[hidden],
.cw-quote-cta .js-cw-quote-open[hidden] {
    display: none !important;
}
