/* ==========================================================================
   CÓDIGOS POSTALES MODERN - MAIN STYLESHEET
   ========================================================================== */

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --primary-border: #bfdbfe;
    --navy: #0f172a;
    --navy-light: #1e293b;
    --navy-surface: #334155;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --accent: #f59e0b;
    --accent-light: #fef3c7;
    --success: #10b981;
    --success-light: #ecfdf5;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --container-max: 1200px;
}

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

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */

.site-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: -0.02em;
}

.site-logo:hover {
    color: var(--primary);
}

.logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
    color: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.logo-badge svg {
    width: 22px;
    height: 22px;
}

.main-nav {
    display: flex;
    align-items: stretch;
    height: 100%;
    gap: 0.35rem;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.875rem;
    color: var(--navy-light);
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    align-self: center;
}

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

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--navy);
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   HERO & LIVE SEARCH
   ========================================================================== */

.hero-section {
    background: linear-gradient(135deg, #0b1329 0%, #1e3a8a 60%, #1e40af 100%);
    color: #ffffff;
    padding: 4rem 0 4.5rem;
    position: relative;
    overflow: visible;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to top, var(--bg-body), transparent);
}

.hero-content {
    max-width: 820px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 1rem;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: #e0e7ff;
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.1875rem;
    color: #cbd5e1;
    margin-bottom: 2.25rem;
    line-height: 1.5;
}

/* Search Box Container */
.search-wrapper {
    position: relative;
    max-width: 680px;
    margin: 0 auto 1.5rem;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.search-box:focus-within {
    border-color: #60a5fa;
    box-shadow: 0 12px 30px -5px rgba(37, 99, 235, 0.4);
}

.search-icon {
    padding-left: 1.25rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.search-icon svg {
    width: 22px;
    height: 22px;
}

.search-input {
    width: 100%;
    padding: 1.125rem 1rem;
    font-size: 1.0625rem;
    font-family: inherit;
    border: none;
    outline: none;
    background: transparent;
    color: var(--navy);
}

.search-input::placeholder {
    color: #94a3b8;
}

.search-clear {
    display: none;
    background: none;
    border: none;
    padding: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
}

.search-clear:hover {
    color: var(--navy);
}

.search-spinner {
    display: none;
    margin-right: 1.25rem;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(37, 99, 235, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Autocomplete Dropdown */
.search-results-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    max-height: 420px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    text-align: left;
}

.search-results-dropdown.active {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-main);
    transition: background-color 0.1s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: var(--primary-light);
}

.result-main {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.result-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--navy);
}

.result-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.result-badge {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.875rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary-border);
}

.search-empty {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9375rem;
}

/* Quick Search Tags */
.quick-tags {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #cbd5e1;
}

.quick-tags span {
    font-weight: 600;
}

.tag-pill {
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.tag-pill:hover {
    background: #ffffff;
    color: var(--navy);
}

/* ==========================================================================
   FEATURE CARDS (HOME CATEGORIES)
   ========================================================================== */

.features-section {
    margin-top: -2rem;
    margin-bottom: 4rem;
    position: relative;
    z-index: 10;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

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

@media (max-width: 640px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: #cbd5e1;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.card-icon svg {
    width: 26px;
    height: 26px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.5rem;
}

.card-description {
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

.card-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
    font-size: 0.9375rem;
    color: var(--primary);
}

.card-action svg {
    width: 16px;
    height: 16px;
    transition: transform 0.15s ease;
}

.feature-card:hover .card-action svg {
    transform: translateX(4px);
}

/* ==========================================================================
   PROVINCES & MUNICIPALITIES GRIDS
   ========================================================================== */

.section-header {
    text-align: center;
    max-width: 650px;
    margin: 0 auto 2.5rem;
}

.section-tag {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    background: var(--primary-light);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    margin-bottom: 0.75rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.section-desc {
    color: var(--text-muted);
    font-size: 1.0625rem;
}

.provinces-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 4rem;
}

.province-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.15s ease;
    color: var(--navy);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.province-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background-color: #ffffff;
    color: var(--primary);
}

.province-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.province-code {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-body);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.province-card:hover .province-code {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary-border);
}

.province-name {
    font-size: 0.9375rem;
}

.province-arrow {
    color: var(--text-light);
    transition: transform 0.15s ease, color 0.15s ease;
}

.province-card:hover .province-arrow {
    transform: translateX(3px);
    color: var(--primary);
}

/* ==========================================================================
   PAGE TEMPLATE & CONTENT STYLES
   ========================================================================== */

