/**
 * CSS pour la navigation par étapes du checkout
 * Une seule étape visible à la fois avec navigation avant/arrière
 */

/* ========== Inputs généraux ========== */

input:not([type=submit]):not([type=button]):not([type=radio]):not([type=checkbox]):not([type=number]) {
    font-family: Poppins, Sans-serif;
    background-color: #F8F8F8 !important;
}

/* ========== Masquer le breadcrumb ========== */

nav.breadcrumb.hidden-sm-down {
    display: none;
}

/* ========== Titre de l'étape actuelle ========== */

.checkout-step-title {
    font-family: 'Poppins', sans-serif;
    font-size: 25px;
    font-weight: 600;
    color: #003d60;
    text-align: left;
    margin-top: 30px;
    margin-bottom: 0;
}

/* ========== Container dans wrapper - retirer max-width et ajouter margin ========== */

#wrapper > .container {
    max-width: 1350px;
    margin-left: auto;
    margin-right: auto;
}

/* Container auto pour les résolutions de 1024px et en-dessous */
@media (max-width: 1024px) {
    .container {
        width: auto !important;
    }
}

/* ========== Lien "Continuer mes achats" en haut à gauche ========== */

.continue-shopping-link {
    position: absolute;
    top: 0;
    left: 0;
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    color: #163C5D !important;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 400;
    font-family: 'Poppins', sans-serif;
    transition: color 0.3s ease;
}

.continue-shopping-link:hover {
    color: #E84242 !important;
}

.continue-shopping-link:hover i {
    color: #E84242 !important;
}

.continue-shopping-link .ceicon-long-arrow-left {
    font-size: 16px;
}

/* Anciens sélecteurs pour compatibilité */
#checkout .continue-shopping-link,
#checkout [data-block-name="continue_shopping"] a.label {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    color: #003d60;
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    font-family: 'Poppins', sans-serif;
}

#checkout [data-block-name="continue_shopping"] a.label:hover {
    text-decoration: underline;
}

#checkout [data-block-name="continue_shopping"] a.label i.material-icons {
    font-size: 18px;
}

/* Cacher le lien "Continuer mes achats" pour les écrans de 1023px et en-dessous */
@media (max-width: 1023px) {
    .continue-shopping-link,
    #checkout .continue-shopping-link,
    #checkout [data-block-name="continue_shopping"] a.label {
        display: none;
    }
}

/* ========== Masquer toutes les étapes par défaut ========== */

#checkout-section .checkout-step {
    display: none;
}

/* ========== Masquer les titres H1 des étapes (on utilise le H2 global) ========== */

#checkout-section .checkout-step .step-title {
    display: none !important;
}

/* ========== Afficher uniquement l'étape active ========== */

#checkout-section .checkout-step.step-current {
    display: block;
}

/* ========== Padding du contenu des étapes ========== */

body#checkout section.checkout-step .content {
    padding-left: 10px;
}

/* ========== Forcer le contenu des étapes à être visible ========== */
/* Override les styles PrestaShop qui masquent le contenu des étapes unreachable */

#checkout-section .checkout-step.step-current .content {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
}

/* S'assurer que les formulaires sont visibles */
#checkout-section .checkout-step.step-current form {
    display: block !important;
}

/* Masquer le message "unreachable" de PrestaShop si présent */
#checkout-section .checkout-step.step-current .unreachable {
    display: none !important;
}

/* ========== Forcer le contenu des étapes adresses et livraison ========== */
/* Ces étapes doivent toujours avoir leur contenu généré et visible */

#checkout-addresses-step .content,
#checkout-delivery-step .content {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
}

#checkout-addresses-step form,
#checkout-delivery-step form {
    display: block !important;
}

/* Masquer le titre "not-allowed" de PrestaShop */
#checkout-section .checkout-step .step-title.not-allowed {
    cursor: default;
}

