/* Styles pour le popup mobile */

.mobile-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-popup-overlay.active {
    opacity: 1;
}

.mobile-popup-container {
    position: relative;
    background: #ffffff;
    margin: 20px auto;
    max-width: 90%;
    width: 100%;
    height: 90vh;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.mobile-popup-container .merchant-ajax-search-wrapper {
    min-width: fit-content;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mobile-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.mobile-popup-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.mobile-popup-content {
    padding: 60px 20px 20px;
    overflow-y: auto;
    max-height: 80vh;
    height: 100%;
}

.mobile-popup-content > *:first-child {
    margin-top: 0;
}

.mobile-popup-content > *:last-child {
    margin-bottom: 0;
}

/* Styles pour les widgets dans le popup */
.mobile-popup-widgets {
    margin-top: 20px;
}

.popup-widget {
    margin-bottom: 20px;
}

.popup-widget:last-child {
    margin-bottom: 0;
}

.popup-widget-title {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

/* Style pour le bouton de déclenchement */
.mobile-popup-trigger {
    background-color: transparent;
    color: #ffffff;
    border: none;
    padding: 12px 0;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.mobile-popup-trigger:hover, .mobile-popup-trigger:focus {
    background-color: transparent;
}

/* Styles pour les icônes dans le bouton */
.popup-button-icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Bouton avec icône uniquement (sans texte) */
.popup-button-icon-only {
    width: auto;
    height: auto;
}

.popup-button-icon-only .popup-button-icon {
    margin: 0;
}

/* Espacement pour le texte quand il y a une icône */
.popup-button-text {
    display: inline-block;
}

/* Icône à gauche */
.popup-button-icon-left {
    order: -1;
}

/* Icône à droite */
.popup-button-icon-right {
    order: 1;
}

/* Responsive - Desktop */
@media (min-width: 768px) {
    .mobile-popup-container {
        max-width: 600px;
        margin: 50px auto;
    }
    
    .mobile-popup-content {
        padding: 60px 40px 40px;
    }
}

/* Empêcher le scroll du body quand le popup est ouvert */
body.mobile-popup-open {
    overflow: hidden;
}

/* Styles pour les blocs Gutenberg dans le popup */
.mobile-popup-content .wp-block-image {
    margin: 20px 0;
}

.mobile-popup-content .wp-block-image img {
    max-width: 100%;
    height: auto;
    display: block;
}

.mobile-popup-content .wp-block-button {
    margin: 15px 0;
}

.mobile-popup-content .wp-block-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.mobile-popup-content .wp-block-column {
    flex: 1;
    min-width: 200px;
}
