/**
 * Styles personnalisés pour le checkout WooCommerce
 * Reproduit le style du composant Side du configurateur
 */

/* ===== HEADER AVEC ÉTAPES ===== */
.cvpm-checkout-header-wrapper {
    width: 100%;
}

.cvpm-checkout-header {
    display: flex;
    width: 100%;
}

.cvpm-header-spacer {
    flex: 1;
}

.cvpm-header-spacer-left {
    background-color: #243949; /* primary color */
}

.cvpm-header-spacer-right {
    background-color: #f5f5f5; /* gris color */
}


.cvpm-header-spacer-right.last-step-active {
    background-color: #F9B022;
}

.cvpm-header-steps {
    display: flex;
    width: 100%;
    max-width: 1190px;
}

.cvpm-step {
    width: 25%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white!important;
    padding: 0.5rem 0.25rem;
    height: 2.5rem;
    text-align: center;
    border-right: 1px solid white;
    text-decoration: none;
    transition: background-color 0.2s;
}

@media (min-width: 768px) {
    .cvpm-step {
        padding: 0.5rem 1rem;
        height: 4rem;
        font-size: 1.25rem;
    }
}

.cvpm-step-text {
    font-size: 0.75rem;
    line-height: 1;
}

@media (min-width: 768px) {
    .cvpm-step-text {
        font-size: 1.25rem;
        line-height: 1.2
    }
}

.cvpm-step-completed {
    background-color: #243949; /* primary color */
    cursor: pointer;
}

.cvpm-step-completed:hover {
    background-color: #1a2c38;
}

.cvpm-step-active {
    background-color: #F9B022; /* gris color */
    color: white; /* primary color */
}

.cvpm-step-inactive {
    background-color: #243949; /* primary color */
    cursor: not-allowed;
    opacity: 0.6;
}

.cvpm-step-last {
    border-right: none;
}

.cvpm-check-icon {
    width: 1.5rem;
    height: 1.5rem;
    margin-left: 0.25rem;
    flex-shrink: 0;
}

/* ===== RÉSUMÉ DE COMMANDE ===== */
.cvpm-checkout-summary {
    background-color: #f5f5f5;
    overflow: hidden;
}
.cvpm-van-image {
    position: relative;
    width: 100%;
}

.cvpm-van-image img {
    width: 100%;
    max-height: 200px;
    height: 200px;
    object-fit: cover;
}

.cvpm-summary-content {
    padding: 1.5rem;
}

.cvpm-van-title {
    font-size: 1.5rem;
    color: #243949;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.cvpm-van-subtitle {
    color: #4a5568;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: 1.2;
}
.woocommerce-checkout #payment{
    background-color: transparent;
}

.cvpm-details-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.cvpm-detail-item {
    color: #243949;
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    line-height: 1.25rem;
}

@media (min-width: 768px) {
    .cvpm-detail-item {
        font-size: 0.875rem; /* 14px au lieu de 16px */
    }
}

.cvpm-dates {
    margin-bottom: 0.25rem;
}

.cvpm-duration {
    margin-bottom: 0.75rem;
}

.cvpm-horaires {
    margin-bottom: 0.75rem;
}

.cvpm-formule {
    margin-bottom: 0.25rem;
}

.cvpm-flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cvpm-flex-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cvpm-flex-col {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.cvpm-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    align-items: start;
}

.cvpm-price-detail {
    color: #8f8787;
    font-weight: 500;
    font-size: 0.75rem;
}

@media (min-width: 768px) {
    .cvpm-price-detail {
        font-size: 0.875rem;
    }
}

.cvpm-small {
    font-size: 0.75rem;
}

.cvpm-expandable {
    margin-top: 0.75rem;
}

.cvpm-clickable {
    cursor: pointer;
    user-select: none;
}

.cvpm-expand-icon {
    color: #F9B022;
    font-size: 1.5rem;
    font-weight: 600;
    margin-left: 0.5rem;
    transition: transform 0.2s;
}

.woocommerce-info{
    border-top-color: #F9B022!important;
}
.woocommerce-info::before{
    color: #F9B022!important;
}

.cvpm-totals-table .order-paid th,.cvpm-totals-table .order-paid td,
.cvpm-totals-table .order-remaining th, .cvpm-totals-table .order-remaining td {
    font-weight: 500!important;
}
.form-row .required{
    color: #F9B022!important;;
}

