/* ========================================
   Section Mode de livraison
   ======================================== */

/* Conteneur principal - Style uniforme avec les autres sections */
.cloc-section.cloc-delivery-section {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e8e8e8;
}

/* Titre de section */
.cloc-delivery-section .cloc-section-title {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Wrapper de transport */
#cloc-transport-address-wrapper.cloc-transport-section {
    /* Retirer les marges/paddings par défaut */
    margin: 0;
    padding: 0;
}

/* ========================================
   Transport Obligatoire
   ======================================== */
.cloc-transport-mandatory {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.cloc-transport-mandatory strong {
    color: #856404;
    font-size: 15px;
    display: block;
    margin-bottom: 8px;
}

.cloc-transport-mandatory p {
    margin: 0;
    color: #856404;
    font-size: 14px;
}

/* ========================================
   Transport Optionnel
   ======================================== */
.cloc-transport-optional {
    /* Conteneur pour les options */
}

/* Label principal */
.cloc-transport-label {
    display: block;
    font-weight: 500;
    margin-bottom: 15px;
    color: #555;
    font-size: 15px;
}

/* Options de transport (radio buttons) */
.cloc-transport-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

/* Chaque option */
.cloc-transport-option {
    display: block;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.cloc-transport-option:hover {
    border-color: #007cba;
    background: #f8f9fa;
}

/* Radio button caché mais fonctionnel */
.cloc-transport-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Option sélectionnée */
.cloc-transport-option:has(input[type="radio"]:checked) {
    background: #e7f5fe;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

/* Contenu de l'option */
.cloc-transport-option div {
    pointer-events: none;
}

.cloc-transport-option strong {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: #333;
    margin-bottom: 5px;
}

.cloc-transport-option .option-desc {
    font-size: 13px;
    color: #666;
}

/* Indicateur visuel de sélection */
.cloc-transport-option:has(input[type="radio"]:checked)::after {
    content: '✓';
    position: absolute;
    top: -5px;
    right: -5px;
    background: #007cba;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

/* ========================================
   Champ d'adresse
   ======================================== */
.cloc-address-field {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* Animation d'apparition */
#cloc_optional_address_field {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        margin-top: 0;
    }
    to {
        opacity: 1;
        max-height: 300px;
        margin-top: 20px;
    }
}

/* Label de l'adresse */
.cloc-address-field label {
    display: block;
    font-weight: 500;
    margin-bottom: 10px;
    color: #555;
    font-size: 14px;
}

.cloc-address-field .required {
    color: #dc3545;
}

/* Wrapper input + bouton */
.cloc-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: stretch;
	flex-direction : column;
}

/* Input adresse */
.cloc-input-wrapper input[type="text"] {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.cloc-input-wrapper input[type="text"]:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

/* Bouton Calculer */
.cloc-input-wrapper .button {
    padding: 12px 25px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.cloc-input-wrapper .button:hover {
    background: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.cloc-input-wrapper .button:active {
    transform: translateY(0);
}

/* ========================================
   Résultat du calcul
   ======================================== */
.cloc-calc-result {
    margin-top: 15px;
    padding: 15px;
    background: #d4edda;
    border: 1px solid #28a745;
    border-radius: 8px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cloc-calc-result.error {
    background: #f8d7da;
    border-color: #dc3545;
}

.cloc-calc-result p {
    margin: 5px 0;
    font-size: 14px;
    color: #155724;
}

.cloc-calc-result.error p {
    color: #721c24;
}

/* ========================================
   Information sauvegardée
   ======================================== */
.cloc-saved-info {
	display:none;
    margin-top: 15px;
    padding: 12px;
    background: #e7f5fe;
    border-left: 4px solid #007cba;
    border-radius: 4px;
    font-size: 14px;
}

.cloc-saved-info strong {
    color: #004085;
}

.cloc-clear-link {
    float: right;
    color: #dc3545;
    text-decoration: none;
    font-size: 13px;
}

.cloc-clear-link:hover {
    text-decoration: underline;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    .cloc-delivery-section {
        padding: 20px 15px;
    }
    
    .cloc-transport-options {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .cloc-input-wrapper {
        flex-direction: column;
    }
    
    .cloc-input-wrapper input[type="text"] {
        width: 100%;
    }
    
    .cloc-input-wrapper .button {
        width: 100%;
    }
    
    .cloc-transport-option::after {
        top: 5px;
        right: 5px;
    }
}

/* ========================================
   Fix pour l'affichage sur la page actuelle
   ======================================== */

/* Retirer les styles inline qui cassent le layout */
.cloc-delivery-section * {
    box-sizing: border-box;
}

/* S'assurer que les emojis s'affichent correctement */
.cloc-delivery-section img.emoji {
    display: inline !important;
    width: 1em !important;
    height: 1em !important;
    margin: 0 0.2em !important;
    vertical-align: -0.1em !important;
    background: none !important;
    box-shadow: none !important;
}



/** NEw Version **/

/* Section livraison redesignée */
.cloc-delivery-section {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e8e8e8;
}

.cloc-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.cloc-section-title svg {
    color: #007cba;
}

/* Options de livraison */
.cloc-delivery-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.cloc-option-card {
    position: relative;
}

.cloc-option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cloc-option-label {
    display: flex;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.cloc-option-label:hover {
    background: #fff;
    border-color: #007cba;
}

.cloc-option-card input[type="radio"]:checked + .cloc-option-label {
    background: #e7f5fe;
    border-color: #007cba;
}

.option-icon {
    width: 48px;
    height: 48px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
}

.option-icon svg {
    color: #007cba;
}

.option-content {
    flex: 1;
}

.option-content strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
    color: #333;
}

.option-desc {
    font-size: 13px;
    color: #666;
}

.option-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 2px solid #e0e0e0;
}

.cloc-option-card input[type="radio"]:checked + .cloc-option-label .option-indicator {
    background: #007cba;
    border-color: #007cba;
}

.cloc-option-card input[type="radio"]:checked + .cloc-option-label .option-indicator::after {
    content: '✓';
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
}

/* Formulaire d'adresse */
.cloc-delivery-form {
    margin-top: 20px;
}

.cloc-form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    margin-bottom: 10px;
    color: #555;
}

.label-icon {
    color: #007cba;
}

.required {
    color: #dc3545;
}

.cloc-input-group {
    display: flex;
    gap: 10px;
}

.cloc-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.cloc-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0,124,186,0.1);
}

.cloc-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cloc-btn-primary {
    background: #007cba;
    color: white;
}

.cloc-btn-primary:hover {
    background: #005a87;
    transform: translateY(-1px);
}

/* Notices */
.cloc-transport-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.cloc-notice-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
}

.notice-icon {
    color: #856404;
    flex-shrink: 0;
}

.notice-content strong {
    display: block;
    margin-bottom: 4px;
    color: #856404;
}

.notice-content p {
    margin: 0;
    font-size: 14px;
    color: #856404;
}

/* Résultats */
.cloc-delivery-result {
    margin-top: 15px;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cloc-result-success {
    background: #d4edda;
    border: 1px solid #28a745;
}

.result-icon {
    width: 32px;
    height: 32px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.result-content {
    flex: 1;
}

.result-content strong {
    display: block;
    margin-bottom: 4px;
    color: #155724;
}

.result-content p {
    margin: 2px 0;
    color: #155724;
    font-size: 14px;
}

.cloc-btn-clear {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #dc3545;
    transition: all 0.2s;
}

.cloc-btn-clear:hover {
    background: rgba(220,53,69,0.1);
    border-radius: 4px;
}

/* Adresse sauvegardée */
.cloc-saved-address {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #e7f5fe;
    border-left: 4px solid #007cba;
    border-radius: 4px;
    margin-top: 15px;
}

.saved-icon {
    color: #007cba;
}

.saved-content {
    flex: 1;
    font-size: 14px;
}

.cloc-btn-text {
    background: none;
    border: none;
    color: #dc3545;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .cloc-delivery-options {
        grid-template-columns: 1fr;
    }
    
    .cloc-input-group {
        flex-direction: column;
    }
    
    .cloc-btn {
        width: 100%;
    }
}

/** NOUVELLE VERSION*/

/* Harmonisation avec le style existant */
.cloc-delivery-section {
    /* Même style que les autres sections */
}

.cloc-delivery-section .cloc-section-title {
    /* Déjà défini dans le style global */
}

/* Groupe de radio buttons */
.cloc-radio-group {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.cloc-radio-option {
    flex: 1;
    position: relative;
    cursor: pointer;
}

.cloc-radio-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cloc-radio-content {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.cloc-radio-option input:checked + .cloc-radio-content {
    background: #e7f5fe;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.cloc-radio-icon {
    font-size: 24px;
    margin-right: 12px;
}

.cloc-radio-text {
    display: flex;
    flex-direction: column;
}

.cloc-radio-text strong {
    font-size: 15px;
    color: #333;
    margin-bottom: 2px;
}

.cloc-radio-text small {
    font-size: 13px;
    color: #666;
}

/* Champs de formulaire */
.cloc-field-wrapper {
    margin-top: 20px;
}

.cloc-field-wrapper label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #555;
    font-size: 14px;
}

.cloc-input-row {
    display: flex;
    gap: 10px;
}

.cloc-input-row input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s ease;
}

.cloc-input-row input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.cloc-btn-calc {
    padding: 10px 20px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.cloc-btn-calc:hover {
    background: #005a87;
}

/* Alerte */
.cloc-alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.cloc-alert-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
}

.cloc-alert strong {
    display: block;
    margin-bottom: 4px;
}

.cloc-alert p {
    margin: 0;
    font-size: 14px;
}

/* Adresse sauvegardée */
.cloc-address-saved {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #e7f5fe;
    border-left: 4px solid #007cba;
    border-radius: 4px;
    margin-top: 15px;
}

.cloc-address-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cloc-info-text {
    font-size: 14px;
    line-height: 1.4;
}

.cloc-btn-clear {
    background: white;
    color: #dc3545;
    border: 1px solid #dc3545;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.cloc-btn-clear:hover {
    background: #dc3545;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .cloc-radio-group {
        flex-direction: column;
    }
    
    .cloc-input-row {
        flex-direction: column;
    }
    
    .cloc-btn-calc {
        width: 100%;
    }
}