.content-wrapper {
    padding: 2.5rem 0 4rem;
    flex-grow: 1;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.breadcrumb-separator {
    color: var(--text-light);
}

.breadcrumb-current {
    color: var(--navy);
    font-weight: 600;
}

/* Page Card */
.page-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 2.5rem;
    margin-bottom: 2.5rem;
}

.page-header {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* Content Typography & Elements */
.entry-content {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: #334155;
}

.entry-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--navy);
    margin: 2rem 0 1rem;
    letter-spacing: -0.01em;
}

.entry-content p {
    margin-bottom: 1.25rem;
}

.entry-content strong {
    color: var(--navy);
}

/* Postal Code Badges / Pills */
.ncp {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.0625rem;
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--primary-border);
    margin: 0.25rem 0.25rem 0.25rem 0;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: all;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.08);
}

.ncp:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

.ncp::after {
    content: '📋';
    font-size: 0.75rem;
    opacity: 0.6;
}

.ncp:hover::after {
    opacity: 1;
}

/* Box info / Datitos */
.datitos {
    background: #f1f5f9;
    border-left: 4px solid var(--primary);
    padding: 1.25rem 1.5rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin: 1.5rem 0;
    font-size: 1.0625rem;
    color: var(--navy-light);
    line-height: 1.7;
}

#map {
    width: 100%;
    height: 380px;
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
    background: #e2e8f0;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
}

/* Legacy Support: ul#provin2, ul#provin3 */
ul#provin2, ul#provin3 {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0;
}

ul#provin2 li, ul#provin3 li {
    padding: 0.35rem 0;
    border-bottom: 1px dashed var(--border);
}

ul#provin2 li:last-child, ul#provin3 li:last-child {
    border-bottom: none;
}

ul#provin2 a, ul#provin3 a {
    color: var(--navy-light);
    font-weight: 500;
    display: inline-block;
    transition: all 0.15s ease;
}

ul#provin2 a:hover, ul#provin3 a:hover {
    color: var(--primary);
    transform: translateX(4px);
}

/* Legacy: .vc_row, .row, .col-md-3, etc. */
.row, .vc_row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

.col-md-3, .col-sm-6, .col-md-4, .col-md-6, .col-md-12, .wpb_column {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    width: 100%;
}

@media (min-width: 768px) {
    .col-sm-6 { width: 50%; }
    .col-md-4 { width: 33.333333%; }
    .col-md-3 { width: 25%; }
    .col-md-6 { width: 50%; }
}

/* Legacy buttons */
.vl-btn, .vl-btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.125rem;
    background-color: var(--primary);
    color: #ffffff !important;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    transition: background-color 0.15s ease;
    margin-bottom: 0.5rem;
}

.vl-btn:hover, .vl-btn-primary:hover {
    background-color: var(--primary-hover);
    color: #ffffff !important;
}

/* ==========================================================================
   TOAST NOTIFICATION (COPY CLIPBOARD)
   ========================================================================== */

.cp-toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--navy);
    color: #ffffff;
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    font-size: 0.9375rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    z-index: 9999;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.cp-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-icon {
    color: var(--success);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
    background: var(--navy);
    color: #94a3b8;
    margin-top: auto;
    border-top: 1px solid var(--navy-surface);
}

.footer-top {
    padding: 4rem 0 3rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2.5rem;
}

.footer-brand h4 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.75rem;
}

.footer-brand p {
    font-size: 0.9375rem;
    line-height: 1.6;
    max-width: 320px;
}

.footer-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.25rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.625rem;
}

.footer-links a {
    color: #94a3b8;
    font-size: 0.9375rem;
    transition: color 0.15s ease;
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.5rem 0;
    font-size: 0.875rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */

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

@media (max-width: 768px) {
    .header-inner {
        height: 64px;
    }
    .nav-toggle {
        display: block;
    }
    .main-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: #ffffff;
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        border-bottom: 1px solid var(--border);
    }
    .main-nav.open {
        display: flex;
    }
    .nav-link {
        width: 100%;
        padding: 0.75rem 1rem;
    }
    .hero-title {
        font-size: 2rem;
    }
    .hero-subtitle {
        font-size: 1rem;
    }
    .features-grid {
        grid-template-columns: 1fr;
    }
    .features-section {
        margin-top: 1.5rem;
    }
    .provinces-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .page-card {
        padding: 1.5rem;
    }
    .page-title {
        font-size: 1.75rem;
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .provinces-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   GEOGRAPHIC INFO, LEAFLET MAP & OPEN-METEO WEATHER
   ========================================================================== */

.cp-geo-card {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0 2rem;
    box-shadow: var(--shadow-sm);
}

.cp-geo-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding-right: 1.5rem;
    border-right: 1px solid var(--border);
}

.cp-geo-item:last-child {
    border-right: none;
}

.cp-geo-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.cp-geo-value {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1rem;
    color: var(--navy);
}

.cp-municipality-features {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    margin: 2.5rem 0 1.5rem;
}

.cp-feature-block {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
}

.cp-feature-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.cp-feature-title svg {
    color: var(--primary);
}

.cp-map-box {
    width: 100%;
    height: 420px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    background: #e2e8f0;
}

.cp-weather-box {
    background: linear-gradient(to bottom, #ffffff, #f8fafc);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.75rem;
}

.cp-weather-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    padding: 2.5rem;
    justify-content: center;
}

.cp-weather-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

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

.current-icon {
    font-size: 4rem;
    line-height: 1;
}

.current-temp {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--navy);
    line-height: 1;
    display: block;
    margin-bottom: 0.35rem;
}