.cvpm-expandable-content {
    margin-left: 1rem;
    margin-top: 0.5rem;
}

.cvpm-sub-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.cvpm-sub-list li {
    color: #4a5568;
    font-weight: 600;
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.cvpm-sub-list li span {
    color: #8f8787;
}

@media (min-width: 768px) {
    .cvpm-sub-list li {
        font-size: 0.875rem;
    }
}

/* Masquer le bloc WooCommerce par défaut quand notre bloc personnalisé est affiché */
.wp-block-woocommerce-checkout-order-summary-cart-items-block.cvpm-custom-hidden {
    display: none !important;
}

.wp-block-woocommerce-checkout-order-summary-subtotal-block {
    display: none !important;
}

.wc-block-components-totals-wrapper:last-child, .wc-block-components-checkout-order-summary__title{
    background: #1F374A;
    text-transform: uppercase;
    color:white;
    font-weight: 600;
    margin: 0!important;
    padding: 15px!important;
}

.wc-block-components-checkout-order-summary__title p {
    margin-bottom:0!important;
}
.wp-block-woocommerce-checkout-order-summary-block{
    border: 0!important;
}

.wc-block-components-button{
    border:0!important;
    background:#F9B022;
    font-weight: 600;
    color:white;
    text-transform: uppercase;
}

.wp-block-woocommerce-checkout-order-summary-totals-block, .wp-block-woocommerce-checkout-order-summary-coupon-form-block{
    background: #f5f5f5;
}

/* S'assurer que notre bloc personnalisé est bien visible */
#cvpm-custom-order-summary {
    width: 100%;
}
#cvpm-custom-order-summary h3:before,  #cvpm-date-picker-modal h3:before {
    display: none;
}

    /* Section totaux WooCommerce */
.cvpm-wc-totals-wrapper {
    background: transparent;
    border-top: 0;
}
.cvpm-wc-totals-wrapper th, .cvpm-wc-totals-wrapper td{
    padding: 5px!important;
    background: #2a3c4a!important;
    color: white;
}

input{
    outline:none!important;
}

.cvpm-wc-totals-wrapper .cart-discount th, .cvpm-wc-totals-wrapper .cart-discount td {
    border:0!important;
    background: #f5af3a!important;
}

.cvpm-wc-totals-wrapper * {
    color: white!important;
}
.cvpm-wc-totals-wrapper td{
     text-align:center!important;
 }
.cvpm-wc-totals-wrapper .cvpm-totals-table{
     margin:0;
 }

/* Masquer le sous-total par défaut, sauf s'il y a un code promo */
.cvpm-totals-table tr.cart-subtotal {
    display: none;
}

/* Afficher le sous-total si un code promo est actif */
.cvpm-totals-table.has-coupon tr.cart-subtotal {
    display: table-row;
}

.cvpm-totals-table {
    width: 100%;
    border-collapse: collapse;
}

.cvpm-totals-table th,
.cvpm-totals-table td {
    padding: 0.75rem 0;
    font-weight: 600;
    font-size: 0.95rem;
}

.cvpm-totals-table th {
    text-align: left;
    color: #243949;
}

.cvpm-totals-table td {
    text-align: right;
    color: #243949;
}

.cvpm-totals-table tr {
    border-bottom: 1px solid #e5e5e5;
}

/* Style pour les codes promo */
.cvpm-totals-table tr.cart-discount th,
.cvpm-totals-table tr.cart-discount td {
    color: #F9B022;
}

