/* ===== VARIABLES ===== */
:root {
    --primary: #223F33;
    --primary-dark: #1A2F27;
    --secondary: #C1B9A4;
    --accent: #4B6249;
    --neutral: #8A938A;
    --white: #FFFFFF;
    --offwhite: #F8F9FA;
    --black: #1A1E1E;
    --shadow: 0 20px 40px -10px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--black);
    line-height: 1.6;
    overflow-x: hidden;
}

body.no-scroll {
    overflow: hidden;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
}

/* ===== PRELOADER ===== */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid transparent;
    border-top-color: var(--secondary);
    border-right-color: var(--secondary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== HEADER ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: transparent;
    z-index: 1000;
    padding: 1.5rem 0;
    transition: var(--transition);
}

.header.scrolled {
    background: var(--white);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    padding: 1rem 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo img {
    height: 45px;
    filter: brightness(0) invert(1);
    transition: var(--transition);
    position: relative;
    z-index: 1002;
}

.header.scrolled .logo img {
    filter: none;
}

/* Botón hamburguesa */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 1002;
    padding: 0.5rem;
    transition: var(--transition);
    color: var(--white);
}

.header.scrolled .menu-toggle {
    color: var(--primary);
}

.menu-toggle.active {
    color: var(--primary) !important;
}

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

.nav-list {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-link {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: var(--transition);
    position: relative;
    white-space: nowrap;
}

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

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

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

.header.scrolled .nav-link {
    color: var(--primary);
}

.header.scrolled .nav-link:hover,
.header.scrolled .nav-link.active {
    color: var(--accent);
}

.header.scrolled .nav-link::after {
    background: var(--accent);
}

.nav-actions {
    display: flex;
    align-items: center;
}

/* Responsive menú */
@media (max-width: 992px) {
    .nav-list {
        gap: 1rem;
    }
    
    .nav-link {
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 350px;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 6rem 2rem 2rem;
        transition: right 0.3s ease;
        box-shadow: -5px 0 20px rgba(0,0,0,0.1);
        z-index: 1001;
        gap: 2rem;
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-list {
        flex-direction: column;
        width: 100%;
        gap: 1.5rem;
    }
    
    .nav-link {
        color: var(--primary);
        font-size: 1.1rem;
        white-space: normal;
        display: block;
        width: 100%;
        padding: 0.5rem 0;
    }
    
    .nav-link::after {
        background: var(--accent);
    }
    
    .nav-actions {
        width: 100%;
        margin-top: 1rem;
    }
    
    .nav-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .nav-menu {
        width: 100%;
        max-width: none;
    }
}

/* ===== WHATSAPP FLOATING ===== */
.whatsapp-float {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #25D366;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: var(--shadow);
    z-index: 99;
    text-decoration: none;
    transition: var(--transition);
}

.whatsapp-float span {
    position: absolute;
    right: 70px;
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.whatsapp-float:hover {
    transform: scale(1.1);
}

.whatsapp-float:hover span {
    opacity: 1;
    visibility: visible;
    right: 80px;
}

@media (max-width: 768px) {
    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        bottom: 1.5rem;
        right: 1.5rem;
    }
    
    .whatsapp-float span {
        display: none;
    }
}

/* ===== HERO ===== */
.hero {
    min-height: 100vh;
    background-image: url('https://images.unsplash.com/photo-1589829545856-d10d557cf95f?auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    color: var(--white);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(34,63,51,0.95), rgba(26,31,39,0.9));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero-badge {
    display: inline-block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--secondary);
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--secondary);
    padding-bottom: 0.5rem;
}

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

.hero-title span {
    color: var(--secondary);
    font-weight: 300;
    display: block;
}

.hero-subtitle {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 600px;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: left;
}

.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    color: var(--secondary);
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .hero {
        min-height: auto;
        padding: 8rem 0 4rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    .hero-stats {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        gap: 0.5rem;
        width: 100%;
    }
    
    .stat-item {
        text-align: center;
        flex: 1;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-stats {
        gap: 0.25rem;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .stat-label {
        font-size: 0.65rem;
    }
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.9rem 2.2rem;
    border: none;
    border-radius: 2px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border: 1px solid var(--secondary);
}

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

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

.btn-small {
    padding: 0.7rem 1.5rem;
    font-size: 0.8rem;
}

.btn-secondary {
    background: var(--secondary);
    color: var(--primary);
}

.btn-secondary:hover {
    background: var(--neutral);
    color: var(--white);
}

@media (max-width: 768px) {
    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.85rem;
    }
    
    .btn-large {
        padding: 1rem 2rem;
        font-size: 0.9rem;
    }
}

/* ===== SECTION HEADER ===== */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: 2.8rem;
    color: var(--primary);
    font-weight: 800;
    line-height: 1.2;
}

.section-title span {
    color: var(--accent);
    font-weight: 300;
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.8rem;
    }
}