.current-desc {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main);
    display: block;
}

.current-feels {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.current-metrics {
    display: flex;
    gap: 1rem;
}

.metric-item {
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    box-shadow: var(--shadow-sm);
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.metric-val {
    font-weight: 700;
    font-size: 1rem;
    color: var(--navy);
}

.forecast-header {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cp-forecast-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
}

.cp-forecast-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.125rem 0.75rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.15s ease;
    box-shadow: var(--shadow-sm);
}

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

.cp-forecast-card.active {
    background: var(--primary-light);
    border-color: var(--primary-border);
}

.forecast-day {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--navy);
}

.forecast-icon {
    font-size: 2rem;
    line-height: 1;
    margin: 0.25rem 0;
}

.forecast-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.2;
    height: 2.4em;
    overflow: hidden;
}

.forecast-temps {
    display: flex;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.9375rem;
}

.temp-max { color: #dc2626; }
.temp-min { color: #2563eb; }

.forecast-rain {
    font-size: 0.75rem;
    color: #0284c7;
    font-weight: 600;
}

.cp-weather-footer {
    margin-top: 1.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-light);
    text-align: right;
}

@media (max-width: 768px) {
    .cp-forecast-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .current-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .current-metrics {
        width: 100%;
        justify-content: space-between;
    }
    .metric-item {
        flex: 1;
    }
}

/* ==========================================================================
   HUB HERO & MODERN DIRECTORY STYLES (PROVINCIAS & CCAA)
   ========================================================================== */

.hub-hero {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 3rem 2.5rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.hub-hero.province-hero,
.hub-hero.community-hero {
    color: #ffffff;
    border: none;
    box-shadow: var(--shadow-lg);
}

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

.hero-top-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.hero-tag-link {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    color: #ffffff;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.hero-tag-link:hover {
    background: rgba(255, 255, 255, 0.35);
    color: #ffffff;
}

.hub-title {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--navy);
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hub-subtitle {
    font-size: 1.0625rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.75rem;
}

.hero-metrics-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
}

.metric-pill {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #cbd5e1;
    font-weight: 600;
}

.metric-val {
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffffff;
}

/* Filter Box */
.hub-filter-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 540px;
}

.hub-search-input-box {
    position: relative;
    display: flex;
    align-items: center;
}

.hub-search-icon {
    position: absolute;
    left: 1.1rem;
    color: var(--text-light);
    pointer-events: none;
}

.hub-filter-input {
    width: 100%;
    padding: 0.875rem 2.75rem 0.875rem 3rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.9375rem;
    color: var(--navy);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    outline: none;
}

.hub-filter-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.hub-clear-btn {
    position: absolute;
    right: 1rem;
    background: #e2e8f0;
    color: #475569;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.hub-clear-btn:hover {
    background: #cbd5e1;
    color: #0f172a;
}

.hub-counter {
    font-size: 0.8125rem;
    color: var(--text-muted);
    padding-left: 0.5rem;
}

.hub-no-results {
    text-align: center;
    padding: 4rem 2rem;
    background: #ffffff;
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    margin: 2rem 0;
}

.hub-no-results p {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* Comunidades Grid */
.ccaa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.75rem;
    margin-bottom: 3.5rem;
}

.ccaa-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
}

.ccaa-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-border);
}

.ccaa-card-media {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #0f172a;
}

.ccaa-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.ccaa-card:hover .ccaa-card-img {
    transform: scale(1.06);
}

.ccaa-media-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.7) 0%, rgba(15, 23, 42, 0.1) 60%);
}

.ccaa-media-badges {
    position: absolute;
    bottom: 0.875rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2;
}

.ccaa-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(8px);
}

.capital-badge {
    background: rgba(255, 255, 255, 0.9);
    color: var(--navy);
}

