* {
    box-sizing: border-box;
}

:root {
    --navy: #08284b;
    --gold: #c99a3d;
    --gold-soft: #e1bd6b;
    --text: #263c52;
    --muted: #6b7d8f;
    --line: #e2e7ec;
    --cream: #fbfaf7;
    --burgundy: #6d1f32;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #ffffff;
    color: var(--text);
    font-family: "DM Sans", sans-serif;
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

.container {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}


/* =========================================================
   HEADER
   ========================================================= */

.category-header {
    background: #ffffff;
    border-bottom: 1px solid var(--line);
}

.category-nav {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
}

.brand img {
    width: 210px;
    height: auto;
    display: block;
}

.back {
    color: var(--navy);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.back:hover {
    color: var(--gold);
}


/* =========================================================
   HERO
   ========================================================= */

.category-hero {
    padding: 34px 0 70px;
    color: #ffffff;
    background:
        radial-gradient(circle at 85% 20%, rgba(201,154,61,.14), transparent 30%),
        linear-gradient(135deg, #071f38, #08284b);
}

.breadcrumb {
    margin-bottom: 50px;
    color: rgba(255,255,255,.6);
    font-size: 13px;
}

.hero-copy {
    max-width: 850px;
}

.eyebrow {
    color: var(--gold-soft);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2.5px;
}

.eyebrow.dark {
    color: var(--gold);
}

.category-hero h1 {
    margin: 14px 0 18px;
    font-family: "Playfair Display", serif;
    font-size: clamp(44px, 6vw, 76px);
    line-height: 1.02;
    font-weight: 600;
}

.category-hero p {
    max-width: 760px;
    margin: 0;
    color: rgba(255,255,255,.84);
    font-size: 18px;
    line-height: 1.65;
}

.updated {
    margin-top: 20px;
    color: rgba(255,255,255,.48);
    font-size: 12px;
}


/* =========================================================
   CONTENT
   ========================================================= */

.category-content {
    padding: 65px 0 90px;
}

.section-heading {
    max-width: 800px;
    margin-bottom: 35px;
}

.section-heading h2 {
    margin: 12px 0;
    color: var(--navy);
    font-family: "Playfair Display", serif;
    font-size: 42px;
    line-height: 1.15;
}

.section-heading h2 em {
    color: var(--gold);
    font-style: normal;
}

.section-heading p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}


/* =========================================================
   SELECTOR DE GRUPOS
   ========================================================= */

.group-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 30px;
}

.group-tab {
    position: relative;
    min-height: 94px;
    padding: 18px 62px 18px 24px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #ffffff;
    color: var(--navy);
    text-align: left;
    cursor: pointer;

    transition:
        border-color .22s ease,
        background .22s ease,
        box-shadow .22s ease,
        transform .22s ease;
}


/* Hover */
.group-tab:hover {
    border-color: rgba(201,154,61,.65);
    background: #fffdfa;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(8,40,75,.06);
}

/* Categoría seleccionada */
.group-tab.active {
    border-color: var(--gold);
    background:
        linear-gradient(
            135deg,
            #fffaf0 0%,
            #fffdf9 100%
        );

    box-shadow:
        0 10px 25px rgba(8,40,75,.07);
}

/* Número de categoría */
.group-tab::after {
    content: "";
    position: absolute;
    top: 18px;
    left: 24px;

    color: var(--gold);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
}

/* Nombre */
.group-tab-name {
    display: block;

    margin-top: 17px;

    color: var(--navy);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
}

/* Contador */
.group-tab-count {
    position: absolute;
    top: 18px;
    right: 18px;

    min-width: 38px;
    height: 38px;

    padding: 0 9px;

    display: grid;
    place-items: center;

    border: 1px solid #e4e8ed;
    border-radius: 50%;

    background: #f3f5f7;
    color: var(--navy);

    font-size: 12px;
    font-weight: 700;

    transition:
        background .22s ease,
        border-color .22s ease,
        color .22s ease;
}

.group-tab.active .group-tab-count {
    border-color: rgba(201,154,61,.35);
    background: #eadbbd;
    color: #7c5b1f;
}

/* Texto secundario */
.group-tab small {
    display: block;

    margin-top: 5px;

    color: var(--muted);
    font-size: 11px;
    line-height: 1.2;
}

/* =========================================================
   EXPLORADOR
   ========================================================= */

.explorer {
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fcfcfb;
}

.explorer-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 24px;
}

