/* ==========================================
   MODAL OVERLAY
========================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
}

/* ==========================================
   MODAL CONTENT - LAYOUT DOS COLUMNAS
========================================== */
.modal-content {
    background: var(--white);
    border-radius: 1.5rem;
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* ==========================================
   MODAL CLOSE BUTTON
========================================== */
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text);
    transition: all 0.3s ease;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-close:hover {
    background: var(--secondary);
    color: var(--white);
    transform: rotate(90deg) scale(1.1);
}

/* ==========================================
   MODAL IMAGEN - COLUMNA IZQUIERDA
========================================== */
.modal-image-section {
    flex: 0 0 40%;
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 50%, #FED7AA 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    position: relative;
    overflow: hidden;
}

.modal-image-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1) 0%, transparent 60%);
}

.modal-product-image {
    width: 200px;
    height: 200px;
    border-radius: 24px;
    object-fit: cover;
    box-shadow: 0 20px 50px rgba(220, 38, 38, 0.3);
    position: relative;
    z-index: 1;
    border: 4px solid rgba(255, 255, 255, 0.5);
}

.modal-icon-large {
    width: 140px;
    height: 140px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 50px rgba(220, 38, 38, 0.3);
    position: relative;
    z-index: 1;
}

.modal-icon-large i {
    font-size: 4rem;
    color: var(--secondary);
}

.modal-image-title {
    margin-top: 1.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary-dark);
    text-align: center;
    position: relative;
    z-index: 1;
}

.modal-variant-badge {
    margin-top: 0.5rem;
    background: var(--secondary);
    color: white;
    padding: 0.35rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* ==========================================
   MODAL INFO - COLUMNA DERECHA
========================================== */
.modal-info-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.modal-scrollable-content {
    overflow-y: auto;
    padding: 2rem;
    flex: 1;
}

/* Header compacto */
.modal-header-compact {
    padding: 0 0 1.5rem 0;
    border-bottom: 2px solid #FEE2E2;
    margin-bottom: 1.5rem;
}

.modal-title-large {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.modal-subtitle-large {
    font-size: 1rem;
    color: var(--text-light);
    line-height: 1.5;
}

/* Secciones de información */
.modal-details-grid {
    display: grid;
    gap: 1.25rem;
}

.modal-detail-block {
    background: #FAFBFC;
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 1.25rem;
    transition: all 0.3s ease;
}

.modal-detail-block:hover {
    border-color: var(--secondary);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.08);
}

.modal-detail-block h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-detail-block h3 i {
    color: var(--secondary);
    font-size: 1rem;
}

.modal-detail-block p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Lista de características */
.modal-features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.modal-features-list li {
    color: var(--text);
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    border-bottom: 1px solid #F3F4F6;
    font-size: 0.9rem;
    font-weight: 500;
}

.modal-features-list li:last-child {
    border-bottom: none;
}

.modal-features-list li::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0;
    color: var(--secondary);
    font-size: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
}

/* ==========================================
   MODAL FOOTER
========================================== */
.modal-footer-compact {
    padding: 1.25rem 2rem;
    display: flex;
    gap: 1rem;
    background: var(--white);
    border-top: 1px solid var(--border);
}

.modal-btn-whatsapp {
    flex: 1;
    background: linear-gradient(135deg, var(--whatsapp) 0%, #20BA5A 100%);
    color: var(--white);
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    text-align: center;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
    font-size: 0.95rem;
}

.modal-btn-whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4);
}