.prov-count-badge {
    background: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ccaa-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ccaa-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 0.5rem;
}

.ccaa-card-title {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.25;
    margin: 0;
}

.ccaa-card-title a {
    color: var(--navy);
    transition: color 0.15s ease;
}

.ccaa-card-title a:hover {
    color: var(--primary);
}

.ccaa-muni-count {
    font-size: 0.8125rem;
    color: var(--text-muted);
    background: var(--bg-body);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    white-space: nowrap;
    border: 1px solid var(--border);
    font-weight: 500;
}

.ccaa-card-provinces {
    margin-bottom: 1.5rem;
    flex: 1;
}

.ccaa-provinces-title {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    font-weight: 700;
    margin-bottom: 0.6rem;
}

.ccaa-pills-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.ccaa-prov-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.55rem;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--navy);
    transition: all 0.15s ease;
}

.ccaa-prov-pill:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.pill-prefix {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--primary);
    font-size: 0.75rem;
}

.ccaa-card-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.ccaa-link-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary);
    transition: color 0.15s ease;
}

.ccaa-link-btn:hover {
    color: var(--primary-hover);
}

.ccaa-link-btn svg {
    transition: transform 0.2s ease;
}

.ccaa-link-btn:hover svg {
    transform: translateX(4px);
}

/* 52 Provinces Photo Grid */
.provinces-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3.5rem;
}

.prov-photo-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
}

.prov-photo-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-border);
}

.prov-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
}

.prov-card-media {
    position: relative;
    height: 150px;
    overflow: hidden;
    background: #0f172a;
}

.prov-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.prov-photo-card:hover .prov-card-img {
    transform: scale(1.08);
}

.prov-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.7) 0%, transparent 60%);
}

.prov-prefix-pill {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: 0.03em;
}

.prov-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

.prov-card-header {
    margin-bottom: 1rem;
}

.prov-card-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--navy);
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.prov-photo-card:hover .prov-card-title {
    color: var(--primary);
}

.prov-tag-com {
    font-size: 0.8125rem;
    color: var(--text-muted);
    display: block;
}

.prov-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
}

.prov-muni-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.prov-arrow-icon {
    color: var(--text-light);
    display: flex;
    transition: transform 0.2s ease, color 0.2s ease;
}

.prov-photo-card:hover .prov-arrow-icon {
    transform: translateX(3px);
    color: var(--primary);
}

/* Municipality Grid in Province Hub */
.muni-directory-section {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 3.5rem;
}

.muni-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 0.75rem;
}

.muni-card-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--navy);
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.15s ease;
}

.muni-card-item:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.muni-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.muni-arrow {
    color: var(--text-light);
    opacity: 0.6;
    display: flex;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.muni-card-item:hover .muni-arrow {
    transform: translateX(3px);
    opacity: 1;
    color: var(--primary);
}

/* SEO Cards on Directory Pages */
.hub-seo-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 3rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 3.5rem;
}

.hub-seo-card h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 1rem;
}

.hub-seo-card p {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.territorial-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: var(--bg-body);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.25rem;
    letter-spacing: -0.02em;
}

.stat-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 600;
}

@media (max-width: 900px) {
    .territorial-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .ccaa-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .hub-hero {
        padding: 2rem 1.5rem;
    }
    .hub-title {
        font-size: 1.75rem;
    }
    .territorial-stats-row {
        grid-template-columns: 1fr;
    }
    .muni-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   MEGA-MENU, DROPDOWNS & NAVIGATION ENHANCEMENTS
   ========================================================================== */

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-has-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
}

.chevron-icon {
    transition: transform 0.2s ease;
    opacity: 0.7;
}

.nav-item:hover .chevron-icon,
.nav-item.is-open .chevron-icon {
    transform: rotate(180deg);
    opacity: 1;
}

.has-megamenu:hover > .nav-link,
.has-megamenu.is-open > .nav-link {
    color: var(--primary);
    background-color: var(--primary-light);
}

/* Wide Mega-Menu for 52 Provincias */
.megamenu-panel {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    width: 980px;
    max-width: min(980px, calc(100vw - 2rem));
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px -10px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15, 23, 42, 0.05);
    padding: 1.5rem 1.75rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    transition-delay: 0.18s;
    z-index: 1000;
}

/* Invisible bridge pseudo-element covering the boundary so hover is never lost */
.megamenu-panel::before {
    content: '';
    position: absolute;
    top: -24px;
    left: 0;
    right: 0;
    height: 28px;
    background: transparent;
}

.has-megamenu:hover .megamenu-panel,
.has-megamenu:focus-within .megamenu-panel,
.has-megamenu.is-open .megamenu-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
    transition-delay: 0s;
}

