/**
 * Delivery Location Module - Styles
 */

/* Conteneur principal */
.delivery-location-wrapper {
    position: relative;
    display: inline-block;
}

/* Sélecteur de localisation */
.delivery-location-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px ;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 200px;
}

/*.delivery-location-selector:hover {
    background: #f8f8f8;
    border-color: #bbb;
}*/
p#delivery_address_error {
    display: none !important;
}
/* Icône de localisation */
.delivery-icon {
    display: flex;
    align-items: center;
    color: #333;
}

.delivery-icon svg {
	color: #006c88;
    width: 20px;
    height: 20px;
}

/* Informations de livraison */
.delivery-info {
    flex: 1;
    min-width: 0;
}

.delivery-label {
    font-size: 0.75rem;
    color: #666;
    line-height: 1;
    margin-bottom: 2px;
}

.delivery-location {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Indicateur d'absence de localisation */
.delivery-info.no-location .delivery-location {
    color: #c3ce03;
    animation: pulse 2s ease-in-out infinite;
}
.delivery-location-selector:after {
    font-family: "FontAwesome";
    content: "\F107";
    font-size: 16px;
    padding-left: 3px;
	margin-top: 14px;
	font-weight: bold;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Flèche */
.delivery-arrow {
    font-size: 0.7rem;
    color: #666;
    transition: transform 0.2s;
}

.delivery-location-selector:hover .delivery-arrow {
    transform: translateY(2px);
}

/* Modal */
.delivery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
}

.delivery-modal.active {
    display: block;
}

.delivery-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.delivery-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Header du modal */
.delivery-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}

.delivery-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.delivery-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.delivery-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* Body du modal */
.delivery-modal-body {
    padding: 24px;
}

/* Section des adresses (clients connectés) */
.delivery-addresses-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.delivery-addresses-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

/* Item d'adresse */
.delivery-address-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.delivery-address-item:hover {
    border-color: #c3ce03;
    background: #f8f9fa;
}

.delivery-address-item.selected {
    border-color: #c3ce03;
    background: #e3f2fd;
}

.delivery-address-radio {
    padding-top: 2px;
}

.delivery-address-radio input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.delivery-address-content {
    flex: 1;
}

.delivery-address-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    font-size: 1rem;
}

.delivery-address-details {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

.delivery-address-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #c3ce03;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Section invité */
.delivery-guest-section {
    max-width: 450px;
    margin: 0 auto;
}

.delivery-geolocation-wrapper {
    text-align: center;
}

#useGeolocationBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
}

#useGeolocationBtn .material-icons {
    font-size: 20px;
}

#useGeolocationBtn .spinner-border {
    width: 16px;
    height: 16px;
}

/* Formulaire */
.delivery-guest-section .form-group {
    margin-bottom: 20px;
}

.delivery-guest-section label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.delivery-guest-section input.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.2s;
}

.delivery-guest-section input.form-control:focus {
    outline: none;
    border-color: #c3ce03;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.delivery-guest-section button[type="submit"] {
    width: 100%;
    padding: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.delivery-guest-section button[type="submit"] .material-icons {
    font-size: 18px;
}

/* Loading */
.delivery-loading {
    text-align: center;
    padding: 30px;
    color: #666;
}

/* Notification toast */
.delivery-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}



.delivery-modal-content {
    max-width: 450px;
}

.block-style .delivery-subtitle {
    color: #0F1111;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.4;
}

/* Adresses block style */
.block-addresses {
    /*border: 1px solid #D5D9D9;
    border-radius: 8px;*/
    overflow: hidden;
    margin-bottom: 16px;
}

.block-addresses .delivery-address-item {
    /*border-bottom: 1px solid #D5D9D9;*/
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
}

/*.block-addresses .delivery-address-item:last-child {
    border-bottom: none;
}*/

.block-addresses .delivery-address-item:hover {
    background: #F7FAFA;
}

.block-addresses .delivery-address-item.selected {
    background: #F0F2F2;
   /*border-left: 3px solid #c3ce03;*/
}

.block-addresses .delivery-address-item.default-badge::before {
    content: 'Default address';
    display: none;
    background: #c3ce03;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    margin-right: 8px;
    font-weight: 600;
}

/* Welcome message avec icône */
.delivery-welcome-msg {
    text-align: center;
    margin-bottom: 24px;
}

.delivery-geo-icon {
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
}

.delivery-geo-title {
    font-size: 18px;
    font-weight: 600;
    color: #0F1111;
    margin: 0;
}

