/* Estilos base */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* Fuentes personalizadas */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* Configuración de capa base */
@layer base {
    html { 
        scroll-behavior: smooth; 
    }
    
    body { 
        font-family: 'Poppins', sans-serif; 
        @apply bg-light text-secondary antialiased; 
    }
    
    h1, h2, h3, h4, h5, h6 { 
        @apply font-bold text-dark; 
    }
}

/* Estilos para el popup de descuento */
#descuentoPopup {
    transition: opacity 0.3s ease-in-out;
}

#descuentoPopup > div {
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

#descuentoPopup > div.scale-100 {
    transform: scale(1);
    opacity: 1;
}

#descuentoPopup > div.scale-95 {
    transform: scale(0.95);
    opacity: 0;
}

/* Componentes personalizados */
@layer components {
    /* Enlaces de navegación movidos a components.css */

    /* Botones */
    .btn-primary {
        @apply bg-primary hover:bg-primary-dark text-white font-bold py-3 px-6 rounded-lg transition-colors duration-300;
    }
    
    .btn-accent {
        @apply bg-accent hover:bg-yellow-500 text-secondary font-bold py-3 px-6 rounded-lg transition-colors duration-300;
    }
    
    /* Tarjetas */
    .card {
        @apply bg-white p-6 rounded-xl shadow-card hover:shadow-card-hover transition-shadow duration-300;
    }
    
    /* Formularios */
    .form-input {
        @apply w-full px-4 py-3 border border-slate-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-primary focus:outline-none transition;
    }
    
    .form-textarea {
        @apply w-full px-4 py-3 border border-slate-300 rounded-lg focus:ring-2 focus:ring-primary focus:border-primary focus:outline-none transition;
    }
}

/* Utilidades personalizadas */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Estilo del Acordeón para FAQ - Mejorado */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    will-change: max-height;
}

.faq-icon {
    transition: transform 0.3s ease-in-out;
    margin-left: 1rem;
    flex-shrink: 0;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    text-align: left;
    padding: 1.25rem 1.25rem;
    font-size: 1.125rem;
    line-height: 1.5;
    font-weight: 600;
    color: #374151;
    background-color: #fff;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.faq-question:hover {
    background-color: #f9fafb;
}

.faq-question:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Clase para cuando una pregunta está abierta */
.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(180deg);
}

/* Contenedor de cada ítem del FAQ */
.faq-item {
    margin-bottom: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Contenido de la respuesta */
.faq-answer > div {
    padding: 0 1.25rem 1.25rem;
}

/* Efecto de pulso para botones */
.btn-pulse {
    position: relative;
    overflow: hidden;
}

.btn-pulse::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%, -50%);
    transform-origin: 50% 50%;
}

@keyframes pulse {
    0% {
        transform: scale(0.1, 0.1);
        opacity: 0;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

.btn-pulse:focus:not(:active)::after {
    animation: pulse 1s ease-out;
}