/* ===== SERVICES ===== */
.services {
    padding: 6rem 0;
    background: var(--white);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.service-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 2px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: var(--transition);
    border: 1px solid transparent;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow);
    border-color: var(--secondary);
}

.service-icon {
    width: 80px;
    height: 80px;
    background: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.service-icon i {
    font-size: 2rem;
    color: var(--primary);
}

.service-card h3 {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.service-card p {
    color: var(--neutral);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.service-link {
    background: none;
    border: none;
    color: var(--accent);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    text-transform: uppercase;
    transition: var(--transition);
}

.service-link:hover {
    color: var(--primary);
    gap: 1rem;
}

@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .services {
        padding: 4rem 0;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .service-card {
        padding: 2rem;
    }
}

/* ===== CARRUSELES ===== */
.carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.carousel-viewport {
    overflow: hidden;
    flex: 1;
}

.carousel-track {
    display: flex;
    gap: 2rem;
    transition: transform 0.5s ease;
}

.carousel-arrow {
    width: 45px;
    height: 45px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 10;
}

.carousel-arrow:hover:not(:disabled) {
    background: var(--accent);
    transform: scale(1.1);
}

.carousel-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .carousel-container {
        gap: 0.25rem;
    }
    
    .carousel-arrow {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .carousel-track {
        gap: 1rem;
    }
}

/* Tarjetas de temas legales */
.topic-card {
    min-width: 300px;
    width: 300px;
    height: 350px;
    background-size: cover;
    background-position: center;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
}

.topic-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(34,63,51,0.4), rgba(26,31,39,0.9));
    transition: var(--transition);
}

.topic-card:hover::before {
    background: linear-gradient(180deg, rgba(34,63,51,0.6), rgba(26,31,39,0.95));
}

.topic-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    color: var(--white);
    z-index: 2;
}

.topic-icon {
    font-size: 2rem;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.topic-card h3 {
    font-size: 1.2rem;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .topic-card {
        min-width: 260px;
        width: 260px;
        height: 320px;
    }
    
    .topic-content {
        padding: 1.5rem;
    }
    
    .topic-card h3 {
        font-size: 1rem;
    }
}

/* Tarjetas de testimonios */
.testimonial-card {
    min-width: 350px;
    width: 350px;
    background: var(--white);
    padding: 2.5rem;
    border-radius: 2px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.05);
    flex-shrink: 0;
    transition: var(--transition);
}

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

.testimonial-rating {
    color: #FFD700;
    margin-bottom: 1.5rem;
}

.testimonial-text {
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    font-style: italic;
}

.testimonial-author {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.2rem;
}

.testimonial-role {
    color: var(--neutral);
    font-size: 0.8rem;
    text-transform: uppercase;
}

@media (max-width: 768px) {
    .testimonial-card {
        min-width: 280px;
        width: 280px;
        padding: 1.8rem;
    }
    
    .testimonial-text {
        font-size: 0.95rem;
        line-height: 1.6;
    }
}

