/* Transitions douces pour le changement de langue */
body {
    transition: all 0.3s ease-in-out;
}

/* Styles RTL spécifiques */
[dir="rtl"] .space-x-4 > :not([hidden]) ~ :not([hidden]) {
    --tw-space-x-reverse: 1;
    margin-right: calc(1rem * var(--tw-space-x-reverse));
    margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse)));
}

[dir="rtl"] .space-x-6 > :not([hidden]) ~ :not([hidden]) {
    --tw-space-x-reverse: 1;
    margin-right: calc(1.5rem * var(--tw-space-x-reverse));
    margin-left: calc(1.5rem * calc(1 - var(--tw-space-x-reverse)));
}

/* Animation du switch de langue */
#langSwitch {
    transition: all 0.3s ease-in-out;
}

#langSwitch:hover {
    background-color: rgba(19, 124, 139, 0.1);
}

/* Styles pour le panier */
.cart-counter {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #137C8B;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

[dir="rtl"] .cart-counter {
    right: auto;
    left: -8px;
}

/* Animation pour l'ajout au panier */
@keyframes addToCart {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.add-to-cart-animation {
    animation: addToCart 0.3s ease;
}

/* Notifications */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    background: #709CA7;
    color: white;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

[dir="rtl"] .notification {
    right: auto;
    left: 20px;
}

.notification.show {
    transform: translateY(0);
    opacity: 1;
}

.notification.error {
    background: #137C8B;
}

/* Loader */
.loader {
    width: 40px;
    height: 40px;
    border: 4px solid #B8CBD0;
    border-top: 4px solid #137C8B;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* Styles pour les boutons */
.custom-button {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.custom-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.custom-button:hover::after {
    width: 200%;
    height: 200%;
}

/* Styles pour les inputs */
input::placeholder {
    transition: color 0.3s ease;
}

input:focus::placeholder {
    color: transparent;
}

/* Styles pour les sélecteurs */
select {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

select:hover {
    border-color: #137C8B;
}

/* Styles pour les cartes */
.category-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(52, 77, 89, 0.1);
}

/* Styles pour le mode sombre */
@media (prefers-color-scheme: dark) {
    .dark-mode {
        background-color: #344D59;
        color: #B8CBD0;
    }

    .dark-mode .bg-white {
        background-color: #7A90A4;
    }

    .dark-mode .text-gray-600 {
        color: #B8CBD0;
    }

    .dark-mode .border {
        border-color: #7A90A4;
    }
}

/* Styles de livraison */
.delivery-option {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.delivery-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(52, 77, 89, 0.1), 0 2px 4px -1px rgba(52, 77, 89, 0.06);
}

.delivery-option.selected {
    border-color: #137C8B;
    background-color: #B8CBD0;
}

.delivery-option input[type="radio"] {
    cursor: pointer;
}

.delivery-option input[type="radio"]:checked + .delivery-content {
    border-color: #137C8B;
    background-color: #B8CBD0;
}

/* Animation de suivi de livraison */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.tracking-status {
    animation: pulse 2s infinite;
}

.tracking-step {
    position: relative;
}

.tracking-step::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -50px;
    width: 40px;
    height: 2px;
    background-color: #7A90A4;
}

.tracking-step.completed::before {
    background-color: #137C8B;
}

.tracking-step:first-child::before {
    display: none;
}

/* Étapes de commande */
.order-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.step {
    display: flex;
    align-items: center;
}

.step-number {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    font-weight: 600;
}

.step.active .step-number {
    background-color: #137C8B;
    color: white;
}

.step.completed .step-number {
    background-color: #709CA7;
    color: white;
}

.step-line {
    flex: 1;
    height: 2px;
    background-color: #B8CBD0;
    margin: 0 1rem;
}

.step-line.active {
    background-color: #137C8B;
}

/* Zone de livraison */
.zone-select {
    position: relative;
}

.zone-select select {
    appearance: none;
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%237A90A4'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
}

/* Informations de livraison */
.delivery-info {
    background-color: #B8CBD0;
    border-radius: 0.5rem;
    padding: 1rem;
}

.delivery-info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #B8CBD0;
}

.delivery-info-row:last-child {
    border-bottom: none;
}

/* Modal de suivi */
.tracking-modal {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.tracking-modal-content {
    background-color: #709CA7;
    border-radius: 0.5rem;
    padding: 1.5rem;
    max-width: 32rem;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Styles responsifs */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .order-steps {
        flex-direction: column;
        align-items: flex-start;
    }

    .step {
        margin-bottom: 1rem;
    }

    .step-line {
        display: none;
    }

    .delivery-option {
        flex-direction: column;
    }

    .delivery-info {
        margin-top: 1rem;
    }
}

/* Styles d'accessibilité */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Focus visible pour l'accessibilité */
:focus-visible {
    outline: 2px solid #137C8B;
    outline-offset: 2px;
}

/* Styles pour le contraste élevé */
@media (forced-colors: active) {
    .button {
        border: 2px solid currentColor;
    }
}
