/* BASE STYLES & TOKENS */
:root {
    --primary-red: #da291c;
    --primary-red-hover: #b92015;
    --accent-green: #008c4a;
    --bg-light: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --white: #ffffff;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --transition: all 0.3s ease;
}

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

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

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* BUTTONS */
.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-red);
    color: var(--white);
    box-shadow: 0 4px 6px rgba(218, 41, 28, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-red-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(218, 41, 28, 0.3);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-red);
    border: 2px solid var(--primary-red);
}

.btn-outline:hover {
    background-color: var(--primary-red);
    color: var(--white);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-full {
    width: 100%;
}

/* NAVBAR (Glassmorphism) */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.logo-img {
    height: 60px;
    border-radius: 4px;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.logo-img-footer {
    height: 60px;
    border-radius: 4px;
    object-fit: contain;
}

.footer-logo-wrapper {
    background-color: var(--white);
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
}

.logo-ccoo {
    background-color: var(--primary-red);
    color: var(--white);
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
    display: inline-flex;
    align-items: center;
}

.logo-text {
    font-weight: 600;
    color: var(--text-main);
    max-width: 140px;
    line-height: 1.2;
    font-size: 0.95rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    font-weight: 500;
    color: var(--text-main);
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-red);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--primary-red);
    transition: var(--transition);
}

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

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
}

/* SPA LOGIC VIEW */
.page-section {
    display: none;
    opacity: 0;
    animation: fadeIn 0.4s ease forwards;
    padding-top: 80px; /* offset for fixed navbar */
    min-height: calc(100vh - 150px);
}

.page-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* HERO SECTION */
.hero {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: var(--white);
    text-align: center;
    padding: 6rem 2rem;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(218,41,28,0.15) 0%, rgba(0,0,0,0) 70%);
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.badge {
    background-color: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #cbd5e1;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: -3rem auto 4rem auto;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
}

.feature-card {
    background: var(--white);
    padding: 2.5rem 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary-red);
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.feature-card p {
    color: var(--text-muted);
}

/* NOTICIAS */
.section-header {
    text-align: center;
    max-width: 600px;
    margin: 4rem auto 3rem auto;
    padding: 0 1rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto 5rem auto;
    padding: 0 2rem;
}

.news-card {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
}

.news-image {
    height: 200px;
    background-color: #cbd5e1;
    background-size: cover;
    background-position: center;
}

.news-bg-1 { background-image: linear-gradient(rgba(0,0,0,0.2), rgba(0,0,0,0.2)), url('https://images.unsplash.com/photo-1544620347-c4fd4a3d5957?auto=format&fit=crop&q=80&w=800'); }
.news-bg-2 { background-image: linear-gradient(rgba(0,0,0,0.2), rgba(0,0,0,0.2)), url('https://images.unsplash.com/photo-1574510708383-7d8487b7a2d4?auto=format&fit=crop&q=80&w=800'); }
.news-bg-3 { background-image: linear-gradient(rgba(0,0,0,0.2), rgba(0,0,0,0.2)), url('https://images.unsplash.com/photo-1582213782179-e0d53f98f2ca?auto=format&fit=crop&q=80&w=800'); }

.news-content {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-date {
    font-size: 0.85rem;
    color: var(--accent-green);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.news-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.news-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex: 1;
}

.news-link {
    color: var(--primary-red);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.news-link:hover {
    gap: 0.8rem;
}

/* AFILIADOS */
.affiliate-hero {
    background-color: var(--primary-red);
    color: var(--white);
    padding: 5rem 2rem;
    text-align: center;
}

.affiliate-hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: -3rem auto 4rem auto;
    padding: 0 2rem;
}

.benefit-item {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.benefit-icon {
    font-size: 1.8rem;
    color: var(--accent-green);
}

.benefit-item h4 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.benefit-item p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.join-banner {
    max-width: 600px;
    margin: 4rem auto;
    padding: 3rem 2rem;
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.join-banner h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.join-banner p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.affiliate-form .form-group {
    margin-bottom: 1rem;
}

.affiliate-form input {
    width: 100%;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.affiliate-form input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(218, 41, 28, 0.1);
}

/* CONTACTO */
.contact-container {
    max-width: 1000px;
    margin: 4rem auto 6rem auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-info h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.contact-info p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.contact-list {
    list-style: none;
    margin-bottom: 2rem;
}

.contact-list li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contact-list i {
    font-size: 1.5rem;
    color: var(--primary-red);
    margin-top: 0.2rem;
}

.contact-list strong {
    display: block;
    color: var(--text-main);
    margin-bottom: 0.2rem;
}

.contact-list span {
    color: var(--text-muted);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #e2e8f0;
    color: var(--text-main);
    border-radius: 50%;
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--primary-red);
    color: var(--white);
    transform: translateY(-3px);
}

.contact-form {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
}

.contact-form .form-group {
    margin-bottom: 1.5rem;
}

.contact-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(218, 41, 28, 0.1);
}

/* FOOTER */
footer {
    background-color: #0f172a;
    color: #cbd5e1;
    padding: 4rem 2rem 2rem 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-brand {
    max-width: 400px;
}

.footer-brand .logo-text {
    color: var(--white);
}

.footer-brand p {
    margin-top: 1rem;
    font-size: 0.95rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-links p {
    color: var(--white);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.footer-links a:hover {
    color: var(--white);
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .contact-container {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        padding: 2rem;
        gap: 1.5rem;
        box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: clip-path 0.3s ease-in-out;
    }
    
    .nav-menu.show {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }

    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .features {
        margin-top: -1rem;
    }
}