/* Tarjetas de Instagram */
.instagram-post {
    min-width: 350px;
    width: 350px;
    background: #FFF;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.instagram-post .instagram-media {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 450px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

@media (max-width: 768px) {
    .instagram-post {
        min-width: 300px;
        width: 300px;
    }
    
    .instagram-post .instagram-media {
        min-height: 400px !important;
    }
}

/* ===== SECTIONS BACKGROUND ===== */
.legal-topics,
.testimonials,
.instagram-section {
    padding: 6rem 0;
}

.legal-topics {
    background: var(--offwhite);
}

.testimonials {
    background: var(--white);
}

.instagram-section {
    background: var(--offwhite);
}

@media (max-width: 768px) {
    .legal-topics,
    .testimonials,
    .instagram-section {
        padding: 4rem 0;
    }
}

/* ===== FINAL CTA ===== */
.final-cta {
    padding: 5rem 0;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.cta-card {
    text-align: center;
    color: var(--white);
}

.cta-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.cta-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .final-cta {
        padding: 4rem 0;
    }
    
    .cta-title {
        font-size: 2rem;
    }
    
    .cta-subtitle {
        font-size: 1rem;
    }
}

/* ===== CONTACT ===== */
.contact {
    padding: 6rem 0;
    background: var(--white);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.contact-card {
    background: var(--offwhite);
    padding: 2rem 1.5rem;
    text-align: center;
    border-radius: 2px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

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

.contact-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.contact-card h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.contact-card p {
    color: var(--neutral);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.contact-card .btn-small {
    margin-top: auto;
    align-self: center;
    width: fit-content;
}

.contact-map {
    height: 450px;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

@media (max-width: 1024px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-info {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .contact {
        padding: 4rem 0;
    }
    
    .contact-info {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .contact-card {
        padding: 1.5rem;
    }
    
    .contact-map {
        height: 350px;
    }
}

/* ===== FOOTER ===== */
.footer {
    background: var(--black);
    color: var(--white);
    padding: 4rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-logo a {
    display: inline-block;
}

.footer-logo img {
    height: 45px;
    margin-bottom: 1rem;
    filter: brightness(0) invert(1);
}

.footer-slogan {
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-description {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    line-height: 1.6;
    margin-top: 0.5rem;
}

.footer h4 {
    color: var(--secondary);
    margin-bottom: 1.5rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer ul {
    list-style: none;
    padding: 0;
}

.footer ul li {
    margin-bottom: 0.8rem;
}

.footer ul li a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
}

.footer ul li a:hover {
    color: var(--secondary);
    padding-left: 5px;
}

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

.social-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: var(--transition);
    text-decoration: none;
}

.social-icon:hover {
    background: var(--secondary);
    color: var(--primary);
    transform: translateY(-3px);
}

/* Línea legal */
.footer-legal {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.legal-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.legal-links a {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 0.8rem;
    transition: var(--transition);
}

.legal-links a:hover {
    color: var(--secondary);
}

.legal-links .separator {
    color: rgba(255,255,255,0.2);
    font-size: 0.8rem;
}

.copyright p {
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    margin: 0;
}

@media (max-width: 1024px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .footer {
        padding: 3rem 0 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-logo {
        max-width: 100%;
    }
    
    .social-icons {
        justify-content: center;
    }
    
    .footer-legal {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .legal-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .legal-links {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .legal-links .separator {
        display: none;
    }
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 2px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close-modal {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 2rem;
    color: var(--neutral);
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--primary);
}

/* Modal específico de temas legales (escritorio) */
#topicModal .modal-content {
    max-width: 750px;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
    background: var(--white);
    max-height: 90vh;
    overflow-y: auto;
}

#topicModal .modal-article {
    display: flex;
    flex-direction: column;
}

#topicModal .modal-article-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 2.5rem 2.5rem 2rem 2.5rem;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
}

#topicModal .modal-article-header i {
    font-size: 3rem;
    background: rgba(255,255,255,0.2);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    color: var(--secondary);
}

#topicModal .modal-article-header h2 {
    color: var(--white);
    font-size: 2rem;
    margin: 0;
    flex: 1;
    font-weight: 700;
    line-height: 1.3;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#topicModal .modal-article-body {
    padding: 2.5rem;
    background: var(--white);
}

#topicModal .modal-article-summary {
    background: #f8f9fc;
    padding: 1.8rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 4px solid var(--secondary);
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
}

#topicModal .modal-article-summary p {
    color: var(--black);
    line-height: 1.8;
    font-size: 1rem;
}

#topicModal .modal-article-summary p strong {
    color: var(--primary);
    font-weight: 700;
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

#topicModal .modal-article-full {
    margin-bottom: 2.5rem;
    padding: 0 0.5rem;
}

#topicModal .modal-article-full p {
    color: #4a5568;
    line-height: 1.9;
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    text-align: justify;
}

#topicModal .modal-article-full p:first-child::first-letter {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    float: left;
    line-height: 1;
    margin-right: 0.5rem;
    font-family: 'Georgia', serif;
}

#topicModal .modal-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0 2rem;
    color: var(--neutral);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#topicModal .modal-divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--secondary), transparent);
}

#topicModal .modal-article-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8f9fc;
    border-radius: 8px;
    border: 1px solid #edf2f7;
}

#topicModal .modal-article-actions .btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 0.9rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

#topicModal .modal-article-actions .btn-outline:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(34,63,51,0.2);
}

#topicModal .modal-article-actions .btn-outline i {
    color: var(--primary);
    transition: all 0.3s ease;
}

#topicModal .modal-article-actions .btn-outline:hover i {
    color: var(--white);
}

#topicModal .modal-article-actions .btn-primary {
    background: var(--primary);
    color: var(--white);
    border: 2px solid var(--primary);
    padding: 0.9rem 2rem;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(34,63,51,0.3);
}

#topicModal .modal-article-actions .btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(34,63,51,0.4);
}

