/* 
 * DBF Popups - Estilos comerciales para el frontend
 * Autor: Marcelo Mendoza @enfermero-web Agencia Doblefoco
 * Fecha: Septiembre 2025
 * Diseño basado en la imagen de referencia de Café Haiti
 */

/* Overlay de fondo con degradado sutil */
.dbf-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: dbf-fade-in 0.3s ease-out;
}

/* Contenedor del popup */
.dbf-popup-container {
    position: relative;
    max-width: 400px;
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: dbf-slide-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: "DM Sans", Arial, sans-serif;
}

/* Asegurar que todos los elementos dentro del popup usen DM Sans */
.dbf-popup-container * {
    font-family: "DM Sans", Arial, sans-serif;
}

/* Botón de cerrar */
.dbf-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #333;
    z-index: 10;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-weight: bold;
}

.dbf-popup-close:hover {
    background-color: #fff;
    color: #930101;
    transform: scale(1.1);
}

/* Sección superior con imagen y mensaje */
.dbf-popup-top-section {
    position: relative;
}

.dbf-popup-image {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.dbf-popup-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Overlay del mensaje sobre la imagen */
.dbf-popup-message-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 30px 20px;
    z-index: 2;
}

.dbf-popup-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0) 100%);
    z-index: 1;
}

.dbf-popup-main-message {
    position: relative;
    z-index: 3;
    color: white;
    font-size: 24px;
    font-weight: 400;
    text-align: center;
    line-height: 1.2;
    max-width: 90%;
    font-family: "DM Sans", Arial, sans-serif;
}

.dbf-popup-main-message p {
    margin: 0 0 8px 0;
    font-family: "DM Sans", Arial, sans-serif;
}

.dbf-popup-main-message strong {
    font-weight: 600;
    font-family: "DM Sans", Arial, sans-serif;
}

.dbf-popup-main-message em {
    font-style: italic;
    font-family: "DM Sans", Arial, sans-serif;
}

.dbf-popup-main-message a {
    color: white;
    text-decoration: underline;
    font-family: "DM Sans", Arial, sans-serif;
}

.dbf-popup-main-message a:hover {
    text-decoration: none;
}

/* Sección inferior roja */
.dbf-popup-bottom-section {
    background-color: #930101;
    color: white;
    padding: 20px;
    text-align: center;
    position: relative;
}

.dbf-popup-footer-message {
    font-size: 16px;
    font-weight: 400;
    margin: 0 0 15px 0;
    line-height: 1.4;
    font-family: "DM Sans", Arial, sans-serif;
}

.dbf-popup-footer-message p {
    margin: 0 0 8px 0;
    font-family: "DM Sans", Arial, sans-serif;
}

.dbf-popup-footer-message p:last-child {
    margin-bottom: 0;
}

.dbf-popup-footer-message strong {
    font-weight: 600;
    font-family: "DM Sans", Arial, sans-serif;
}

.dbf-popup-footer-message em {
    font-style: italic;
    font-family: "DM Sans", Arial, sans-serif;
}

.dbf-popup-footer-message a {
    color: white;
    text-decoration: underline;
    font-family: "DM Sans", Arial, sans-serif;
}

.dbf-popup-footer-message a:hover {
    text-decoration: none;
}

.dbf-popup-actions {
    margin-top: 15px;
}

.dbf-popup-button {
    display: inline-block;
    padding: 12px 30px;
    background-color: white;
    color: #000;
    text-decoration: none;
    font-weight: 400;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: 2px solid #000;
    cursor: pointer;
    font-family: "DM Sans", Arial, sans-serif;
}

.dbf-popup-button:hover {
    background-color: #000;
    color: white;
    border: 2px solid #000;
    text-decoration: none;
}

/* Vista previa */
.dbf-popup-preview .dbf-popup-overlay {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.2) 100%);
}

.dbf-preview-label {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ff6b35;
    color: white;
    padding: 8px 16px;
    font-weight: bold;
    font-size: 11px;
    text-transform: uppercase;
    z-index: 10000;
    letter-spacing: 1px;
}

/* Animaciones */
@keyframes dbf-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes dbf-slide-in {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .dbf-popup-container {
        max-width: 90%;
        margin: 20px;
    }
    
    .dbf-popup-main-message {
        font-size: 20px;
        padding: 20px 15px;
    }
    
    .dbf-popup-footer-message {
        font-size: 14px;
    }
    
    .dbf-popup-button {
        padding: 10px 25px;
        font-size: 13px;
        width: 90%;
        max-width: 250px;
    }
    
    .dbf-popup-close {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .dbf-popup-container {
        max-width: 95%;
        margin: 10px;
    }
    
    .dbf-popup-main-message {
        font-size: 18px;
    }
    
    .dbf-popup-bottom-section {
        padding: 15px;
    }
}

/* Error */
.dbf-popup-error {
    padding: 20px;
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    text-align: center;
}

/* Estilos para imagen cuadrada/cover */
.dbf-popup-image-square {
    height: 300px; /* Altura fija para crear formato cuadrado */
    overflow: hidden;
}

.dbf-popup-image-square img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Recorta la imagen manteniendo proporciones */
    object-position: center; /* Centra la imagen */
}

/* Ajustes responsive para imagen cuadrada */
@media (max-width: 768px) {
    .dbf-popup-image-square {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .dbf-popup-image-square {
        height: 200px;
    }
}
