.brand-logo {
    display: block;
    width: min(320px, 55vw);
    height: auto;
}

.site-header {
    box-shadow: 0 5px 22px rgba(16,42,67,.055);
}

.site-header .nav {
    min-height: 82px;
}

.site-header .brand {
    border-radius: 12px;
}

.site-header #main-nav a {
    position: relative;
    padding: .55rem .15rem;
    color: var(--ink);
    transition: color .2s ease;
}

.site-header #main-nav a::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: .25rem;
    left: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .2s ease;
}

.site-header #main-nav a:hover,
.site-header #main-nav a[aria-current="page"] {
    color: var(--primary);
}

.site-header #main-nav a:hover::after,
.site-header #main-nav a[aria-current="page"]::after {
    transform: scaleX(1);
}

select:not([multiple]) {
    min-height: 52px;
    padding: .75rem 3rem .75rem .9rem;
    border-radius: 12px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23075985' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .9rem center;
    background-size: 20px;
    font-size: 1rem;
    line-height: 1.35;
    appearance: none;
    -webkit-appearance: none;
}

select:not([multiple]):hover {
    border-color: var(--primary);
}

select:not([multiple]):disabled {
    cursor: not-allowed;
    opacity: .7;
}

.menu-button {
    min-width: 48px;
    min-height: 44px;
}

.hero h1 {
    max-width: 760px;
    font-size: clamp(2.55rem, 4vw, 3.75rem);
    line-height: 1.02;
    text-wrap: balance;
}

.hero p { max-width: 720px; }

@media (max-width: 699px) {
    .site-header .nav { min-height: 74px; }
    .brand-logo { width: min(260px, 58vw); }

    .site-header #main-nav a {
        display: flex;
        min-height: 44px;
        align-items: center;
        padding: .65rem .25rem;
    }
}

@media (min-width: 900px) and (max-width: 1100px) {
    .brand-logo { width: 245px; }
    .site-header #main-nav { gap: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
    .site-header #main-nav a,
    .site-header #main-nav a::after { transition: none; }
}

.seo-copy {
    max-width: var(--max);
}

.seo-copy > h2,
.seo-copy > p {
    max-width: 900px;
}

.seo-copy > p {
    color: var(--muted);
    font-size: 1.06rem;
}