/* ===== FORM ===== */
.form-group {
    margin-bottom: 1rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 2px;
    font-family: inherit;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* ===== UTILITIES ===== */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 2rem;
}

/* ===== DROPDOWN MENU ===== */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    min-width: 220px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border-radius: 2px;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.7rem 1.5rem;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
}

.dropdown-item:hover {
    background: var(--offwhite);
    color: var(--accent);
    padding-left: 2rem;
}

.header.scrolled .dropdown-menu {
    background: var(--white);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.header.scrolled .dropdown-item {
    color: var(--primary);
}

.header.scrolled .dropdown-item:hover {
    background: var(--offwhite);
    color: var(--accent);
}

/* ===== DROPDOWN EN MÓVIL ===== */
@media (max-width: 768px) {
    .dropdown {
        position: static;
        width: 100%;
    }
    
    .dropdown-menu {
        position: static;
        background: var(--offwhite);
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        padding: 0.5rem 0 0.5rem 1rem;
        margin-top: 0.5rem;
        min-width: 100%;
        border-left: 3px solid var(--accent);
    }
    
    .dropdown.active .dropdown-menu {
        display: block;
    }
    
    .dropdown-toggle {
        justify-content: space-between;
        width: 100%;
    }
    
    .dropdown-item {
        white-space: normal;
        padding: 0.8rem 1rem;
    }
    
    .dropdown-item:hover {
        padding-left: 1.5rem;
    }
}

/* ===== NUEVAS CARDS DE SERVICIOS (CON FONDO) ===== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.service-card {
  position: relative;
  background-size: cover;
  background-position: center;
  border-radius: 2px;
  overflow: hidden;
  min-height: 400px;
  display: flex;
  align-items: flex-end;
  transition: var(--transition);
  border: none;
  box-shadow: var(--shadow);
}

.service-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(34,63,51,0.3) 0%, rgba(26,31,39,0.9) 100%);
  z-index: 1;
  transition: var(--transition);
}

.service-card:hover .service-card-overlay {
  background: linear-gradient(180deg, rgba(34,63,51,0.5) 0%, rgba(26,31,39,0.95) 100%);
}

.service-card-content {
  position: relative;
  z-index: 2;
  padding: 2rem;
  color: var(--white);
  width: 100%;
  transform: translateY(0);
  transition: transform 0.3s ease;
}

.service-card:hover .service-card-content {
  transform: translateY(-5px);
}

.service-card-content h3 {
  font-size: 1.8rem;
  color: var(--white);
  margin-bottom: 1rem;
  font-weight: 700;
}

.service-card-content p {
  color: rgba(255,255,255);
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  line-height: 1.6;
}

.service-card-content .service-link {
  color: var(--secondary);
  background: none;
  border: none;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 1.2rem;
  text-transform: uppercase;
  transition: var(--transition);
  padding: 0;
}

.service-card-content .service-link:hover {
  color: var(--white);
  gap: 1rem;
}

@media (max-width: 1024px) {
  .services-grid {
      grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .services-grid {
      grid-template-columns: 1fr;
  }
  
  .service-card {
      min-height: 350px;
  }
  
  .service-card-content {
      padding: 1.5rem;
  }
  
  .service-card-content h3 {
      font-size: 1.5rem;
  }
}

/* ===== MODAL EN MÓVIL - CORREGIDO ===== */
@media (max-width: 768px) {
    /* Reset de estilos de escritorio para móvil */
    #topicModal .modal-content {
        max-width: 100%;
        margin: 0;
        height: auto;
        min-height: 100vh;
        border-radius: 0;
        max-height: none;
        overflow-y: visible;
    }
    
    #topicModal .modal-article-header {
        padding: 2rem 1.5rem 1.5rem;
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    #topicModal .modal-article-header i {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    #topicModal .modal-article-header h2 {
        font-size: 1.5rem;
    }
    
    #topicModal .modal-article-body {
        padding: 1.5rem;
    }
    
    #topicModal .modal-article-summary {
        padding: 1.2rem;
        margin-bottom: 1.5rem;
    }
    
    #topicModal .modal-article-full {
        padding: 0;
        margin-bottom: 1.5rem;
    }
    
    #topicModal .modal-article-full p {
        font-size: 0.95rem;
        line-height: 1.7;
    }
    
    #topicModal .modal-divider {
        margin: 1rem 0 1.5rem;
    }
    
    #topicModal .modal-article-actions {
        flex-direction: column;
        padding: 1.2rem;
        gap: 0.8rem;
    }
    
    #topicModal .modal-article-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    #topicModal .close-modal {
        top: 0.8rem;
        right: 0.8rem;
        width: 40px;
        height: 40px;
        font-size: 1.8rem;
        background: rgba(0,0,0,0.3);
        color: var(--white);
    }
    
    #topicModal .close-modal:hover {
        background: rgba(0,0,0,0.5);
    }
}