.modal-btn-secondary {
    flex: 0 0 auto;
    background: transparent;
    color: var(--text-light);
    padding: 0.875rem 1.5rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.modal-btn-secondary:hover {
    background: var(--bg-gray);
    border-color: var(--text-light);
    color: var(--text);
}

/* ==========================================
   SCROLLBAR
========================================== */
.modal-scrollable-content::-webkit-scrollbar {
    width: 6px;
}

.modal-scrollable-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-scrollable-content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

.modal-scrollable-content::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* ==========================================
   RESPONSIVE - TABLET
========================================== */
@media (max-width: 900px) {
    .modal-content {
        flex-direction: column;
        max-width: 600px;
        max-height: 90vh;
    }

    .modal-image-section {
        flex: none;
        padding: 2rem 1.5rem;
        min-height: 200px;
    }

    .modal-product-image {
        width: 140px;
        height: 140px;
    }

    .modal-icon-large {
        width: 100px;
        height: 100px;
    }

    .modal-icon-large i {
        font-size: 2.5rem;
    }

    .modal-image-title {
        font-size: 1.25rem;
        margin-top: 1rem;
    }

    .modal-scrollable-content {
        padding: 1.5rem;
    }

    .modal-header-compact {
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }

    .modal-title-large {
        font-size: 1.5rem;
    }
}

/* ==========================================
   RESPONSIVE - MÓVIL
========================================== */
@media (max-width: 480px) {
    .modal-overlay {
        padding: 1rem;
        align-items: center;
    }

    .modal-content {
        border-radius: 1.25rem;
        max-height: calc(100vh - 2rem);
        max-width: calc(100vw - 2rem);
        transform: scale(0.95);
        transition: transform 0.3s ease, opacity 0.3s ease;
        opacity: 0;
    }
    
    .modal-overlay.active .modal-content {
        transform: scale(1);
        opacity: 1;
    }

    .modal-image-section {
        padding: 1rem 1rem 0.75rem;
        min-height: auto;
        flex-direction: row;
        gap: 0.75rem;
        justify-content: flex-start;
        align-items: center;
    }

    .modal-product-image {
        width: 80px;
        height: 80px;
        border-radius: 12px;
        border-width: 2px;
    }

    .modal-icon-large {
        width: 60px;
        height: 60px;
        border-radius: 12px;
    }

    .modal-icon-large i {
        font-size: 1.5rem;
    }

    .modal-image-title {
        font-size: 0.9rem;
        margin-top: 0;
        text-align: left;
        flex: 1;
    }

    .modal-variant-badge {
        margin-top: 0.25rem;
        padding: 0.2rem 0.6rem;
        font-size: 0.7rem;
        display: inline-block;
    }

    .modal-scrollable-content {
        padding: 1rem;
    }

    .modal-header-compact {
        padding-bottom: 0.75rem;
        margin-bottom: 0.75rem;
    }

    .modal-title-large {
        font-size: 1.1rem;
        margin-bottom: 0.35rem;
    }

    .modal-subtitle-large {
        font-size: 0.8rem;
    }

    .modal-detail-block {
        padding: 0.75rem;
        border-radius: 0.75rem;
    }

    .modal-detail-block h3 {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
    }

    .modal-detail-block h3 i {
        font-size: 0.85rem;
    }

    .modal-detail-block p {
        font-size: 0.8rem;
        line-height: 1.5;
    }

    .modal-features-list li {
        font-size: 0.8rem;
        padding: 0.35rem 0;
        padding-left: 1.25rem;
    }

    .modal-footer-compact {
        padding: 0.75rem 1rem;
        flex-direction: row;
        gap: 0.5rem;
    }

    .modal-btn-whatsapp {
        flex: 1;
        padding: 0.6rem 0.75rem;
        font-size: 0.8rem;
        border-radius: 10px;
    }

    .modal-btn-secondary {
        flex: 0 0 auto;
        padding: 0.6rem 0.75rem;
        font-size: 0.8rem;
        border-radius: 10px;
    }

    .modal-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
}

/* ==========================================
   NOTIFICACIÓN TOAST PERSONALIZADA
========================================== */
.toast-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.toast-overlay.active {
    opacity: 1;
}

.toast-box {
    background: var(--white);
    border-radius: 1rem;
    max-width: 400px;
    width: 100%;
    padding: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    text-align: center;
}

.toast-overlay.active .toast-box {
    transform: scale(1);
}

.toast-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.toast-title i {
    font-size: 1.25rem;
}

.toast-message {
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.toast-btn {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
    color: var(--white);
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.toast-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

@media (max-width: 480px) {
    .toast-box {
        padding: 1.25rem;
        margin: 1rem;
    }
    
    .toast-title {
        font-size: 1rem;
    }
    
    .toast-message {
        font-size: 0.9rem;
    }
}