/**
 * Commpagnie - Price Selector
 * Styles pour le sélecteur de prix avec support des variations
 * 
 * @package Commpagnie_Price_Selector
 * @version 1.2.0
 */

/* ========================================
   WRAPPER (conteneur global - transparent)
   ======================================== */
.cmp-price-selector-wrapper {
    width: 100%;
}

/* ========================================
   SÉLECTEUR DE VARIATIONS (fond transparent)
   ======================================== */
.cmp-variations-selector {
    margin-bottom: 20px;
}

/* ========================================
   CONTAINER PRIX (bloc gris)
   ======================================== */
.cmp-price-selector {
    width: 100%;
    padding: 24px 20px;
    background: #F1F1F1;
    border-radius: 24px;
    border: 1px solid rgba(43, 70, 120, 0.46);
}

/* ========================================
   SECTION PRIX
   ======================================== */
.cmp-price-selector .cmp-price-container {
    max-width: 473px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}

.cmp-price-selector .cmp-price-display {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cmp-price-selector .cmp-price-display.cmp-hidden {
    display: none;
}

.cmp-price-selector .cmp-price-from {
    color: #242526;
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    line-height: 22.4px;
}

.cmp-price-selector .cmp-price-amount {
    color: #2B4678;
    font-size: 26px;
    font-family: 'Fira Sans', sans-serif;
    font-weight: 700;
    line-height: 28.6px;
}

.cmp-price-selector .cmp-sur-devis-badge {
    display: inline-flex;
    height: 24px;
    padding: 3px 12px;
    background: #F7CA39;
    border-radius: 30px;
    color: #242526;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    line-height: 17.64px;
    align-items: center;
    gap: 4px;
}

.cmp-price-selector .cmp-price-taxes {
    color: #2B4678;
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    line-height: 22.4px;
}

.cmp-price-selector .cmp-price-ttc {
    color: #2B4678;
    font-size: 20px;
    font-family: 'Fira Sans', sans-serif;
    font-weight: 700;
    line-height: 26px;
}

.cmp-variations-selector .cmp-variation-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.cmp-variations-selector .cmp-variation-row:last-of-type {
    margin-bottom: 0;
}

.cmp-variations-selector .cmp-variation-label {
    color: #242526;
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
    line-height: 22px;
    min-width: auto;
    flex-shrink: 0;
}

.cmp-variations-selector .cmp-variation-select-wrapper {
    position: relative;
    min-width: 200px;
}

.cmp-variations-selector .cmp-variation-select {
    width: 100%;
    height: 34px;
    padding: 6px 50px 6px 16px;
    background: #fff;
    border: 1.5px solid #E4E4E4;
    border-radius: 30px;
    color: #515151;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    line-height: 17.64px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: all 0.3s ease;
}

.cmp-variations-selector .cmp-variation-select:hover {
    border-color: #F7CA39;
}

.cmp-variations-selector .cmp-variation-select:focus {
    outline: none;
    border-color: #F7CA39;
    box-shadow: 0 0 0 3px rgba(247, 202, 57, 0.15);
}

.cmp-variations-selector .cmp-select-arrow {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cmp-variations-selector .cmp-select-arrow svg {
    width: 22px;
    height: 22px;
}

/* Info variation sélectionnée (Nom + SKU) - dans le bloc gris */
.cmp-price-selector .cmp-variation-selected-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.cmp-price-selector .cmp-variation-name {
    color: #2B4678;
    font-size: 15px;
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    line-height: 20px;
}

.cmp-price-selector .cmp-variation-sku-badge {
    color: #515151;
    font-size: 13px;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
}

/* ========================================
   LIGNE QUANTITÉ ET BOUTONS
   ======================================== */
.cmp-price-selector .cmp-quantity-buttons-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* ========================================
   QUANTITÉ
   ======================================== */
.cmp-price-selector .cmp-quantity-controls {
    width: 86px;
    height: 44px;
    border-radius: 14px;
    border: 1px solid rgba(43, 70, 120, 0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    transition: border-color 0.3s ease;
    padding: 0 12px;
}

.cmp-price-selector .cmp-quantity-controls:hover,
.cmp-price-selector .cmp-quantity-controls:focus-within {
    border-color: #2B4678;
}

.cmp-price-selector .cmp-qty-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 10px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #2B4678;
    font-weight: 600;
    transition: opacity 0.3s ease;
    line-height: 1;
}

.cmp-price-selector .cmp-qty-btn:hover {
    opacity: 0.7;
}

.cmp-price-selector .cmp-qty-btn:focus {
    outline: none;
}

.cmp-price-selector .cmp-qty-input {
    width: 24px;
    border: none;
    background: transparent;
    text-align: center;
    color: #2B4678;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    padding: 0;
}

.cmp-price-selector .cmp-qty-input:focus {
    outline: none;
}

/* Masquer spinners natifs */
.cmp-price-selector .cmp-qty-input::-webkit-inner-spin-button,
.cmp-price-selector .cmp-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.cmp-price-selector .cmp-qty-input {
    -moz-appearance: textfield;
}

/* ========================================
   BOUTON PANIER
   ======================================== */
.cmp-price-selector .cmp-cart-submit-btn {
    display: flex;
    height: 44px;
    padding: 2px 8px 2px 20px;
    justify-content: center;
    align-items: center;
    gap: 10px;
    border-radius: 30px;
    background: #2B4678;
    border: 1px solid #1E3259;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cmp-price-selector .cmp-cart-submit-btn span {
    color: #F8F8F8;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    line-height: 17.64px;
}

.cmp-price-selector .cmp-cart-submit-btn .cmp-icon-cart {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.cmp-price-selector .cmp-cart-submit-btn .cmp-icon-cart circle {
    fill: #F8F8F8;
    transition: fill 0.3s ease;
}

.cmp-price-selector .cmp-cart-submit-btn .cmp-icon-cart path {
    fill: #2B4678;
    transition: fill 0.3s ease;
}

.cmp-price-selector .cmp-cart-submit-btn:hover {
    background: white !important;
    border: 1px solid #1E3259 !important;
    border-style: solid !important;
}

.cmp-price-selector .cmp-cart-submit-btn:hover span {
    color: #2B4678;
}

.cmp-price-selector .cmp-cart-submit-btn:hover .cmp-icon-cart circle {
    fill: #2B4678;
}

.cmp-price-selector .cmp-cart-submit-btn:hover .cmp-icon-cart path {
    fill: #F8F8F8;
}

.cmp-price-selector .cmp-cart-submit-btn:focus {
    outline: none;
}

/* Bouton désactivé (variation non sélectionnée) */
.cmp-price-selector .cmp-cart-submit-btn.cmp-btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ========================================
   BOUTON DEVIS
   ======================================== */
.cmp-price-selector .cmp-quote-request-btn {
    display: flex;
    height: 44px;
    padding: 2px 8px 2px 20px;
    justify-content: center;
    align-items: center;
    gap: 10px;
    border-radius: 30px;
    background: #F7CA39;
    border: 1px solid #D4A82E;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cmp-price-selector .cmp-quote-request-btn span {
    color: #2B4678;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    line-height: 17.64px;
}

.cmp-price-selector .cmp-quote-request-btn .cmp-icon-quote {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.cmp-price-selector .cmp-quote-request-btn .cmp-icon-bg {
    fill: #F8F8F8;
    transition: fill 0.3s ease;
}

.cmp-price-selector .cmp-quote-request-btn .cmp-icon-detail {
    fill: #2B4678;
    transition: fill 0.3s ease;
}

.cmp-price-selector .cmp-quote-request-btn:hover {
    background: white !important;
    border: 1px solid #D4A82E !important;
    border-style: solid !important;
}

.cmp-price-selector .cmp-quote-request-btn:hover span {
    color: #2B4678;
}

.cmp-price-selector .cmp-quote-request-btn:hover .cmp-icon-bg {
    fill: #F7CA39;
}

.cmp-price-selector .cmp-quote-request-btn:hover .cmp-icon-detail {
    fill: #2B4678;
}

.cmp-price-selector .cmp-quote-request-btn:focus {
    outline: none;
}

/* ========================================
   SÉPARATEUR
   ======================================== */
.cmp-price-selector .cmp-separator {
    width: 100%;
    height: 1px;
    background: rgba(43, 70, 120, 0.2);
    margin: 10px 0;
}

/* ========================================
   SECTION ASSISTANCE
   ======================================== */
.cmp-price-selector .cmp-assistance-section {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 18px;
}

.cmp-price-selector .cmp-callback-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.cmp-price-selector .cmp-callback-btn span {
    color: #515151;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    text-decoration: underline;
    line-height: 17.64px;
}

.cmp-price-selector .cmp-callback-btn:hover span {
    color: #2B4678;
}

.cmp-price-selector .cmp-callback-btn:focus {
    outline: 2px solid #F7CA39;
    outline-offset: 4px;
}

.cmp-price-selector .cmp-icon-phone {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.cmp-price-selector .cmp-assistance-info {
    display: flex;
    align-items: center;
}

.cmp-price-selector .cmp-assistance-info p {
    width: 258px;
    opacity: 0.8;
    color: #515151;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    line-height: 17.64px;
    margin: 0;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .cmp-price-selector {
        padding: 20px 15px;
    }

    .cmp-price-selector .cmp-price-display {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    /* Variations responsive */
    .cmp-variations-selector .cmp-variation-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .cmp-variations-selector .cmp-variation-label {
        min-width: auto;
    }

    .cmp-variations-selector .cmp-variation-select-wrapper {
        width: 100%;
    }

    /* Info variation responsive */
    .cmp-price-selector .cmp-variation-selected-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .cmp-price-selector .cmp-quantity-buttons-row {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        width: 100%;
    }

    .cmp-price-selector .cmp-quantity-controls {
        align-self: flex-start;
    }

    .cmp-price-selector .cmp-cart-submit-btn,
    .cmp-price-selector .cmp-quote-request-btn {
        width: 100%;
    }

    .cmp-price-selector .cmp-assistance-section {
        flex-direction: column;
        gap: 12px;
    }

    .cmp-price-selector .cmp-assistance-info p {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .cmp-price-selector {
        padding: 15px 10px;
        border-radius: 16px;
    }

    .cmp-price-selector .cmp-price-amount {
        font-size: 22px;
    }

    .cmp-price-selector .cmp-price-ttc {
        font-size: 16px;
    }
}

/* ========================================
   POPUP DEVIS
   ======================================== */
.cmp-quote-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    align-items: center;
    justify-content: center;
}

.cmp-quote-popup.cmp-popup-active {
    display: flex;
}

.cmp-quote-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.cmp-quote-popup-content {
    position: relative;
    width: 100%;
    max-width: 670px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px 40px;
    background: #F1F1F1;
    border-radius: 42px;
    z-index: 1;
}

.cmp-quote-popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 30px;
    background: #2B4678;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    color: #fff;
    cursor: pointer;
    line-height: 30px;
    text-align: center;
    padding: 0 0 0 8px;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cmp-quote-popup-close:hover {
    opacity: 0.7;
}

/* Titre Popup */
.cmp-quote-popup-title {
    color: #2B4678;
    font-size: 20px;
    font-family: 'Fira Sans', sans-serif;
    font-weight: 700;
    line-height: 110%;
    margin: 0 0 24px 0;
}

/* Form Styles */
.cmp-quote-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cmp-quote-form-row {
    display: flex;
    gap: 14px;
}

.cmp-quote-form-row-full {
    width: 100%;
}

.cmp-quote-form-field {
    flex: 1;
}

.cmp-quote-form-field input,
.cmp-quote-form-field textarea {
    width: 100%;
    height: 44px;
    padding: 12px 15px;
    background: #F8F8F8;
    border: none;
    border-radius: 14px;
    color: #333;
    font-size: 16px;
    font-family: 'Roboto', sans-serif;
    font-style: italic;
    font-weight: 400;
    line-height: 20.8px;
    transition: box-shadow 0.3s ease;
}

.cmp-quote-form-field input::placeholder,
.cmp-quote-form-field textarea::placeholder {
    color: #8C8C8C;
}

.cmp-quote-form-field input:focus,
.cmp-quote-form-field textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(43, 70, 120, 0.3);
}

.cmp-quote-form-field textarea {
    height: 150px;
    resize: vertical;
}

/* RGPD Checkbox */
.cmp-quote-form-rgpd {
    margin-top: 10px;
}

.cmp-quote-checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
}

.cmp-quote-checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.cmp-quote-checkbox-custom {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border: 1px solid #2B4678;
    border-radius: 4px;
    opacity: 0.9;
    position: relative;
    transition: background 0.3s ease;
}

.cmp-quote-checkbox-wrapper input[type="checkbox"]:checked + .cmp-quote-checkbox-custom {
    background: #2B4678;
}

.cmp-quote-checkbox-wrapper input[type="checkbox"]:checked + .cmp-quote-checkbox-custom::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.cmp-quote-rgpd-text {
    color: #8C8C8C;
    font-size: 13px;
    font-family: 'Roboto', sans-serif;
    font-style: italic;
    font-weight: 400;
    line-height: 16.9px;
}

/* Submit Button */
.cmp-quote-form-submit {
    display: flex;
    justify-content: flex-end;
    margin-top: 22px;
}

.cmp-quote-submit-btn {
    display: flex;
    height: 44px;
    padding: 2px 8px 2px 20px;
    justify-content: center;
    align-items: center;
    gap: 10px;
    border-radius: 30px;
    background: #2B4678;
    border: 1px solid rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.cmp-quote-submit-btn span {
    color: #FAFAFA;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    font-weight: 600;
    line-height: 17.64px;
}

.cmp-quote-submit-btn .cmp-icon-send {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.cmp-quote-submit-btn:hover {
    background: white !important;
    border: 1px solid #2B4678 !important;
    border-style: solid !important;
}

.cmp-quote-submit-btn:hover span {
    color: #2B4678;
}

.cmp-quote-submit-btn:hover .cmp-icon-send circle {
    fill: #2B4678;
}

.cmp-quote-submit-btn:hover .cmp-icon-send path {
    stroke: #F8F8F8;
}

.cmp-quote-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Form Messages */
.cmp-quote-form-message {
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    display: none;
}

.cmp-quote-form-message.cmp-message-success {
    display: block;
    background: #d4edda;
    color: #155724;
}

.cmp-quote-form-message.cmp-message-error {
    display: block;
    background: #f8d7da;
    color: #721c24;
}

/* Popup Responsive */
@media (max-width: 768px) {
    .cmp-quote-popup-content {
        padding: 24px 20px;
        border-radius: 24px;
        margin: 15px;
        max-width: calc(100% - 30px);
    }

    .cmp-quote-form-row {
        flex-direction: column;
    }

    .cmp-quote-form-submit {
        justify-content: center;
    }

    .cmp-quote-submit-btn {
        width: 100%;
    }
}

/* ========================================
   CUSTOMER PRICE DISPLAY
   ======================================== */
.cmp-price-display.cmp-customer-price .cmp-price-from {
    color: #242526;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
}

/* ========================================
   POPUP RAPPEL (même style que popup devis)
   ======================================== */
.cmp-callback-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    align-items: center;
    justify-content: center;
}

.cmp-callback-popup.cmp-popup-active {
    display: flex;
}

.cmp-callback-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.cmp-callback-popup-content {
    position: relative;
    width: 100%;
    max-width: 670px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px 40px;
    background: #F1F1F1;
    border-radius: 42px;
    z-index: 1;
}

.cmp-callback-popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 30px;
    background: #2B4678;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    color: #fff;
    cursor: pointer;
    line-height: 30px;
    text-align: center;
    padding: 0 0 0 8px;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cmp-callback-popup-close:hover {
    opacity: 0.7;
}

.cmp-callback-popup-title {
    color: #2B4678;
    font-size: 20px;
    font-family: 'Fira Sans', sans-serif;
    font-weight: 700;
    line-height: 110%;
    margin: 0 0 24px 0;
}

.cmp-callback-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cmp-callback-form-message {
    text-align: center;
    padding: 10px;
    border-radius: 8px;
    display: none;
}

.cmp-callback-form-message.cmp-message-success {
    display: block;
    background: #d4edda;
    color: #155724;
}

.cmp-callback-form-message.cmp-message-error {
    display: block;
    background: #f8d7da;
    color: #721c24;
}

@media (max-width: 768px) {
    .cmp-callback-popup-content {
        padding: 24px 20px;
        border-radius: 24px;
        margin: 15px;
        max-width: calc(100% - 30px);
    }
}