/* ===== MODAL DE TEMAS LEGALES - CORRECCIÓN DEFINITIVA ===== */
#topicModal {
    display: none;
    position: fixed;
    z-index: 2000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    align-items: center;
    justify-content: center;
}

#topicModal .modal-content {
    background: var(--white);
    max-width: 750px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 12px;
    padding: 0;
    position: relative;
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
}

#topicModal .close-modal {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 2rem;
    color: var(--white);
    cursor: pointer;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 10;
}

#topicModal .close-modal:hover {
    background: rgba(0,0,0,0.5);
    transform: rotate(90deg);
}

/* Estilos del contenido del modal */
#topicModal .modal-article {
    display: flex;
    flex-direction: column;
}

#topicModal .modal-article-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 2.5rem 2.5rem 2rem 2.5rem;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
}

#topicModal .modal-article-header i {
    font-size: 3rem;
    background: rgba(255,255,255,0.2);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    color: var(--secondary);
}

#topicModal .modal-article-header h2 {
    color: var(--white);
    font-size: 2rem;
    margin: 0;
    flex: 1;
    font-weight: 700;
    line-height: 1.3;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#topicModal .modal-article-body {
    padding: 2.5rem;
    background: var(--white);
}

#topicModal .modal-article-summary {
    background: #f8f9fc;
    padding: 1.8rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border-left: 4px solid var(--secondary);
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
}

#topicModal .modal-article-summary p {
    color: var(--black);
    line-height: 1.8;
    font-size: 1rem;
}

#topicModal .modal-article-summary p strong {
    color: var(--primary);
    font-weight: 700;
    display: block;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

#topicModal .modal-article-full {
    margin-bottom: 2.5rem;
    padding: 0 0.5rem;
}

#topicModal .modal-article-full p {
    color: #4a5568;
    line-height: 1.9;
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
    text-align: justify;
}

#topicModal .modal-article-full p:first-child::first-letter {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    float: left;
    line-height: 1;
    margin-right: 0.5rem;
    font-family: 'Georgia', serif;
}

#topicModal .modal-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0 2rem;
    color: var(--neutral);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#topicModal .modal-divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--secondary), transparent);
}

#topicModal .modal-article-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8f9fc;
    border-radius: 8px;
    border: 1px solid #edf2f7;
}

#topicModal .modal-article-actions .btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 0.9rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

#topicModal .modal-article-actions .btn-outline:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(34,63,51,0.2);
}

#topicModal .modal-article-actions .btn-outline i {
    color: var(--primary);
    transition: all 0.3s ease;
}

#topicModal .modal-article-actions .btn-outline:hover i {
    color: var(--white);
}

#topicModal .modal-article-actions .btn-primary {
    background: var(--primary);
    color: var(--white);
    border: 2px solid var(--primary);
    padding: 0.9rem 2rem;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(34,63,51,0.3);
}

#topicModal .modal-article-actions .btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(34,63,51,0.4);
}

/* ===== MODAL EN MÓVIL - CORRECCIÓN FINAL ===== */
@media (max-width: 768px) {
    #topicModal {
        align-items: flex-start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    #topicModal .modal-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        min-height: 100vh;
        max-height: none;
        border-radius: 0;
        overflow-y: visible;
    }
    
    #topicModal .modal-article-header {
        padding: 3rem 1.5rem 1.5rem;
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    #topicModal .modal-article-header i {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    #topicModal .modal-article-header h2 {
        font-size: 1.5rem;
    }
    
    #topicModal .modal-article-body {
        padding: 1.5rem;
    }
    
    #topicModal .modal-article-summary {
        padding: 1.2rem;
        margin-bottom: 1.5rem;
    }
    
    #topicModal .modal-article-full {
        margin-bottom: 1.5rem;
    }
    
    #topicModal .modal-article-full p {
        font-size: 0.95rem;
        line-height: 1.7;
    }
    
    #topicModal .modal-divider {
        margin: 1rem 0 1.5rem;
    }
    
    #topicModal .modal-article-actions {
        flex-direction: column;
        padding: 1.2rem;
        gap: 0.8rem;
    }
    
    #topicModal .modal-article-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    #topicModal .close-modal {
        position: fixed;
        top: 0.8rem;
        right: 0.8rem;
        background: rgba(0,0,0,0.6);
        color: white;
        width: 44px;
        height: 44px;
        font-size: 2rem;
        z-index: 10000;
    }
}