/* 
    Design System: Superación Personal & Constelaciones 
    Colores: Arena (Base), Verde Bosque (Acento), Terracota (CTA)
*/

:root {
    /* Color Palette */
    --color-base: #FDFBF7;        /* Warm Cream/Sand */
    --color-text: #2C3322;        /* Deep Forest Green for text */
    --color-primary: #1B2D2A;     /* Dark Forest Green for depth */
    --color-secondary: #E5E0D5;   /* Subtle divider/background depth */
    --color-cta: #BC6C25;         /* Soft Terracota/Earth for actions */
    --color-cta-hover: #9E521E;
    --color-white: #FFFFFF;
    
    /* Typography */
    --font-serif: 'Cormorant Garamond', serif;
    --font-sans: 'Inter', sans-serif;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2.5rem;
    --space-lg: 4rem;
    --space-xl: 8rem;
    
    /* Shadows & Effects */
    --shadow-soft: 0 10px 30px rgba(0,0,0,0.05);
    --glass: rgba(253, 251, 247, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    /* Firefox */
    scrollbar-color: var(--color-cta) transparent;
    scrollbar-width: auto;
}

/* Chrome, Edge, and Safari */
::-webkit-scrollbar {
    width: 10px; /* Ancho que se conserva similar al estándar */
}

::-webkit-scrollbar-track {
    background: transparent; /* Se conserva el fondo */
}

::-webkit-scrollbar-thumb {
    background-color: var(--color-cta);
    border-radius: 10px;
    border: 2px solid var(--color-base); /* Añade un pequeño margen para que se vea mejor */
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--color-cta-hover);
}

body {
    background-color: var(--color-base);
    color: var(--color-text);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
}

a, a:visited {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

h1, h2, h3, h4 {
    font-family: var(--font-serif);
    font-weight: 600;
    line-height: 1.2;
}

/* --- Layout Components --- */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

section {
    padding: var(--space-xl) 0;
}

/* --- Navigation --- */

nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--glass);
    backdrop-filter: blur(10px);
    z-index: 1000;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--color-primary);
}

.nav-links {
    display: flex;
    gap: var(--space-md);
    list-style: none;
}

.nav-links li a:hover {
    color: var(--color-cta);
}

.footer-youtube {
    opacity: 0.8;
    transition: all 0.3s ease;
}

.footer-youtube:hover {
    color: var(--color-cta) !important;
    transform: scale(1.1);
    opacity: 1;
}

/* Newsletter Section */
.newsletter-cta {
    background: var(--color-primary);
    padding: var(--space-lg) 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.newsletter-cta::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(circle at center, rgba(188, 108, 37, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.newsletter-cta h2 {
    color: var(--color-base);
    font-family: var(--font-serif);
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
}

.newsletter-cta p {
    color: var(--color-base);
    opacity: 0.8;
    max-width: 600px;
    margin: 0 auto var(--space-md);
    font-size: 1.1rem;
}

/* Newsletter Modal Styles */
.newsletter-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(13, 18, 12, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    backdrop-filter: blur(10px);
    padding: 20px;
    animation: fadeIn 0.4s ease-out;
}

.newsletter-modal-content {
    background: var(--color-base);
    width: 100%;
    max-width: 500px;
    padding: var(--space-lg);
    border-radius: 12px;
    position: relative;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
    color: var(--color-text);
    border-top: 5px solid var(--color-cta);
}

.newsletter-modal-content h3 {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--color-primary);
    margin-bottom: var(--space-sm);
    text-align: center;
}

.newsletter-modal-content .modal-text {
    margin-bottom: var(--space-md);
    line-height: 1.6;
    font-size: 1rem;
    color: var(--color-text);
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-primary);
}

.form-group input {
    padding: 0.8rem 1rem;
    border: 1px solid var(--color-secondary);
    border-radius: 6px;
    background: white;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: var(--color-cta);
}

.toggle-group {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    cursor: pointer;
}

.toggle-input {
    appearance: none;
    width: 40px;
    height: 20px;
    background: #ccc;
    border-radius: 20px;
    position: relative;
    outline: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.3s;
}

.toggle-input:checked {
    background: var(--color-cta);
}

.toggle-input::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.toggle-input:checked::before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 0.85rem;
    color: var(--color-text);
    line-height: 1.4;
    user-select: none;
}

.modal-close-btn {
    position: absolute;
    top: 1rem; right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--color-primary);
    cursor: pointer;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.nav-links a:hover {
    color: var(--color-cta);
}

