:root {
    scroll-behavior: smooth;
}

body {
    background-color: #0a0a0a;
    color: #f5f5f5;
    font-family: 'Montserrat', sans-serif;
    overflow-x: hidden;
}

.hero-bg {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.9)), 
                url('https://images.unsplash.com/photo-1534367507877-0edd93bd013b?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1920&q=80') no-repeat center center fixed;
    background-size: cover;
    background-attachment: fixed;
}

@media (max-width: 1024px) {
    .hero-bg {
        background-attachment: scroll;
    }
}

.ebook-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

.ebook-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

/* Botón de Payhip principal (dorado) */
.payhip-buy-button {
    background: linear-gradient(135deg, #d4af37, #b8860b) !important;
    border: none !important;
    border-radius: 0.5rem !important;
    padding: 0.75rem 1.5rem !important;
    font-weight: bold !important;
    font-family: 'Montserrat', sans-serif !important;
    color: #1a1a1a !important;
    text-decoration: none !important;
    display: inline-block !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    text-align: center !important;
    cursor: pointer !important;
}

.payhip-buy-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 12px rgba(212, 175, 55, 0.3) !important;
    color: #1a1a1a !important;
    background: linear-gradient(135deg, #b8860b, #d4af37) !important;
}




/* ========== MODAL STYLES ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease, backdrop-filter 0.4s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
    border: 2px solid #d4af37;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    transform: scale(0.9) translateY(50px);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease;
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #d4af37;
    color: #1a1a1a;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(212, 175, 55, 0.3);
    z-index: 10;
}

.close-modal:hover {
    background: #b8860b;
    transform: rotate(90deg);
    box-shadow: 0 6px 12px rgba(212, 175, 55, 0.4);
}

.feature-list {
    list-style: none;
    margin: 20px 0;
}

.feature-list li {
    margin-bottom: 15px;
    padding-left: 40px;
    position: relative;
    transition: transform 0.3s ease;
}

.feature-list li:hover {
    transform: translateX(5px);
}

.feature-list li:before {
    content: "✓";
    color: #d4af37;
    position: absolute;
    left: 0;
    font-weight: bold;
    font-size: 1.5rem;
    background: rgba(212, 175, 55, 0.1);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pricing-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 25px 0;
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #333;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.original-price {
    text-decoration: line-through;
    color: #e74c3c;
    font-size: 2rem;
    font-weight: 600;
    position: relative;
}

.original-price::after {
    content: '';
    position: absolute;
    bottom: 50%;
    left: -5%;
    width: 110%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #e74c3c, transparent);
    transform: rotate(-15deg);
}

.discount-price {
    font-size: 3.5rem;
    font-weight: 800;
    color: #d4af37;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.5);
    background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
    padding: 15px 25px;
    border-radius: 12px;
    border: 2px solid #d4af37;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn-primary {
    background: linear-gradient(45deg, #d4af37, #b8860b);
    color: #1a1a1a;
    font-weight: 700;
    padding: 16px 32px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(212, 175, 55, 0.5);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-outline {
    background: transparent;
    color: #d4af37;
    border: 2px solid #d4af37;
    font-weight: 600;
    padding: 14px 28px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-outline:hover {
    background: rgba(212, 175, 55, 0.1);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.btn-outline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #d4af37;
    z-index: -1;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease;
}

.btn-outline:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.btn-outline:hover {
    color: #1a1a1a;
}

.modal-header {
    position: relative;
    padding-bottom: 20px;
    margin-bottom: 30px;
    border-bottom: 2px solid #333;
}

.modal-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100px;
    height: 2px;
    background: #d4af37;
}

.modal-badge {
    position: absolute;
    top: -15px;
    right: -15px;
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    z-index: 10;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}

.guarantee-section {
    background: linear-gradient(145deg, #1a1a1a, #2a2a2a);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #333;
    margin-top: 30px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Efectos de scroll personalizados */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #1a1a1a;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #d4af37;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #b8860b;
}