.megamenu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.megamenu-title {
    font-size: 1.0625rem;
    font-weight: 800;
    color: var(--navy);
    margin: 0 0 0.2rem;
}

.megamenu-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.megamenu-all-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary);
    padding: 0.4rem 0.85rem;
    background: var(--primary-light);
    border-radius: var(--radius-full);
    transition: all 0.15s ease;
    white-space: nowrap;
}

.megamenu-all-link:hover {
    background: var(--primary);
    color: #ffffff;
}

.megamenu-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem 0.75rem;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.megamenu-grid::-webkit-scrollbar {
    width: 6px;
}
.megamenu-grid::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.megamenu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm);
    color: var(--navy);
    font-size: 0.84rem;
    font-weight: 600;
    transition: all 0.15s ease;
}

.megamenu-item:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: translateX(2px);
}

.mega-code {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-body);
    border: 1px solid var(--border);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    width: 26px;
    text-align: center;
}

.megamenu-item:hover .mega-code {
    color: var(--primary);
    border-color: var(--primary-border);
    background: #ffffff;
}

.mega-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mega-Menu for 19 CCAA (Same wide layout as Provincias, ZERO scrollbars) */
.megamenu-panel.megamenu-ccaa {
    width: 840px;
}

.megamenu-grid-ccaa {
    grid-template-columns: repeat(3, 1fr);
    max-height: none;
    overflow: visible;
    padding-right: 0;
}

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

.dropdown-item-badge {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-body);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
}

/* Highlight Nav Item for Excel Downloads */
.nav-link-highlight {
    background: #ecfdf5;
    color: #047857 !important;
    border: 1px solid #a7f3d0;
    gap: 0.4rem;
}

.nav-link-highlight:hover {
    background: #059669 !important;
    color: #ffffff !important;
    border-color: #059669;
}

.nav-badge-pill {
    background: #10b981;
    color: #ffffff;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
}

.nav-link-highlight:hover .nav-badge-pill {
    background: #064e3b;
}

/* ==========================================================================
   DOWNLOAD HUB STYLES (EXCEL & CSV)
   ========================================================================== */

.download-hero {
    background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
    border-color: #bbf7d0;
}

.download-badges-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.25rem;
}

.dl-badge {
    font-size: 0.8125rem;
    font-weight: 700;
    background: #ffffff;
    color: var(--navy);
    border: 1px solid var(--border);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
}

.downloads-section {
    margin-bottom: 3.5rem;
}

.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.download-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    position: relative;
}

.download-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-border);
}

.download-card.card-featured {
    border-color: #10b981;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.12);
}

.featured-badge {
    position: absolute;
    top: -10px;
    right: 1.5rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.75rem;
    border-radius: var(--radius-full);
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.dl-card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.excel-icon {
    background: #ecfdf5;
    color: #059669;
}

.csv-icon {
    background: var(--primary-light);
    color: var(--primary);
}

.geo-icon {
    background: #eff6ff;
    color: #2563eb;
}

.dl-card-tags {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.dl-format-tag {
    font-size: 0.6875rem;
    font-weight: 800;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.format-excel {
    background: #dcfce7;
    color: #15803d;
}

.format-csv {
    background: #e0e7ff;
    color: #3730a3;
}

.dl-size-tag {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 600;
}

.dl-card-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--navy);
    line-height: 1.3;
    margin-bottom: 0.6rem;
}

.dl-card-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.9375rem;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn-excel {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
}

.btn-excel:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-csv {
    background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
    color: #ffffff;
}

.btn-csv:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Future Extensible Files */
.future-files-box {
    background: #ffffff;
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    margin-bottom: 3.5rem;
}

.future-files-header {
    margin-bottom: 1.5rem;
}

.future-files-header h3 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--navy);
    margin: 0.5rem 0 0.3rem;
}

.future-files-header p {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.future-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
}

.future-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.future-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.future-item strong {
    display: block;
    color: var(--navy);
    font-size: 0.9375rem;
    margin-bottom: 0.2rem;
}

.future-item span {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: block;
}