/* --- Buttons --- */

.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--color-cta);
    color: var(--color-white);
    box-shadow: 0 4px 15px rgba(188, 108, 37, 0.3);
}

.btn-primary:hover {
    background-color: var(--color-cta-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(188, 108, 37, 0.4);
}

/* --- Hero Section --- */

.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: var(--color-secondary);
}

.hero-video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.4;
    z-index: 1;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, var(--color-base) 30%, transparent);
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 700px;
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 5rem);
    margin-bottom: var(--space-md);
    color: var(--color-primary);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: var(--space-lg);
    color: rgba(44, 51, 34, 0.8);
    max-width: 500px;
}

/* --- Content Sections --- */

.section-title {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.section-title h2 {
    font-size: 3rem;
    color: var(--color-primary);
}

.section-title p {
    color: var(--color-cta);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: var(--space-sm);
}

.grid-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1-fr));
    gap: var(--space-lg);
}

.feature-card {
    background: var(--color-white);
    padding: var(--space-lg);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-10px);
}

.feature-card h3 {
    margin-bottom: var(--space-sm);
    color: var(--color-primary);
}

/* --- Mobile Hamburger & Go To Top --- */

.hamburger {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
    z-index: 1001;
}

.hamburger svg {
    width: 32px;
    height: 32px;
    fill: var(--color-primary);
}

.go-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--color-white);
    box-shadow: var(--shadow-soft);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.go-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.go-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.go-to-top svg.progress-ring {
    position: absolute;
    top: 5px; left: 5px;
    width: 50px; height: 50px;
    transform: rotate(-90deg);
}

.go-to-top svg.progress-ring circle {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
}

.go-to-top svg.progress-ring circle.progress-circle {
    stroke: var(--color-cta);
    transition: stroke-dashoffset 0.1s linear;
}

.go-to-top svg.arrow-up {
    width: 24px;
    height: 24px;
    fill: var(--color-primary);
    z-index: 2;
}

/* --- Responsive --- */

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 350px;
        height: 100vh;
        background: var(--color-base);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 2rem;
        box-shadow: -10px 0 30px rgba(0,0,0,0.05);
        transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
        z-index: 1000;
        gap: 2rem;
    }
    
    .nav-links.active {
        right: 0;
    }

    .nav-links li a {
        font-size: 1.2rem;
    }

    .hero {
        text-align: center;
        padding-top: var(--space-xl);
    }
    
    .hero-content {
        margin: 0 auto;
    }

    /* Prevent spacing overflow on mobile */
    :root {
        --space-md: 1.5rem;
        --space-lg: 2.5rem;
        --space-xl: 3.5rem;
    }

    .container {
        padding: 0 var(--space-sm);
    }
    
    .grid-features {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .section-title h2 {
        font-size: 2.2rem;
    }
    
    .hero h1 {
        font-size: 2.8rem;
    }

    /* Newsletter Modal Mobile Adjustments */
    .newsletter-modal-content {
        padding: 1rem 0.8rem;
        max-height: 98vh;
        overflow-y: auto;
    }

    .newsletter-modal-content h3 {
        font-size: 1.4rem;
        margin-bottom: 0.3rem;
    }

    .newsletter-modal-content .modal-text {
        font-size: 0.78rem;
        margin-bottom: 0.6rem;
        line-height: 1.35;
    }

    .newsletter-modal-content .modal-text br {
        display: none;
    }

    .newsletter-modal-content .modal-text br + br {
        display: block;
        content: "";
        margin-bottom: 0.4rem;
    }

    .newsletter-form {
        gap: 0.6rem;
    }

    .form-group {
        gap: 0.1rem;
    }

    .form-group label {
        font-size: 0.8rem;
    }

    .form-group input {
        padding: 0.5rem 0.7rem;
        font-size: 0.85rem;
    }

    .toggle-label {
        font-size: 0.72rem;
    }

    .newsletter-cta h2 {
        font-size: 1.8rem;
    }

    /* Additional safety for horizontal overflow on mobile */
    body {
        position: relative;
        width: 100%;
        overflow-x: hidden !important;
    }

    .container {
        padding: 0 var(--space-sm);
        overflow-x: hidden; /* Local safety */
    }
}

/* Global Overflow Fix class for wrappers */
.overflow-fix {
    width: 100%;
    overflow-x: hidden;
    position: relative;
}