/* Style pour le lien de suppression du coupon */
.cvpm-totals-table .woocommerce-remove-coupon {
    color: #F9B022;
    text-decoration: none;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.cvpm-totals-table .woocommerce-remove-coupon:hover {
    color: #e67e22;
    text-decoration: underline;
}

/* Style spécial pour la ligne order-total */
.cvpm-totals-table tr.order-total {
    border-top: 2px solid #243949;
    border-bottom: none;
}

.cvpm-totals-table tr.order-total th,
.cvpm-totals-table tr.order-total td {
    padding: 1rem 0;
    font-size: 1.1rem;
    color: #243949;
    font-weight: 700;
}

@media (min-width: 768px) {
    .cvpm-totals-table tr.order-total th,
    .cvpm-totals-table tr.order-total td {
        font-size: 1.3rem;
    }
}

.cvpm-totals-table tr.order-total .woocommerce-Price-amount {
    color: #243949;
    font-weight: 700;
}

/* ===== FOND BLANC POUR LA PAGE CHECKOUT ===== */
body.woocommerce-checkout {
    background-color: white !important;
}

/* ===== STYLES DES INPUTS ===== */
.woocommerce-checkout input[type="text"],
.woocommerce-checkout input[type="email"],
.woocommerce-checkout input[type="tel"],
.woocommerce-checkout input[type="password"],
.woocommerce-checkout input[type="number"],
.woocommerce-checkout select,
.woocommerce-checkout textarea,
.wc-block-components-text-input input,
.wc-block-components-combobox input,
.wc-blocks-components-select select,
.wc-blocks-components-select__select,
.wc-block-components-address-card,
.wc-block-components-radio-control,
.wc-block-components-radio-control > div{
    background-color: #f5f5f5 !important;
    border: none !important;
    border-radius: 0 !important;
}


.wc-block-components-checkout-return-to-cart-button{
    display: none !important;
}

#wc-block-components-totals-coupon__input-coupon{
    background: white !important;
    border: none !important;
    border-radius: 0 !important;
}
#wc-block-components-totals-coupon__input-coupon:focus-visible{
    outline-color: #1F374A;
}

#wc-block-components-totals-coupon__form button{
    min-height: 40px!important;
    font-weight: 600 !important;
}


.wp-block-woocommerce-checkout-order-summary-fee-block{
    display: none !important;
}


.wc-block-components-checkout-place-order-button{
    width: 100% !important;
    max-width: 500px!important;
}


.woocommerce #payment #place_order, .woocommerce-page #payment #place_order, [name="apply_coupon"]{
    background-color: #f5af3a !important;
    border-radius: 0 !important;
    color: white !important;
}
body.woocommerce-checkout h3{
    position: relative;
}
body.woocommerce-checkout h3:before {
    position: absolute;
    content: "";
    height: 2px;
    width: 2000px;
    background: #f9b021;
    top: 50%;
    right: calc(15px + 100%);
    transform: translateY(-50%);
}
body.woocommerce-checkout h2{
    position: relative;
    color: #2a3c4a;
}
body.woocommerce-checkout h2:before {
    position: absolute;
    content: "";
    height: 2px;
    width: 2000px;
    background: #f9b021;
    top: 50%;
    right: calc(15px + 100%);
    transform: translateY(-50%);
}

.awcdp_deposits_summary{
    margin-bottom: 50px;
}

/* Augmentation de la taille de police sur mobile pour .cvpm-summary-content */
@media (max-width: 767px) {
    .cvpm-summary-content,
    .cvpm-summary-content p,
    .cvpm-summary-content span,
    .cvpm-summary-content li,
    .cvpm-summary-content div,
    .cvpm-summary-content a {
        font-size: 1rem !important; /* +2px par rapport à 0.875rem (14px -> 16px) */
    }

    .cvpm-summary-content .cvpm-van-title {
        font-size: 1.625rem !important; /* +2px par rapport à 1.5rem (24px -> 26px) */
    }

    .cvpm-summary-content .cvpm-price-detail,
    .cvpm-summary-content .cvpm-sub-list li,
    .cvpm-summary-content .cvpm-change-dates,
    .cvpm-summary-content .cvpm-small {
        font-size: 0.875rem !important; /* +2px par rapport à 0.75rem (12px -> 14px) */
    }

    .woocommerce-billing-fields {
        padding-left: 5px;
        padding-right: 5px;
    }

    #order_review_heading{
        padding-left: 5px;
        padding-right: 5px;
    }
}

/* Loader Checkout */
.cvpm-checkout-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 100000; /* Au-dessus de tout */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

.cvpm-checkout-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.cvpm-checkout-loader .cvpm-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #f9b02d;
    border-radius: 50%;
    animation: cvpm-spin 1s linear infinite;
}

@keyframes cvpm-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.cvpm-checkout-loader p {
    margin-top: 20px;
    font-size: 18px;
    color: #f9b02d;
    font-weight: 600;
}