/* Schema Table */
.data-schema-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.data-schema-table th,
.data-schema-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-schema-table th {
    background: var(--bg-body);
    color: var(--navy);
    font-weight: 700;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.data-schema-table code {
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    color: #e11d48;
    font-size: 0.84rem;
}

/* Mobile Nav Styles */
@media (max-width: 1024px) {
    .nav-toggle {
        display: block;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        background: #ffffff;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
        flex-direction: column;
        padding: 1rem 1.5rem;
        gap: 0.5rem;
        max-height: calc(100vh - 72px);
        overflow-y: auto;
        z-index: 999;
    }

    .main-nav.nav-open {
        display: flex;
    }

    .nav-item {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .nav-link {
        width: 100%;
        justify-content: space-between;
    }

    .megamenu-panel::before {
        display: none;
    }

    .megamenu-panel,
    .dropdown-panel {
        position: static;
        transform: none !important;
        width: 100%;
        max-width: 100%;
        box-shadow: none;
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        display: none;
        margin-top: 0.5rem;
        padding: 1rem;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .has-megamenu.active-mobile .megamenu-panel,
    .has-dropdown.active-mobile .dropdown-panel {
        display: block;
    }

    .megamenu-grid {
        grid-template-columns: repeat(2, 1fr);
        max-height: 280px;
    }
}

/* ==========================================================================
   CONTACT PAGE & SUPPORT STYLES
   ========================================================================== */

.contact-hero {
    background: linear-gradient(135deg, #0b1329 0%, #1e3a8a 60%, #1e40af 100%);
    color: #ffffff;
    padding: 3.5rem 0 4rem;
    position: relative;
    border-radius: var(--radius-lg);
    margin-bottom: 2.5rem;
    text-align: center;
}

.contact-section {
    margin-bottom: 4rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 2.5rem;
    align-items: start;
}

@media (max-width: 960px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Left Column: Info Cards */
.contact-welcome-box {
    margin-bottom: 1.75rem;
}

.contact-side-title {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--navy);
    line-height: 1.25;
    margin-bottom: 0.6rem;
}

.contact-side-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.contact-cards-stack {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    margin-bottom: 2rem;
}

.contact-card {
    display: flex;
    gap: 1.15rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.4rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

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

.contact-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-blue {
    background: #eff6ff;
    color: #2563eb;
}

.icon-green {
    background: #ecfdf5;
    color: #059669;
}

.icon-amber {
    background: #fef3c7;
    color: #d97706;
}

.contact-card-body h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.25rem;
}

.contact-card-body p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin: 0;
}

/* Direct email pill */
.contact-direct-box {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.direct-badge {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}

.direct-email-link {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: #60a5fa;
    font-size: 1.1rem;
    font-weight: 700;
    transition: color 0.15s ease;
    word-break: break-all;
}

.direct-email-link:hover {
    color: #93c5fd;
    text-decoration: underline;
}

/* Right Column: Modern Form Card */
.contact-form-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.25rem 2.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
}

@media (max-width: 640px) {
    .contact-form-card {
        padding: 1.5rem 1.25rem;
    }
}

.form-header {
    margin-bottom: 1.75rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-light);
}

.form-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 0.35rem;
}

.form-desc {
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 640px) {
    .form-row-2 {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.45rem;
}

.form-label .req {
    color: #ef4444;
}

.form-label .opt {
    color: var(--text-light);
    font-weight: 400;
    font-size: 0.8125rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.15s ease;
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.75rem;
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--navy);
    background-color: #ffffff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.input-wrapper:focus-within .input-icon {
    color: var(--primary);
}

.form-control.is-invalid {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7 7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 14px;
    padding-right: 2.5rem;
}

.form-textarea {
    padding: 0.85rem 1rem;
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}

.field-error {
    display: none;
    font-size: 0.8125rem;
    color: #ef4444;
    margin-top: 0.35rem;
    font-weight: 500;
}

.field-error.show {
    display: block;
}

/* Custom Checkbox */
.form-group-checkbox {
    margin: 1.5rem 0;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    position: relative;
    user-select: none;
}

.checkbox-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkbox-checkmark {
    width: 20px;
    height: 20px;
    background-color: #ffffff;
    border: 2px solid var(--border);
    border-radius: 4px;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-container:hover .checkbox-checkmark {
    border-color: var(--primary);
}

.checkbox-container input:checked ~ .checkbox-checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkbox-container input:checked ~ .checkbox-checkmark::after {
    content: '';
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.checkbox-text {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.checkbox-text a {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 600;
}

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

/* Actions and Submit Button */
.form-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-submit-contact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.95rem 1.75rem;
    background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-submit-contact:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-submit-contact:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: cp-spin 0.8s linear infinite;
}

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

.form-security-note {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    color: var(--text-light);
    text-align: center;
}

/* Alert response banner */
.form-response-banner {
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}

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

.form-response-banner.banner-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    font-weight: 600;
}

.form-response-banner.banner-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* Frequently Asked Questions */
.contact-faq-section {
    margin-top: 4.5rem;
    padding-top: 3.5rem;
    border-top: 1px solid var(--border);
    margin-bottom: 4rem;
}

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

@media (max-width: 768px) {
    .faq-grid {
        grid-template-columns: 1fr;
    }
}

.faq-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.faq-question {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.75rem;
}

.faq-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 800;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.faq-question h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--navy);
    line-height: 1.35;
    margin: 0;
}