/* Responsive para modales */
@media (max-width: 768px) {
    .modal-content {
        padding: 25px;
        width: 95%;
    }
    
    .pricing-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .original-price {
        font-size: 1.5rem;
    }
    
    .discount-price {
        font-size: 2.5rem;
    }
    
    .feature-list li {
        padding-left: 35px;
    }
    
    .modal-badge {
        top: -10px;
        right: -10px;
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

.value-card {
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.value-card:hover {
    border-color: #d4af37;
    transform: scale(1.03);
}

.faq-item {
    border-bottom: 1px solid #3a3a3a;
}

.faq-question {
    cursor: pointer;
    transition: color 0.3s ease;
}

.faq-question:hover {   
    color: #d4af37;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.contact-input {
    background-color: #1a1a1a;
    border: 1px solid #3a3a3a;
    transition: border-color 0.3s ease;
}

.contact-input:focus {
    border-color: #d4af37;
    outline: none;
}

.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: #d4af37;
    transition: width 0.3s ease;
}

.nav-link:hover:after {
    width: 100%;
}

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
    margin: 4rem 0;
}

/* Cookie banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(26, 26, 26, 0.95);
    padding: 20px;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform 0.5s ease;
    backdrop-filter: blur(10px);
}

.cookie-banner.show {
    transform: translateY(0);
}

/* Mobile menu */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 0;
    background: #1a1a1a;
    z-index: 100;
    overflow-x: hidden;
    transition: width 0.3s ease;
}

.mobile-menu.open {
    width: 280px;
}

/* Animation for scroll reveal */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Ebook pricing styles */
.pricing-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
}

.original-price {
    text-decoration: line-through;
    color: #e74c3c;
    font-size: 18px;
    font-weight: 600;
}

.discount-price {
    font-size: 28px;
    font-weight: 800;
    color: #d4af37;
}

.countdown-badge {
    background: rgba(231, 76, 60, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    text-align: center;
    margin: 10px 0;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.countdown-timer {
    font-size: 16px;
    color: #ff9f43;
    font-weight: 700;
    margin-top: 3px;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .hero-bg h2 {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .section-divider {
        margin: 2rem 0;
    }
    
    #articulos .grid,
    #ebooks .grid {
        grid-template-columns: 1fr;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    
    .cookie-banner {
        padding: 15px;
    }
    
    .pricing-container {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 640px) {
    header .container {
        padding: 0.75rem 1rem;
    }
    
    .hero-bg {
        padding-top: 5rem;
    }
    
    .hero-bg h2 {
        font-size: 2rem;
    }
    
    .btn-primary {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    #articulos .grid,
    #ebooks .grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* ========== FIXES CRÍTICOS PARA MÓVIL ========== */

/* Fix para containers en móvil */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        max-width: 100% !important;
    }
    
    /* Hero section fixes */
    #inicio h2 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
        padding: 0 0.5rem;
    }
    
    #inicio p {
        font-size: 1rem !important;
        padding: 0 0.5rem;
    }
    
    /* E-book cards fixes */
    .ebook-card {
        margin: 0 0.25rem;
        padding: 1rem !important;
    }
    
    .pricing-container {
        flex-direction: column !important;
        gap: 0.5rem !important;
        text-align: center;
    }
    
    /* Button fixes */
    .btn-primary {
        width: 100% !important;
        text-align: center;
        padding: 1rem 1.5rem !important;
        margin: 0.5rem 0;
    }
    
    /* Grid fixes */
    .grid {
        gap: 1rem !important;
    }
    
    /* Text size fixes */
    .text-4xl {
        font-size: 1.875rem !important;
    }
    
    .text-3xl {
        font-size: 1.5rem !important;
    }
    
    .text-2xl {
        font-size: 1.25rem !important;
    }
    
    /* Navigation fixes */
    .mobile-menu {
        width: 100vw !important;
    }
    
    /* Force full width on mobile */
    .w-full-mobile {
        width: 100% !important;
    }
}

/* Fix específico para elementos que se salen de la pantalla */
@media (max-width: 640px) {
    * {
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }
    
    body {
        overflow-x: hidden !important;
    }
    
    /* Header fixes */
    header .container {
        padding: 0.5rem 1rem !important;
    }
    
    /* Hero section emergency fixes */
    .hero-bg {
        padding: 4rem 0.5rem !important;
    }
    
    .hero-bg h2 {
        font-size: 1.8rem !important;
        word-wrap: break-word !important;
    }
    
    /* E-book grid emergency fix */
    #ebooks .grid {
        grid-template-columns: 1fr !important;
        margin: 0 0.25rem !important;
    }
    
    /* Button container fixes */
    .flex.gap-2, .flex.gap-3 {
        flex-direction: column !important;
    }
    
    .flex.gap-2 a, .flex.gap-3 a {
        width: 100% !important;
        margin: 0.25rem 0 !important;
    }
}

/* Fix para elementos flex en móvil */
@media (max-width: 768px) {
    .flex:not(.flex-col) {
        flex-direction: column !important;
    }
    
    .space-x-4, .space-x-8 {
        gap: 1rem !important;
    }
}

/* Asegurar que todo se vea bien en móvil */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}
}