html,
body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

.agdp-territory-page {
    min-height: 100vh;
    height: auto;
}

.agdp-territory-page .brand {
    color: inherit;
    text-decoration: none;
}

.territory-main {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    padding: 34px 0 70px;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 38px;
    color: #9aa8bb;
    font-size: 14px;
}

.breadcrumbs a {
    color: #c9d4e3;
    text-decoration: none;
}

.breadcrumbs strong {
    color: #d4af37;
}

.territory-hero {
    max-width: 900px;
    margin-bottom: 38px;
}

.territory-tag {
    display: inline-block;
    margin-bottom: 16px;
    color: #d4af37;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.8px;
}

.territory-hero h1 {
    margin: 0;
    font-size: clamp(38px, 6vw, 68px);
    line-height: 1.05;
}

.territory-hero h1 span {
    display: block;
    margin-top: 8px;
    color: #9aa8bb;
    font-size: .42em;
    font-weight: 500;
}

.territory-comarca {
    margin: 16px 0 0;
    color: #d4af37;
    font-size: 17px;
}

.territory-intro {
    max-width: 800px;
    margin: 24px 0 0;
    color: #c8d2df;
    font-size: 19px;
    line-height: 1.7;
}

.territory-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin: 34px 0;
}

.territory-stats article,
.territory-panel {
    border: 1px solid rgba(212, 175, 55, .20);
    border-radius: 18px;
    background: rgba(9, 21, 37, .72);
    box-shadow: 0 18px 45px rgba(0, 0, 0, .18);
}

.territory-stats article {
    padding: 24px;
}

.territory-stats strong {
    display: block;
    margin-bottom: 7px;
    color: #d4af37;
    font-size: 34px;
}

.territory-stats span {
    color: #aeb9c8;
}

.territory-panel {
    margin-top: 24px;
    padding: 30px;
}

.territory-panel h2 {
    margin: 0 0 10px;
    font-size: 25px;
}

.territory-panel > p {
    max-width: 850px;
    color: #aeb9c8;
    line-height: 1.65;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 24px;
}

.category-card {
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 13px;
    background: rgba(255, 255, 255, .025);
}

.category-card strong {
    display: block;
    color: #d4af37;
    font-size: 25px;
}

.category-card span {
    display: block;
    margin-top: 5px;
    color: #c8d2df;
}

.source-list {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}

.source-list a {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 17px 19px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    color: white;
    text-decoration: none;
}

.source-list a:hover {
    border-color: rgba(212, 175, 55, .45);
}

.source-list span {
    color: #8997aa;
    font-size: 14px;
}

.territory-cta {
    display: inline-block;
    margin-top: 12px;
    padding: 13px 19px;
    border-radius: 10px;
    background: #d4af37;
    color: #07101d;
    font-weight: 700;
    text-decoration: none;
}

.territory-footer {
    padding: 28px 24px;
    border-top: 1px solid rgba(212, 175, 55, .16);
    color: #7f8da0;
    text-align: center;
    font-size: 13px;
}

@media (max-width: 800px) {
    .agdp-territory-page .topbar {
        height: auto;
        min-height: 90px;
        padding: 16px 22px;
        gap: 15px;
        flex-wrap: wrap;
    }

    .agdp-territory-page .topbar nav {
        width: 100%;
        gap: 18px;
        overflow-x: auto;
    }

    .territory-main {
        width: min(100% - 28px, 1180px);
        padding-top: 25px;
    }

    .territory-stats,
    .category-grid {
        grid-template-columns: 1fr;
    }

    .source-list a {
        flex-direction: column;
        gap: 5px;
    }
}

.territory-directory {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 24px;
}

.territory-directory > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 18px 20px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 13px;
    background: rgba(255, 255, 255, .025);
    color: white;
    text-decoration: none;
}

.territory-directory > a:hover {
    border-color: rgba(212, 175, 55, .45);
}

.territory-directory strong {
    display: block;
    color: #e8edf4;
}

.territory-directory span {
    display: block;
    margin-top: 5px;
    color: #8997aa;
    font-size: 13px;
}

.directory-count {
    flex: 0 0 auto;
    color: #d4af37;
    font-size: 21px;
    font-weight: 700;
    text-align: right;
}

.directory-count small {
    display: block;
    color: #8997aa;
    font-size: 11px;
    font-weight: 400;
}

@media (max-width: 800px) {
    .territory-directory {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   AGDP SEO · TERRITORIO COMPACTO · DESKTOP 90%
   ========================================================= */

html,
body {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

.agdp-territory-page {
    height: auto !important;
    min-height: 100vh !important;
    overflow: visible !important;
}

@media (min-width: 801px) {

    .territory-main {
        width: min(1240px, calc(100% - 56px));
        padding: 14px 0 24px;
    }

    .breadcrumbs {
        margin-bottom: 12px;
        gap: 7px;
        font-size: 12px;
    }

    .territory-hero {
        max-width: 1050px;
        margin-bottom: 12px;
    }

    .territory-tag {
        margin-bottom: 5px;
        font-size: 11px;
        letter-spacing: 1.4px;
    }

    .territory-hero h1 {
        font-size: clamp(32px, 3.2vw, 44px);
        line-height: 1;
    }

    .territory-hero h1 span {
        margin-top: 3px;
        font-size: .36em;
    }

    .territory-comarca {
        margin-top: 6px;
        font-size: 14px;
    }

    .territory-intro {
        max-width: 1050px;
        margin-top: 8px;
        font-size: 14px;
        line-height: 1.35;
    }

    .territory-stats {
        gap: 10px;
        margin: 12px 0;
    }

    .territory-stats article {
        padding: 10px 14px;
        border-radius: 12px;
    }

    .territory-stats strong {
        margin-bottom: 1px;
        font-size: 23px;
        line-height: 1;
    }

    .territory-stats span {
        font-size: 12px;
    }

    .territory-panel {
        margin-top: 10px;
        padding: 14px 16px;
        border-radius: 13px;
    }

    .territory-panel h2 {
        margin: 0 0 3px;
        font-size: 18px;
        line-height: 1.15;
    }

    .territory-panel > p {
        margin: 3px 0 7px;
        font-size: 12px;
        line-height: 1.35;
    }

    .territory-directory {
        gap: 6px 8px;
        margin-top: 8px;
    }

    .territory-directory > a {
        min-height: 0;
        padding: 7px 11px;
        gap: 12px;
        border-radius: 9px;
    }

    .territory-directory strong {
        font-size: 13px;
        line-height: 1.15;
    }

    .territory-directory span {
        margin-top: 2px;
        font-size: 10px;
        line-height: 1.15;
    }

    .directory-count {
        font-size: 15px;
        line-height: 1.05;
    }

    .directory-count small {
        margin-top: 2px;
        font-size: 9px;
    }

    .territory-cta {
        margin-top: 6px;
        padding: 8px 13px;
        font-size: 12px;
    }

    .territory-footer {
        padding: 12px 20px;
        font-size: 11px;
    }
}