.faq-answer {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
    padding-left: 2.6rem;
}

.faq-answer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
}

/* CF7 Generic Fallback Modernization */
.wpcf7-form {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.wpcf7-form p {
    margin-bottom: 1.25rem;
}

.wpcf7-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.35rem;
}

.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--navy);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wpcf7-form input[type="text"]:focus,
.wpcf7-form input[type="email"]:focus,
.wpcf7-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.wpcf7-form input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.9rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
    transition: all 0.2s ease;
}

.wpcf7-form input[type="submit"]:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
}

/* ==========================================================================
   TECHNICAL LANDING PAGES (API, GEOJSON, SQL, JSON, PROVINCIAS)
   ========================================================================== */

.tech-hero {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2.5rem 2rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.tech-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, #0891b2 50%, #10b981 100%);
}

.tech-hero-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.tech-hero-content {
    flex: 1;
    min-width: 300px;
}

.tech-hero-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 240px;
}

.tech-hero-title {
    font-size: 2.15rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--navy);
    line-height: 1.25;
    margin: 0.6rem 0 0.85rem;
}

.tech-hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 780px;
}

.tech-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-light);
}

.tech-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0.3rem 0.85rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--navy-light);
}

.tech-meta-chip.chip-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #047857;
}

.tech-meta-chip.chip-primary {
    background: var(--primary-light);
    border-color: var(--primary-border);
    color: var(--primary);
}

/* Content Sections */
.tech-section {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-sm);
}

.tech-section-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.tech-section-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Dark Code Terminal & Tabs */
.code-terminal-box {
    background: #0f172a;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid #1e293b;
    margin: 1.25rem 0;
}

.code-terminal-header {
    background: #1e293b;
    padding: 0.65rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #334155;
}

.code-terminal-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: #94a3b8;
    font-weight: 600;
}

.terminal-dots {
    display: flex;
    gap: 5px;
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.code-tabs-nav {
    display: flex;
    gap: 0.35rem;
}

.code-tab-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.code-tab-btn:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.08);
}

.code-tab-btn.active {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.15);
}

.btn-copy-code {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-copy-code:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.code-terminal-pre {
    margin: 0;
    padding: 1.25rem 1.5rem;
    color: #e2e8f0;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.65;
    overflow-x: auto;
    background: #0f172a;
}

.code-tab-panel {
    display: none;
}

.code-tab-panel.active {
    display: block;
}

/* API Interactive Sandbox */
.api-sandbox-card {
    background: #f8fafc;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin: 1.5rem 0;
}

.sandbox-input-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.sandbox-method {
    background: #10b981;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.875rem;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    border-radius: var(--radius-md);
    letter-spacing: 0.05em;
}

.sandbox-url-field {
    flex: 1;
    min-width: 250px;
    height: 48px;
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    padding: 0 1rem;
    background: #ffffff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    color: var(--navy);
}

.sandbox-url-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-sandbox-run {
    height: 48px;
    padding: 0 1.5rem;
    background: var(--primary);
    color: #ffffff;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-sandbox-run:hover {
    background: var(--primary-hover);
}

.sandbox-examples {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    font-size: 0.84rem;
    color: var(--text-muted);
}

.sandbox-example-chip {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0.25rem 0.65rem;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--primary);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.15s ease;
}

.sandbox-example-chip:hover {
    background: var(--primary-light);
    border-color: var(--primary-border);
}

.sandbox-output-wrap {
    margin-top: 1rem;
}

.sandbox-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8125rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

/* Step Guides (QGIS, SQL, etc.) */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.step-card {
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    position: relative;
    display: flex;
    flex-direction: column;
}

.step-badge {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: #ffffff;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9375rem;
    margin-bottom: 0.85rem;
}

.step-card h4 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 0.5rem;
}

.step-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin: 0;
}

/* Technical Data Tables */
.doc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin: 1.25rem 0;
    background: #ffffff;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
}

.doc-table th {
    background: #f8fafc;
    text-align: left;
    padding: 0.85rem 1.1rem;
    font-weight: 700;
    color: var(--navy);
    border-bottom: 1.5px solid var(--border);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.doc-table td {
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--navy-light);
    line-height: 1.5;
}

.doc-table tr:last-child td {
    border-bottom: none;
}

.doc-table code {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    background: #f1f5f9;
    color: #0f172a;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
}