.seo-links {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.seo-link-card {
    padding: 1.2rem;
    color: var(--ink);
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.seo-link-card strong,
.seo-link-card span {
    display: block;
}

.seo-link-card span {
    margin-top: .3rem;
    color: var(--muted);
    font-size: .92rem;
}

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

.faq-list {
    display: grid;
    gap: .75rem;
    max-width: 900px;
}

.faq-list details {
    padding: 1rem 1.15rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.faq-list summary {
    padding-right: 2rem;
    color: var(--ink);
    font-weight: 800;
    cursor: pointer;
}

.faq-list details[open] {
    border-color: var(--primary);
}

.faq-list p {
    margin-bottom: 0;
    color: var(--muted);
}

@media (min-width: 700px) {
    .seo-links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1000px) {
    .seo-links {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.site-footer {
    padding: clamp(2.5rem, 6vw, 4rem) 0;
}

.site-footer .footer-intro {
    max-width: 680px;
}

.site-footer .footer-intro strong {
    color: #fff;
    font-size: 1.15rem;
}

.site-footer .footer-intro p {
    margin: .35rem 0 0;
    color: #c8dbe5;
    font-size: .9rem;
    line-height: 1.6;
}

.footer-columns {
    display: grid;
    gap: 2.25rem;
}

.footer-columns section {
    min-width: 0;
}

.footer-columns h2 {
    margin: 0 0 .8rem;
    color: #fff;
    font-size: 1rem;
    letter-spacing: .02em;
}

.footer-columns nav {
    display: grid;
    gap: .55rem;
}

.footer-columns a {
    width: fit-content;
    color: #dceaf0;
    text-decoration-color: rgba(220, 234, 240, .45);
    overflow-wrap: anywhere;
}

.footer-columns a:hover {
    color: #fff;
    text-decoration-color: currentColor;
}

.footer-cookie-settings {
    justify-content: flex-start;
    width: fit-content;
    min-height: 0;
    padding: 0;
    border-radius: 0;
    color: #dceaf0;
    background: transparent;
    font-weight: 400;
    text-decoration: underline;
    text-decoration-color: rgba(220, 234, 240, .45);
    text-underline-offset: 3px;
}

.footer-cookie-settings:hover {
    color: #fff;
    background: transparent;
    text-decoration-color: currentColor;
    filter: none;
}

.back-to-top {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    z-index: 45;
    width: 50px;
    height: 50px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 10px 28px rgba(7, 31, 46, .28);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.back-to-top:hover {
    filter: brightness(.92);
}

.cookie-consent {
    position: fixed;
    right: auto;
    bottom: max(1rem, env(safe-area-inset-bottom));
    left: 50%;
    z-index: 60;
    width: min(calc(100% - 2rem), 1120px);
    color: var(--ink);
    transform: translateX(-50%);
}

.cookie-consent[hidden] {
    display: none;
}

.cookie-consent-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 1rem 1.25rem;
    align-items: center;
    padding: 1.15rem 1.25rem;
    border: 1px solid rgba(7, 89, 133, .2);
    border-top: 4px solid var(--accent);
    border-radius: 18px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 24px 65px rgba(7, 31, 46, .24);
    backdrop-filter: blur(16px);
}

.cookie-consent-icon {
    display: grid;
    width: 3rem;
    height: 3rem;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    background: var(--primary);
    box-shadow: 0 8px 20px rgba(7, 89, 133, .2);
}

.cookie-consent-icon svg {
    width: 1.6rem;
    height: 1.6rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cookie-consent-copy strong {
    display: block;
    font-size: 1.05rem;
    line-height: 1.25;
}

.cookie-consent-copy p {
    max-width: 700px;
    margin: .2rem 0 .15rem;
    color: var(--muted);
    font-size: .88rem;
    line-height: 1.5;
}

.cookie-consent-copy a {
    font-size: .8rem;
    font-weight: 750;
}

.cookie-consent-actions {
    display: flex;
    gap: .65rem;
}

.cookie-consent-actions .button {
    white-space: nowrap;
}

.home-stations .section-head {
    margin-bottom: 1.5rem;
}

.stations-home-intro {
    max-width: 790px;
    margin: .55rem 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.home-stations .section-head > a {
    flex: 0 0 auto;
    font-weight: 750;
}

@media (min-width: 560px) {
    .footer-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: clamp(2rem, 7vw, 4rem);
    }

    .site-footer .footer-intro {
        grid-column: 1 / -1;
    }
}

@media (min-width: 900px) {
    .footer-columns {
        grid-template-columns: minmax(0, 1.45fr) minmax(160px, .7fr) minmax(220px, 1fr);
        gap: clamp(2.5rem, 5vw, 5rem);
    }

    .site-footer .footer-intro {
        grid-column: auto;
    }
}

@media (max-width: 700px) {
    .home-stations .section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .table-wrap::before {
        content: "Desliza horizontalmente para consultar todos los datos";
        position: sticky;
        left: 0;
        display: block;
        width: max-content;
        padding: 0 0 .65rem;
        color: var(--muted);
        font-size: .78rem;
    }
}

@media (max-width: 760px) {
    .cookie-consent-inner {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .cookie-consent-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

@media (max-width: 559px) {
    .footer-columns {
        gap: 0;
    }

    .site-footer .footer-intro {
        padding-bottom: 1.75rem;
    }

    .footer-columns section {
        padding: 1.5rem 0;
        border-top: 1px solid rgba(220, 234, 240, .18);
    }

    .footer-columns section:last-child {
        padding-bottom: 0;
    }

    .footer-columns nav {
        gap: .25rem;
    }

    .footer-columns a {
        display: flex;
        width: 100%;
        min-height: 2.5rem;
        align-items: center;
    }

    .footer-cookie-settings {
        width: 100%;
        min-height: 2.5rem;
        align-items: center;
    }

    select:not([multiple]) {
        min-height: 56px;
        padding-top: .85rem;
        padding-bottom: .85rem;
    }

    .date-form {
        display: grid;
        max-width: none;
    }

    .date-form label {
        margin-bottom: 0;
    }

    .date-form button {
        width: 100%;
        min-height: 48px;
    }

    .back-to-top {
        right: max(.75rem, env(safe-area-inset-right));
        bottom: max(.75rem, env(safe-area-inset-bottom));
        width: 48px;
        height: 48px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .back-to-top {
        transition: none;
    }
}

@media (max-width: 420px) {
    .actions > .button {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .cookie-consent {
        bottom: 0;
        width: 100%;
    }

    .cookie-consent-inner {
        max-height: min(88vh, 620px);
        padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
        overflow-y: auto;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 18px 18px 0 0;
    }

    .cookie-consent-icon {
        width: 2.65rem;
        height: 2.65rem;
        border-radius: 12px;
    }

    .cookie-consent-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .cookie-consent-actions .button {
        width: 100%;
    }
}