/* Retirer l'icône "edit" sur les étapes non complètes */
#checkout-section .checkout-step:not(.-complete) .step-edit {
    display: none !important;
}

/* ========== Barre de progression des étapes ========== */

.checkout-steps-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 5px;
}

.checkout-steps-progress .step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.checkout-steps-progress .step-indicator:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 60%;
    width: 80%;
    height: 2px;
    background: #ddd;
}

.checkout-steps-progress .step-indicator.completed:not(:last-child)::after {
    background: #4caf50;
}

.checkout-steps-progress .step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #ddd;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.checkout-steps-progress .step-indicator.active .step-number {
    background: #2B8FF2;
    color: #fff;
}

.checkout-steps-progress .step-indicator.completed .step-number {
    background: #4caf50;
    color: #fff;
}

.checkout-steps-progress .step-label {
    font-size: 12px;
    color: #666;
    text-align: center;
}

.checkout-steps-progress .step-indicator.active .step-label {
    color: #2B8FF2;
    font-weight: bold;
}

.checkout-steps-progress .step-indicator.completed .step-label {
    color: #4caf50;
}

/* ========== Boutons de navigation entre étapes ========== */

.checkout-step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.checkout-step-navigation .btn-prev-step {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.checkout-step-navigation .btn-prev-step .material-icons {
    font-size: 18px;
}

.checkout-step-navigation .btn-next-step {
    margin-left: auto;
}

/* Masquer le bouton précédent sur la première étape */
.checkout-step:first-of-type .btn-prev-step {
    visibility: hidden;
}

/* ========== État de chargement des boutons ========== */

button.loading,
.btn.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

button.loading::after,
.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Animation pour l'icône de chargement */
.material-icons.spinning {
    animation: spin 1s linear infinite;
    display: inline-block;
}

/* ========== Erreurs de formulaire ========== */

.checkout-step-error {
    margin-bottom: 20px;
}

.checkout-step-error p {
    margin: 0;
}

.checkout-step-error p + p {
    margin-top: 5px;
}

/* ========== Barre de progression globale des 5 étapes ========== */

.checkout-progress-wrapper {
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    padding: 20px 0;
}

.checkout-steps-progress-5 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.checkout-steps-progress-5 .step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkout-steps-progress-5 .step-indicator:hover {
    transform: translateY(-2px);
}

.checkout-steps-progress-5 .step-indicator:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 60%;
    width: 80%;
    height: 3px;
    background: #e0e0e0;
    transition: background 0.3s ease;
}

.checkout-steps-progress-5 .step-indicator.completed:not(:last-child)::after {
   background: #2B8FF2;
}

.checkout-steps-progress-5 .step-indicator.active:not(:last-child)::after {
   /* background: linear-gradient(to right, #2B8FF2 50%, #e0e0e0 50%); */
}

.checkout-steps-progress-5 .step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f5f5f5;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
    border: 3px solid #e0e0e0;
    transition: all 0.3s ease;
}

.checkout-steps-progress-5 .step-indicator.active .step-number {
    background: #2B8FF2;
    color: #fff;
    border-color: #2B8FF2;
    box-shadow: 0 0 0 6px rgba(47, 181, 210, 0.3);
    transform: scale(1.1);
}

.checkout-steps-progress-5 .step-indicator.completed .step-number {
    background: #2B8FF2;
    color: transparent;
    border-color: #2B8FF2;
}

.checkout-steps-progress-5 .step-indicator.completed .step-number::before {
    content: '✓';
    position: absolute;
    font-size: 18px;
    font-weight: bold;
    color: #FFF;
}

.checkout-steps-progress-5 .step-label {
    text-transform: uppercase;
    font-family: Poppins, Sans-serif;
    font-size: 12px;
    color: #999;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
}

.checkout-steps-progress-5 .step-indicator.active .step-label {
    color: #2B8FF2;
    font-weight: 600;
    font-size: 12px;
}

