/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #1e40af;
    --primary-dark: #1e3a8a;
    --primary-light: #3b82f6;
    --secondary: #f59e0b;
    --secondary-dark: #d97706;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --bg-dark: #0f172a;
    --border: #e5e7eb;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
    --max-width: 1200px;
    --header-height: 72px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); }
ul, ol { list-style: none; }

/* === CONTAINER === */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* === HEADER === */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.header__logo {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
}

.header__nav { display: flex; align-items: center; }

.header__menu {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.header__menu a {
    color: var(--text);
    font-weight: 500;
    font-size: .95rem;
    transition: color .2s;
}

.header__menu a:hover { color: var(--primary); }

.header__cta {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--primary);
    color: #fff;
    padding: .6rem 1.2rem;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: .9rem;
    white-space: nowrap;
    transition: background .2s;
}

.header__cta:hover { background: var(--primary-dark); color: #fff; }

.header__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: .5rem;
}

.header__toggle span {
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: .3s;
}

/* === BREADCRUMBS === */
.breadcrumbs {
    background: var(--bg-alt);
    padding: .75rem 0;
    border-bottom: 1px solid var(--border);
}

.breadcrumbs__list {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    font-size: .85rem;
}

.breadcrumbs__item + .breadcrumbs__item::before {
    content: '›';
    margin-right: .25rem;
    color: var(--text-light);
}

.breadcrumbs__item a { color: var(--primary); }
.breadcrumbs__item span { color: var(--text-light); }

/* === HERO === */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 4rem 0;
    text-align: center;
}

.hero__title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero__title span { color: var(--secondary); }

.hero__subtitle {
    font-size: 1.15rem;
    opacity: .9;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero__cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.hero__features {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.hero__feature {
    text-align: center;
    padding: 1rem;
    background: rgba(255,255,255,.1);
    border-radius: var(--radius);
    min-width: 100px;
}

.hero__feature strong {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
}

.hero__feature span {
    font-size: .85rem;
    opacity: .8;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all .2s;
    text-decoration: none;
}

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

.btn--primary:hover {
    background: var(--secondary-dark);
    border-color: var(--secondary-dark);
    color: #000;
}

.btn--outline {
    background: transparent;
    color: #fff;
    border-color: #fff;
}

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

.btn--lg { padding: 1rem 2rem; font-size: 1.1rem; }
.btn--block { width: 100%; justify-content: center; }

/* === SECTIONS === */
.section { padding: 4rem 0; }
.section--alt { background: var(--bg-alt); }
.section--centered { text-align: center; }

.section__title {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 800;
    text-align: center;
    margin-bottom: .75rem;
    color: var(--text);
}

.section__subtitle {
    text-align: center;
    color: var(--text-light);
    max-width: 650px;
    margin: 0 auto 2.5rem;
    font-size: 1.05rem;
}

/* === GRID === */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid--2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* === CARDS === */
.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: box-shadow .2s, transform .2s;
}

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

.card__icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-alt);
    border-radius: var(--radius);
    color: var(--primary);
    margin-bottom: 1rem;
}

.card__title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: .5rem;
}

.card__title a { color: var(--text); }
.card__title a:hover { color: var(--primary); }
.card__text { color: var(--text-light); font-size: .95rem; }
.card__link { display: inline-block; margin-top: 1rem; font-weight: 600; font-size: .9rem; }

/* === CITY CARDS === */
.city-card {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all .2s;
    text-decoration: none;
}

.city-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.city-card__name {
    font-weight: 600;
    color: var(--text);
    font-size: .95rem;
}

.city-card__provincia {
    font-size: .8rem;
    color: var(--text-light);
    margin-top: .25rem;
}

/* === PROVINCIA GRID === */
.provincias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: .75rem;
}

.provincia-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .75rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .9rem;
    color: var(--text);
    transition: all .2s;
}

.provincia-link:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.provincia-link span { color: var(--text-light); font-size: .8rem; }

.provincia-card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all .2s;
}

.provincia-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.provincia-card__name { font-weight: 700; color: var(--text); }
.provincia-card__count { font-size: .85rem; color: var(--text-light); margin-top: .25rem; }

/* === MUNICIPIOS GRID === */
.municipios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: .75rem;
}

.municipio-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .75rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all .2s;
}

.municipio-link:hover { border-color: var(--primary); }
.municipio-link__name { font-weight: 500; color: var(--text); font-size: .9rem; }
.municipio-link__pop { font-size: .75rem; color: var(--text-light); }

/* === CONTENT GRID (main + sidebar) === */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 3rem;
    align-items: start;
}

.content-grid__main h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    color: var(--text);
}

.content-grid__main h2:first-child { margin-top: 0; }

.content-grid__main h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 1.5rem 0 .75rem;
}

.content-grid__main p {
    margin-bottom: 1rem;
    color: var(--text);
    line-height: 1.8;
}

/* === SIDEBAR === */
.sidebar-cta {
    background: var(--primary);
    color: #fff;
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    position: sticky;
    top: calc(var(--header-height) + 1rem);
}