/* Bouton géolocalisation style block */
.delivery-geo-btn {
    background: #006C88;
    border-color: #006C88;
    color: #fff;
    font-weight: 600;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.2s;
}

.delivery-geo-btn:hover {
    background: #c3ce03;
    border-color: #c3ce03;
    color: #0F1111;
}

/* Formulaire postal code */
.delivery-postal-form {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.delivery-postal-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #888C8C;
    border-radius: 8px;
    font-size: 14px;
}

.delivery-postal-input:focus {
    outline: none;
    border-color: #c3ce03;
    box-shadow: 0 0 0 3px rgb(228 121 17 / 50%);
}

.delivery-postal-btn,
.delivery-update-btn {
    background: #006C88;
    border: 1px solid #0d7995;
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s;
}

.delivery-postal-btn:hover,
.delivery-update-btn:hover {
    background: #c3ce03;
    border-color: #c3ce03;
}

.delivery-update-btn {
    padding: 10px;
}

/* Divider style block */
.delivery-or-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.delivery-or-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #E7E7E7;
}

.delivery-or-divider span {
    background: white;
    padding: 0 16px;
    position: relative;
    color: #565959;
    font-size: 12px;
}

/* Sélecteur de pays */
.delivery-country-selector {
    margin-top: 16px;
}

.delivery-country-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #0F1111;
	text-align: left;
}

.delivery-country-select {
    padding: 8px 12px;
    border: 1px solid #888C8C;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    width: 100%;
}

.delivery-country-select:focus {
    outline: none;
    border-color: #c3ce03;
    box-shadow: 0 0 0 1px rgb(213 217 127 / 80%);
}

/* Lien de gestion */
.delivery-divider {
    text-align: center;
    padding: 8px 0;
}

.delivery-manage-link {
    color: #006C88;
    font-size: 13px;
    text-decoration: none;
}

.delivery-manage-link:hover {
    color: #c3ce03;
    text-decoration: underline;
}

/* Guest form specific */
.delivery-guest-form .delivery-postal-input {
    margin-bottom: 12px;
}

/* Responsive */
@media (min-width: 768px) and (max-width: 1400px) {
.delivery-location-selector {
    
    min-width: 165px;
}
}

@media (max-width: 768px) {
    .delivery-location-selector {
        min-width: 150px;
        padding: 6px 10px;
    }
	.delivery-info {display: inline-block;}
    .delivery-label,.delivery-location {
        font-size: 0.85rem;
		display: inline-block;
		font-weight: normal;
        overflow: inherit;
		
    }
	.delivery-location {
        
		text-transform: capitalize;
    }
	.delivery-location-selector:after{margin-top: 0;}
        .delivery-label:after {
        content: "-";
        color: #000000;
        padding: 8px;
        font-size: 16px;
    }

    .delivery-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .delivery-modal-header {
        padding: 16px;
    }

    .delivery-modal-header h2 {
        font-size: 1.2rem;
    }

    .delivery-modal-body {
        padding: 16px;
    }

    .delivery-address-item {
        padding: 12px;
    }

    .delivery-address-badge {
        position: static;
        display: block;
        width: fit-content;
        margin-top: 8px;
    }
}

@media (max-width: 480px) {
    .delivery-location-selector {
        min-width: 120px;
        font-size: 0.85rem;
    }

    .delivery-icon svg {
        width: 16px;
        height: 16px;
    }

    .delivery-modal-content {
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        transform: none;
        animation: slideUpMobile 0.3s ease;
    }

    @keyframes slideUpMobile {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
}

/* Amélioration de l'accessibilité */
.delivery-location-selector:focus {
    outline: 2px solid #c3ce03;
    outline-offset: 2px;
}

button:focus {
    outline: 2px solid #c3ce03;
    outline-offset: 2px;
}

/* Divider "or" */
.delivery-or-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.delivery-or-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #ddd;
}

.delivery-or-divider span {
    background: white;
    padding: 0 15px;
    position: relative;
    color: #999;
    font-size: 0.9em;
    font-weight: 500;
}

/* Amélioration visuelle des boutons */
.btn-info {
    background-color: #006C88;
    border-color: #006C88;
}

.btn-info:hover {
    background-color: #c3ce03;
    border-color: #c3ce03;
}

.btn-outline-primary {
    border-color: #c3ce03;
    color: #c3ce03;
}

.btn-outline-primary:hover {
    background-color: #c3ce03;
    color: white;
}

/* Animation au chargement */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.delivery-loading::after {
    content: '';
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #c3ce03;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
