/**
 * Styles pour MetFi Modal
 */

/* Overlay du modal */
.metfi-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.metfi-modal-overlay.active {
    display: flex;
}

/* Container du modal */
.metfi-modal-container {
    background: #fff;
    border-radius: 8px;
    max-width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: metfiModalIn 0.3s ease-out;
}

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

/* Header du modal */
.metfi-modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metfi-modal-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.metfi-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.metfi-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* Body du modal */
.metfi-modal-body {
    padding: 30px;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

/* Loader */
.metfi-modal-loader {
    text-align: center;
    padding: 60px 20px;
}

.metfi-modal-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #333;
    border-radius: 50%;
    animation: metfiSpin 1s linear infinite;
}

@keyframes metfiSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.metfi-modal-loading-text {
    margin-top: 20px;
    color: #666;
    font-size: 16px;
}

/* Contenu spécifique aux produits */
.metfi-modal-product-image {
    text-align: center;
    margin-bottom: 20px;
}

.metfi-modal-product-image img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

.metfi-modal-product-price {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
}

.metfi-modal-product-price del {
    font-size: 18px;
    color: #999;
    margin-right: 10px;
}

.metfi-modal-product-price ins {
    text-decoration: none;
    color: #e74c3c;
}

.metfi-modal-product-short-description {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
}

.metfi-modal-main-content {
    font-size: 15px;
    line-height: 1.8;
    color: #555;
}

.metfi-modal-main-content h1,
.metfi-modal-main-content h2,
.metfi-modal-main-content h3,
.metfi-modal-main-content h4,
.metfi-modal-main-content h5,
.metfi-modal-main-content h6 {
    color: #333;
    margin-top: 25px;
    margin-bottom: 15px;
}

.metfi-modal-main-content p {
    margin-bottom: 15px;
}

.metfi-modal-main-content img {
    max-width: 100%;
    height: auto;
    margin: 15px 0;
}

/* Iframe dans le modal */
.metfi-modal-iframe {
    width: 100%;
    min-height: 400px;
    border: none;
    background: #fff;
}

.metfi-modal-iframe-notice {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

/* Image des articles */
.metfi-modal-post-thumbnail {
    margin-bottom: 20px;
    text-align: center;
}

.metfi-modal-post-thumbnail img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

/* Liens avec modal activé */
a[data-metfi-modal="true"] {
    cursor: pointer;
    position: relative;
}

a[data-metfi-modal="true"]::after {
    content: "⧉";
    margin-left: 5px;
    font-size: 0.8em;
    opacity: 0.6;
    vertical-align: super;
}

/* Responsive */
@media (max-width: 768px) {
    .metfi-modal-overlay {
        padding: 10px;
    }
    
    .metfi-modal-container {
        max-height: 100vh;
        border-radius: 0;
    }
    
    .metfi-modal-header {
        padding: 15px 20px;
    }
    
    .metfi-modal-title {
        font-size: 20px;
    }
    
    .metfi-modal-body {
        padding: 20px;
        max-height: calc(100vh - 120px);
    }
    
    .metfi-modal-product-price {
        font-size: 20px;
    }
    
    .metfi-modal-view-full {
        width: 100%;
        box-sizing: border-box;
    }
}