.sidebar-cta h3 { font-size: 1.25rem; margin-bottom: .5rem; }
.sidebar-cta p { opacity: .9; margin-bottom: 1.5rem; font-size: .95rem; }
.sidebar-cta .btn { background: var(--secondary); color: #000; border-color: var(--secondary); }
.sidebar-cta .btn:hover { background: var(--secondary-dark); border-color: var(--secondary-dark); }

.sidebar-cta__features {
    margin-top: 1.5rem;
    text-align: left;
}

.sidebar-cta__features li {
    padding: .4rem 0;
    font-size: .9rem;
    opacity: .9;
}

.sidebar-cta__features li::before {
    content: '✓ ';
    font-weight: bold;
}

.sidebar-box {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.sidebar-box h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.sidebar-links li {
    padding: .4rem 0;
    border-bottom: 1px solid var(--border);
}

.sidebar-links li:last-child { border-bottom: none; }

.sidebar-links a {
    font-size: .9rem;
    color: var(--text);
    display: block;
}

.sidebar-links a:hover { color: var(--primary); }

/* === SERVICES LIST === */
.services-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: .75rem;
    margin: 1.5rem 0;
}

.service-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem;
    background: var(--bg-alt);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    color: var(--text);
    transition: all .2s;
}

.service-item:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.service-item svg { flex-shrink: 0; color: var(--primary); }

/* === CHECK LIST === */
.check-list {
    margin: 1rem 0;
}

.check-list li {
    position: relative;
    padding: .5rem 0 .5rem 2rem;
    line-height: 1.6;
}

.check-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: .75rem;
    width: 20px;
    height: 20px;
    background: var(--primary-light);
    border-radius: 50%;
    opacity: .15;
}

.check-list li::after {
    content: '✓';
    position: absolute;
    left: 5px;
    top: .5rem;
    color: var(--primary);
    font-weight: bold;
    font-size: .85rem;
}

/* === FEATURES === */
.feature { text-align: center; padding: 2rem; }

.feature__icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-alt);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    color: var(--primary);
}

.feature h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: .75rem;
}

.feature p { color: var(--text-light); font-size: .95rem; }

/* === PROVINCIA STATS === */
.provincia-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 2rem 0 3rem;
    flex-wrap: wrap;
}

.stat { text-align: center; }
.stat strong { display: block; font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat span { font-size: .9rem; color: var(--text-light); }

/* === FAQ === */
.faq { max-width: 800px; margin: 0 auto; }

.faq__item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: .75rem;
    overflow: hidden;
}

.faq__question {
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq__question::-webkit-details-marker { display: none; }

.faq__question::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-light);
    transition: .2s;
}

.faq__item[open] .faq__question::after {
    content: '−';
    color: var(--primary);
}

.faq__answer {
    padding: 0 1.5rem 1.25rem;
    color: var(--text-light);
}

/* === FORM === */
.form { max-width: 600px; }
.form__group { margin-bottom: 1.25rem; }

.form__group label {
    display: block;
    font-weight: 600;
    font-size: .9rem;
    margin-bottom: .4rem;
    color: var(--text);
}

.form__group input,
.form__group textarea,
.form__group select {
    width: 100%;
    padding: .75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color .2s;
}

.form__group input:focus,
.form__group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, .1);
}

/* === CONTACT === */
.contact-methods {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.contact-method {
    padding: 1.5rem;
    background: var(--bg-alt);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.contact-method h3 { font-size: .9rem; color: var(--text-light); margin-bottom: .5rem; }
.contact-method__value { font-size: 1.25rem; font-weight: 700; color: var(--primary); display: block; margin-bottom: .5rem; }
.contact-method p { font-size: .85rem; color: var(--text-light); }

/* === LEGAL === */
.legal-content { max-width: 800px; margin: 0 auto; }
.legal-content h2 { margin-top: 2rem; }

/* === FOOTER === */
.footer {
    background: var(--bg-dark);
    color: #fff;
    padding: 4rem 0 2rem;
}

.footer__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer__col h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #fff;
}

.footer__col ul li { margin-bottom: .5rem; }
.footer__col a { color: rgba(255,255,255,.7); font-size: .9rem; }
.footer__col a:hover { color: #fff; }
.footer__hours { margin-top: 1rem; font-size: .9rem; color: rgba(255,255,255,.7); }

.footer__bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    padding-top: 1.5rem;
    text-align: center;
    font-size: .85rem;
    color: rgba(255,255,255,.5);
}

/* === CTA FLOTANTE === */
.cta-float {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 999;
    display: none;
}

.cta-float__btn {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--secondary);
    color: #000;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: .95rem;
    box-shadow: var(--shadow-lg);
    transition: all .2s;
    text-decoration: none;
}

.cta-float__btn:hover {
    background: var(--secondary-dark);
    transform: scale(1.05);
    color: #000;
}

/* === ERROR === */
.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .sidebar-cta { position: static; }
}

@media (max-width: 768px) {
    :root { --header-height: 64px; }

    .header__toggle { display: flex; }

    .header__menu {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg);
        flex-direction: column;
        padding: 1.5rem;
        gap: 0;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: .3s;
    }

    .header__menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .header__menu li {
        width: 100%;
        border-bottom: 1px solid var(--border);
    }

    .header__menu a {
        display: block;
        padding: 1rem 0;
    }

    .header__cta {
        font-size: .8rem;
        padding: .5rem .75rem;
    }

    .header__cta span { display: none; }

    .hero { padding: 3rem 0; }
    .hero__features { gap: 1rem; }
    .hero__feature { min-width: 80px; padding: .75rem; }

    .section { padding: 3rem 0; }

    .grid--3, .grid--4 { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

    .provincias-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    
    .provincia-stats { gap: 1.5rem; }
    .stat strong { font-size: 1.5rem; }

    .cta-float { display: block; }
    .footer { padding: 3rem 0 6rem; }
}

@media (max-width: 480px) {
    .hero__title { font-size: 1.75rem; }
    .hero__cta { flex-direction: column; align-items: center; }
    .btn--lg { padding: .85rem 1.5rem; font-size: 1rem; }
    .services-list { grid-template-columns: 1fr; }
    .municipios-grid { grid-template-columns: 1fr; }
}