.checkout-steps-progress-5 .step-indicator.completed .step-label {
    color: #2B8FF2;
    font-weight: 600;
}

/* ========== Étape de validation finale ========== */

#checkout-validation-step {
    text-align: center;
    padding: 40px 20px;
}

#checkout-validation-step .validation-message {
    font-size: 18px;
    color: #666;
    margin: 20px 0;
}

/* ========== Wrapper titre + cercle progression ========== */

.checkout-step-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
    margin-bottom: 0;
}

.checkout-step-title-wrapper .checkout-step-title {
    margin-top: 0;
    margin-bottom: 0;
    flex: 1;
}

/* ========== Cercle de progression mobile ========== */

.checkout-progress-circle {
    display: none;
    position: relative;
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}

.checkout-progress-circle .circular-progress {
    width: 100%;
    height: 100%;
}

.checkout-progress-circle .circle-bg {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 3;
}

.checkout-progress-circle .circle-progress {
    fill: none;
    stroke: #2B8FF2;
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dasharray 0.3s ease;
}

.checkout-progress-circle .progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #003d60;
}

/* ========== Responsive ========== */

@media (max-width: 767px) {
    .checkout-steps-progress {
        flex-wrap: wrap;
        gap: 15px;
    }

    .checkout-steps-progress .step-indicator {
        flex: 0 0 auto;
    }

    .checkout-steps-progress .step-indicator:not(:last-child)::after {
        display: none;
    }

    .checkout-step-navigation {
        flex-direction: column;
        gap: 10px;
    }

    .checkout-step-navigation .btn-prev-step,
    .checkout-step-navigation .btn-next-step {
        width: 100%;
    }

    /* Masquer la barre de progression desktop */
    .checkout-steps-progress-5 {
        display: none;
    }

    /* Afficher le cercle de progression mobile */
    .checkout-progress-circle {
        display: block;
    }

    /* Titre de l'étape */
    .checkout-step-title-wrapper {
        margin-top: 10px;
    }

    .checkout-step-title-wrapper .checkout-step-title {
        font-size: 20px;
    }

    /* Retirer le padding-top du wrapper de progression */
    .checkout-progress-wrapper {
        padding-top: 0;
        padding-bottom: 10px;
    }

    #wrapper {
        padding-top: 0 !important;
    }

    #notifications {
        display: none;
    }

    div.container:has(nav.breadcrumb.hidden-sm-down) {
        display: none;
    }

    /* Réafficher le lien "Continuer mes achats" en mobile */
    .continue-shopping-link,
    #checkout .continue-shopping-link,
    #checkout [data-block-name="continue_shopping"] a.label {
        display: inline-flex;
        position: relative;
        top: auto;
        left: auto;
    }

    .delivery-separator {
        margin: 0 !important;
    }

    body#checkout section.checkout-step .content {
        padding-left: 0 !important;
    }

    #checkout-delivery-step {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    #checkout-payment-step{
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .carrier-price-top {
        top: -20px !important;
    }

    #content-wrapper {
        margin-right: 10px;
        margin-left: 10px;
    }
}

/* ========== Affichage personnalisé du transporteur sélectionné ========== */

body#checkout section.checkout-step .delivery-options .delivery-option {
    margin-bottom: 40px;
    border-bottom: 1px solid #DFDFDF;
    display: flex;
    align-items: center;
}

body#checkout section.checkout-step .delivery-options .delivery-option > .col-sm-1 {
    flex: 0 0 auto;
    width: auto;
    padding-right: 5px;
}

body#checkout section.checkout-step .delivery-options .delivery-option > label {
    flex: 1;
}

body#checkout section.checkout-step .delivery-options .delivery-option:has(input[type="radio"]:checked) {
    border-bottom: 1px solid #2B8FF2;
}

.gls-container {
    padding-bottom: 0px;
}

.bg-gls {
    background-color: #4054B2;
    padding: 30px;
    border-radius: 8px;
}