.result-label {
    color: var(--gold);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
}

.explorer-top h3 {
    margin: 8px 0 6px;
    color: var(--navy);
    font-family: "Playfair Display", serif;
    font-size: 32px;
    line-height: 1.15;
}

.explorer-top p {
    max-width: 680px;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.result-count {
    flex-shrink: 0;

    min-width: 105px;
    padding: 9px 15px;

    border: 1px solid rgba(201,154,61,.48);
    border-radius: 20px;

    color: #7c5b1f;
    background: #fffaf0;

    font-size: 12px;
    font-weight: 700;
    text-align: center;

    white-space: nowrap;
}


/* BUSCADOR */

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 22px;
}

.search-box svg {
    position: absolute;
    left: 16px;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: var(--muted);
    stroke-width: 1.6;
    stroke-linecap: round;
}

.search-box input {
    width: 100%;
    height: 50px;
    padding: 0 48px 0 46px;
    border: 1px solid #d7dfe6;
    border-radius: 7px;
    outline: none;
    background: #ffffff;
    color: var(--text);
    font-size: 14px;
}

.search-box input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201,154,61,.10);
}

.search-box input::placeholder {
    color: #9aa7b3;
}

.search-box input[type="search"]::-webkit-search-cancel-button,
.search-box input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

#clearSearch {
    position: absolute;
    right: 13px;
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    color: #8996a2;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}


/* RESULTADOS */

.tramite-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 13px;
}

.tramite-card {
    min-height: 205px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #ffffff;
    text-decoration: none;
    transition:
        transform .2s ease,
        box-shadow .2s ease,
        border-color .2s ease;
}

.tramite-card:hover {
    transform: translateY(-3px);
    border-color: rgba(201,154,61,.6);
    box-shadow: 0 12px 26px rgba(8,40,75,.08);
}

.tramite-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 18px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(201,154,61,.55);
    border-radius: 50%;
    color: var(--gold);
    font-size: 17px;
}

.tramite-card h4 {
    margin: 0 0 8px;
    color: var(--navy);
    font-family: "Playfair Display", serif;
    font-size: 20px;
    line-height: 1.22;
}

.tramite-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.tramite-card span {
    margin-top: auto;
    padding-top: 18px;
    color: var(--navy);
    font-size: 12px;
    font-weight: 700;
}

.tramite-card span b {
    color: var(--gold);
    margin-left: 4px;
}

.tramite-card:hover span {
    color: var(--gold);
}

.search-message {
    display: none;
    margin: 4px 0 20px;
    padding: 15px;
    border-radius: 7px;
    background: #fff8ed;
    color: #7c5b1f;
    font-size: 13px;
}

.search-message.visible {
    display: block;
}


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

.category-footer {
    border-top: 1px solid var(--line);
    padding: 25px 0;
    color: var(--muted);
    font-size: 12px;
}

.category-footer .container {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {

    .group-selector {
        grid-template-columns: 1fr;
    }

    .tramite-grid {
        grid-template-columns: repeat(2, 1fr);
    }

}

@media (max-width: 600px) {

    .container {
        width: min(100% - 28px, 1180px);
    }

    .category-nav {
        min-height: 70px;
    }

    .brand img {
        width: 175px;
    }

    .category-hero {
        padding: 25px 0 50px;
    }

    .category-hero h1 {
        font-size: 44px;
    }

    .category-content {
        padding: 45px 0 60px;
    }

    .section-heading h2 {
        font-size: 32px;
    }

    .explorer {
        padding: 20px;
    }

    .explorer-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .tramite-grid {
        grid-template-columns: 1fr;
    }

    .category-footer .container {
        flex-direction: column;
    }

}