/* Related Formats Cross-linking Grid */
.related-formats-box {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border);
    margin-bottom: 4rem;
}

.related-formats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.related-format-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

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

.related-format-card h4 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 0.35rem;
}

.related-format-card p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.45;
    margin: 0;
}

.related-format-card .rfc-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 0.85rem;
}

/* Downloads & API Megamenu Dropdown */
.megamenu-panel.megamenu-downloads {
    width: 620px;
    max-width: min(620px, calc(100vw - 2rem));
}

.megamenu-downloads-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.dl-menu-col {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dl-menu-col-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-light);
}

.dl-menu-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.55rem 0.65rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.dl-menu-item:hover {
    background: var(--bg-body);
    border-color: var(--border-light);
    transform: translateX(2px);
}

.dl-menu-item-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.dl-menu-item-icon.icon-excel { background: #ecfdf5; color: #059669; }
.dl-menu-item-icon.icon-zip { background: #eef2ff; color: #4f46e5; }
.dl-menu-item-icon.icon-api { background: #eff6ff; color: #2563eb; }
.dl-menu-item-icon.icon-geo { background: #ecfeff; color: #0891b2; }
.dl-menu-item-icon.icon-sql { background: #f3e8ff; color: #7e22ce; }
.dl-menu-item-icon.icon-json { background: #fef3c7; color: #d97706; }

.dl-menu-item-body {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.dl-menu-item-body strong {
    font-size: 0.875rem;
    color: var(--navy);
    font-weight: 700;
}

.dl-menu-item:hover .dl-menu-item-body strong {
    color: var(--primary);
}

.dl-menu-item-body span {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
    line-height: 1.35;
}

@media (max-width: 1024px) {
    .megamenu-panel.megamenu-downloads {
        width: 100%;
        max-width: 100%;
    }
    .megamenu-downloads-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

/* ==========================================================================
   COOKIE CONSENT BANNER (RGPD / AEPD COMPLIANCE)
   ========================================================================== */
.cp-cookie-banner {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    max-width: 440px;
    width: calc(100vw - 3rem);
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(24px) scale(0.97);
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.35s ease;
    pointer-events: none;
}

.cp-cookie-banner.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.cp-cookie-card {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 1.25rem;
    padding: 1.5rem;
    box-shadow: 0 20px 30px -10px rgba(15, 23, 42, 0.18),
                0 10px 15px -5px rgba(15, 23, 42, 0.08),
                0 0 0 1px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    color: var(--text-dark, #1e293b);
}

.cp-cookie-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cp-cookie-icon-wrapper {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #eff6ff;
    color: var(--primary, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cp-cookie-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--navy, #0f172a);
    margin: 0;
    line-height: 1.3;
}

.cp-cookie-text {
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--text-muted, #475569);
    margin: 0;
}

.cp-cookie-text a {
    color: var(--primary, #2563eb);
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.15s ease;
}

.cp-cookie-text a:hover {
    color: var(--primary-dark, #1d4ed8);
}

.cp-cookie-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.cp-cookie-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.7rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    line-height: 1.25;
}

.cp-cookie-btn-primary {
    background: var(--primary, #2563eb);
    color: #ffffff;
    border: 1px solid var(--primary, #2563eb);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.cp-cookie-btn-primary:hover {
    background: var(--primary-dark, #1d4ed8);
    border-color: var(--primary-dark, #1d4ed8);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.cp-cookie-btn-secondary {
    background: #f8fafc;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.cp-cookie-btn-secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
    transform: translateY(-1px);
}

.cp-cookie-btn:active {
    transform: translateY(0);
}

.cp-cookie-footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    padding-top: 0.25rem;
    border-top: 1px solid var(--border-light, #f1f5f9);
}

.cp-cookie-footer-links a {
    color: var(--text-muted, #64748b);
    text-decoration: none;
    transition: color 0.15s ease;
}

.cp-cookie-footer-links a:hover {
    color: var(--primary, #2563eb);
    text-decoration: underline;
}

.cp-cookie-bullet {
    color: #cbd5e1;
}

.cp-cookie-settings-link {
    cursor: pointer;
}

@media (max-width: 640px) {
    .cp-cookie-banner {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100vw;
        max-width: 100vw;
        transform: translateY(100%);
    }

    .cp-cookie-banner.is-visible {
        transform: translateY(0);
    }

    .cp-cookie-card {
        border-radius: 1.25rem 1.25rem 0 0;
        border-bottom: none;
        border-left: none;
        border-right: none;
        padding: 1.25rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -10px 25px rgba(15, 23, 42, 0.15);
    }

    .cp-cookie-actions {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }
}