.gls-heading {
    font-size: 15.2px;
    font-family: 'Poppins', sans-serif;
    text-transform: uppercase;
    font-weight: 600;
}

.gls-heading .gls-sub-heading {
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    text-transform: none;
    font-weight: 400;
    margin-top: 16px;
}

.gls-heading .gls-sub-heading ul {
    margin-left: 40px;
}

.gls-search {
    margin-top: 16px;
    background-color: #F8F8F8;
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
}

.gls-search .gls-search-form-toggler {
    padding: 20px 30px;
}

.gls-search #gls-search-form .form-group.input-group {
    padding: 0 30px 20px 30px;
}

.gls-search-btn-wrapper {
    margin: 0 !important;
    padding: 0;
}

.gls-search-btn-wrapper .btn {
    border-radius: 0;
    border: none;
}

.gls-search-form-toggler {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    color: #163C5D;
    text-decoration: none;
}

.gls-search-form-toggler:hover,
.gls-search-form-toggler:focus {
    color: #E84242 !important;
    text-decoration: none;
}

#gls-search-postcode,
#gls-search-city {
    border: none;
    border-bottom: 1px solid #163C5D;
    border-radius: 0;
    background: transparent;
    padding: 0 0 5px 0;
    outline: none;
    box-shadow: none;
    color: #1D3A6E;
}

#gls-search-postcode::placeholder,
#gls-search-city::placeholder {
    color: #1D3A6E !important;
    opacity: 1 !important;
}

#gls-search-postcode::-webkit-input-placeholder,
#gls-search-city::-webkit-input-placeholder {
    color: #1D3A6E !important;
    opacity: 1 !important;
}

#gls-search-postcode::-moz-placeholder,
#gls-search-city::-moz-placeholder {
    color: #1D3A6E !important;
    opacity: 1 !important;
}

.gls-toggle-icon {
    transition: transform 0.3s ease;
    font-size: 22px;
    width: 22px;
    height: 22px;
    color: #4054B2;
}

.gls-search-form-toggler[aria-expanded="true"] .gls-toggle-icon::before {
    content: "\f056";
}

.gls-search-form-toggler:not([aria-expanded="true"]) .gls-toggle-icon::before {
    content: "\f055";
}

/* GLS relay radio buttons alignés en mobile */
.gls-relay-infos .row {
    flex-wrap: nowrap;
}

.gls-relay-infos .col-select-relay {
    display: flex;
    align-items: center;
}

@media (max-width: 767px) {
    .gls-relay-infos .card-body > .row {
        display: flex;
        flex-wrap: wrap;
    }

    .gls-relay-infos .col-select-relay {
        flex: 0 0 40px !important;
        max-width: 40px !important;
        width: 40px !important;
        padding: 0 5px;
    }

    .gls-relay-infos .col-select-relay + label {
        flex: 1 !important;
        max-width: calc(100% - 40px) !important;
        width: calc(100% - 40px) !important;
    }

    .gls-relay-infos .col-select-relay + label + div {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        margin-left: 40px;
        padding: 0 5px;
    }
}

@media (max-width: 767px) {
    /* Label + input téléphone empilés en mobile */
    .gls-mobile-row {
        flex-direction: column;
        align-items: stretch;
    }

    .gls-mobile-label {
        width: 100% !important;
        margin-bottom: 10px;
    }

    .gls-container .gls-mobile-input {
        width: 100% !important;
    }

    /* Radio transporteur centré verticalement à gauche du label en mobile */
    .delivery-option {
        display: flex !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
    }

    .delivery-option > .col-sm-1 {
        flex: 0 0 auto;
        width: auto !important;
        display: flex;
        align-items: center;
        padding-right: 10px;
    }

    .delivery-option > label {
        flex: 1;
        width: auto !important;
    }

    .carrier-extra-content-gls {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    #gls-search-form .input-group {
        display: flex !important;
        flex-wrap: nowrap !important;
        column-gap: 15px !important;
    }

    #gls-search-form .input-group #gls-search-postcode {
        flex: 0 0 calc(50% - 8px) !important;
        width: calc(50% - 8px) !important;
        min-width: 0 !important;
    }

    #gls-search-form .input-group #gls-search-city {
        flex: 0 0 calc(50% - 8px) !important;
        width: calc(50% - 8px) !important;
        min-width: 0 !important;
    }

    .gls-search {
        overflow: visible !important;
    }

    .gls-search-form-toggler .gls-toggle-icon {
        margin-left: 8px;
        flex-shrink: 0;
    }
}

.gls-mobile-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.gls-mobile-label {
    width: 66%;
    flex-shrink: 0;
    color: #e81f1f;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    text-align: left;
    margin: 0;
}

.gls-mobile-input {
    width: 34% !important;
    margin: 0 !important;
    padding: 15px 0 !important;
    background-color: #F8F8F8 !important;
    border-radius: 30px !important;
    border: none !important;
    text-align: center !important;
    color: #4054b2 !important;
    font-family: "Poppins", sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
}

.carrier-content-wrapper {
    position: relative;
    width: 100%;
}

.carrier-price-top {
    position: absolute;
    top: 0;
    right: 0;
}

.carrier-price-top .carrier-price {
    font-family: "Poppins", sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #163C5D;
}

.carrier-main-content {
    display: flex;
    align-items: center;
    gap: 70px;
}

.carrier-info-left {
    flex: 0 1 auto;
}

.carrier-name-wrapper {
    margin-bottom: 8px;
}

.carrier-name-prefix {
    font-family: "Poppins", sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #163C5D;
}

.carrier-name {
    font-family: "Poppins", sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: #163C5D;
}

/* Masquer l'affichage visuel du module advanceddateofdelivery (on utilise uniquement ses données JS) */
#advanceddateofdelivery {
    display: none;
}

.carrier-delay-wrapper {
    font-family: "Poppins", sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #163C5D;
}

.carrier-delay-text {
    font-weight: 400;
}

.carrier-delay-date {
    font-weight: 600;
}

.carrier-logo-right {
    flex-shrink: 0;
}

.carrier-logo-right img {
    width: 80px !important;
    max-width: 100px;
    max-height: 60px;
    object-fit: contain;
}

/* Style pour l'option de livraison sélectionnée */
.delivery-option:has(input[type="radio"]:checked) {
    padding: 10px;
}

/* Remplacer le radio button par des icônes FontAwesome */
.delivery-option .custom-radio {
    position: relative;
    display: inline-block;
}

.delivery-option .custom-radio input[type="radio"] {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
}

.delivery-option .custom-radio span:last-child {
    display: none;
}

.delivery-option .custom-radio::before {
    font-family: "Font Awesome 5 Free";
    content: "\f111"; /* fa-circle */
    font-weight: 400;
    font-size: 20px;
    color: #2B8FF2;
    display: inline-block;
}

.delivery-option .custom-radio:has(input[type="radio"]:checked)::before {
    content: "\f192"; /* fas-circle-dot */
    font-weight: 900;
}

/* ========== Section "En retrait" ========== */

.delivery-separator {
    width: 100%;
    height: 1px;
    background-color: #ddd;
    margin: 30px 0 20px 0;
}

.pickup-section {
    display: none;
    margin-bottom: 20px;
}

.delivery-method-title {
    font-family: "Poppins", sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #163C5D;
    margin-bottom: 25px;
}

#hook-display-after-carrier {
    display: none;
}

.pickup-title {
    font-family: "Poppins", sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #163C5D;
    margin-bottom: 25px;
    margin-top: 15px;
}

.pickup-subtitle {
    font-family: "Poppins", sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #163C5D;
}

/* ========== Blocage formulaire livraison pendant validation ========== */

.delivery-locked {
    position: relative;
    pointer-events: none;
    opacity: 0.5;
}

