:root{
    --bg: #f4f0ea;
    --card: #ffffff;
    --text: #2d2d2d;
    --muted: #666;
    --brand: #b3003c;
    --brand-dark: #93002f;
    --border: #e3ddd4;
    --shadow: 0 8px 24px rgba(0,0,0,.08);
    --radius: 12px;
    --max: 1180px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}

a, a:visited, a:hover, a:active {
    color: inherit;
}

main.page h1 {
    color: #950041;
}

.site-header {
    background: #efe9df;
    border-bottom: 1px solid rgba(0,0,0,.05);
}

.header-inner {
    max-width: var(--max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 140px;
    gap: 0;
}

.logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: #efe9df;
}

.logo-area img {
    max-width: 100%;
    height: auto;
    max-height: 92px;
    object-fit: contain;
    display: block;
}

.title-area a {
    text-decoration: none;
}

.title-area {
    display: flex;
    align-items: center;
    padding: 24px 32px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(178,0,60,.95), rgba(146,0,47,.95)),
        radial-gradient(circle at 20% 30%, rgba(255,255,255,.12), transparent 28%),
        radial-gradient(circle at 80% 40%, rgba(255,255,255,.08), transparent 18%);
    position: relative;
    overflow: hidden;
}

.title-area::after{
    content:"";
    position:absolute;
    inset:0;
    background-image:
        linear-gradient(115deg, transparent 0 20%, rgba(255,255,255,.07) 20% 23%, transparent 23% 45%, rgba(255,255,255,.05) 45% 48%, transparent 48% 100%);
    pointer-events:none;
    mix-blend-mode: screen;
    opacity: .35;
}

.title-area h1 {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: clamp(1.4rem, 2vw, 2.2rem);
    font-weight: 600;
    letter-spacing: .2px;
}

.page {
    max-width: var(--max);
    margin: 0 auto;
    padding: 16px 16px 6px;
}

.panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 18px;
}

.panel h2 {
    margin: 0 0 18px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    padding-bottom: 12px;
    border-bottom: 1px solid #ece7df;
}

.actions {
    background: #fafafa;
    border: 1px solid #ece7df;
    border-radius: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
    margin-top: 5px;
}

.formulario-avanzado {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, 1fr);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 10px;
}

.formulario-avanzado .campo {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.formulario-avanzado .campo label {
    font-size: 14px;
    color: #333;
}

.formulario-avanzado .campo input,
.formulario-avanzado .campo select {
    width: 100%;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    box-sizing: border-box;
}

.action-card {
    padding: 18px;
}

.btn {
    appearance: none;
    border: 0;
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn-disabled {
    background: #e8e8e8;
    color: #8a8a8a;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(180deg, #bf0041, var(--brand-dark));
    color: #fff;
    box-shadow: 0 6px 18px rgba(179,0,60,.22);
}

.btn-primary:hover {
    background: linear-gradient(180deg, #ca0046, #a30034);
}

.help-text {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: .97rem;
}

.section-title {
    margin: 0 0 10px;
    font-size: 1.15rem;
    font-weight: 600;
}

.content-grid {
    display: grid;
    gap: 18px;
}

.list-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
}

.list-panel h3 {
    margin: 0 0 12px;
    font-size: 1.08rem;
    padding-bottom: 10px;
}

.site-footer{
    margin-top: 12px;
    background: #FFF;
    border-top: 1px solid #e3dccf;
}

.footer-inner{
    max-width: 1180px;
    margin: 0 auto;
    padding: 22px 16px 28px;
}

.footer-warning{
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 18px;
    align-items: start;
    padding: 10px 12px;
}

.warning-icon{
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    flex: 0 0 64px;
}

.warning-icon img{
    width: 56px;
    height: 56px;
    object-fit: contain;
    display: block;
}

.warning-text p{
    margin: 0;
    font-size: 0.90rem;
    line-height: 1.55;
    color: #4a4a4a;
}

.warning-text strong{
    color: #3a3a3a;
}

.footer-note{
    margin: 16px 0 22px;
    text-align: center;
    font-size: .9rem;
    color: #8b8176;
}

.footer-logos{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
    padding: 10px 10px;
}

.footer-logo{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    opacity: .92;
    transition: transform .18s ease, opacity .18s ease;
}

.footer-logo:hover{
    transform: translateY(-1px);
    opacity: 1;
}

.footer-logo img{
    max-height: 48px;
    max-width: 160px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

@media (max-width: 768px){
    .footer-warning{
        grid-template-columns: 1fr;
        text-align: left;
    }

    .warning-icon{
        width: 48px;
        height: 48px;
    }

    .warning-icon img{
        width: 42px;
        height: 42px;
    }

    .footer-logos{
        gap: 18px;
    }

    .footer-logo img{
        max-height: 42px;
        max-width: 140px;
    }
}

@media (max-width: 900px) {
    .header-inner {
        grid-template-columns: 1fr;
    }

    .title-area {
        min-height: 110px;
        padding: 22px;
    }

    .actions {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .page {
        padding: 18px 12px 36px;
    }

    .panel, .list-panel, .action-card {
        padding: 16px;
    }

    .title-area h1 {
        font-size: 1.25rem;
    }
}

div.hidden {
    display: none;
}


/* Buscador */

.resultados-wrap {
    background: #f5f1ea;
    padding: 16px;
    color: #5a3b33;
    font-family: Arial, sans-serif;
}

.resultados-header p {
    margin: 0 0 8px;
    color: #8a1f2b;
    font-weight: 700;
    font-size: 18px;
}

.resultados-header small {
    display: block;
    margin-bottom: 18px;
    color: #8a1f2b;
}

.resultados-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 18px;
    align-items: start;
}


.lista-resultados {
    border-top: 1px solid #d7cec6;
}

.resultado-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #d7cec6;
}

.resultado-info h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 400;
    color: #4f4a45;
}

.resultado-info p {
    margin: 3px 0 0;
    font-size: 14px;
    color: #4f4a45;
}

.resultado-info a {
    text-decoration: none;
}

.resultado-meta {
    text-align: right;
    min-width: 90px;
}

.resultado-meta .numero {
    display: block;
    font-size: 22px;
    color: #8a1f2b;
    line-height: 1;
    margin-bottom: 16px;
}

.mapa-columna {
    position: sticky;
    top: 20px;
    align-self: start;
    height: fit-content;
    z-index: 10;
}

#map {
    background: #e6e6e6;
    width: 100%;
    height: 350px;
}

.mapa-texto {
    margin: 10px 0 0 0;
    font-size: 14px;
    font-style: italic;
    color: #5a554f;
    line-height: 1.2;
}

@media (max-width: 900px) {
    .resultados-grid {
        grid-template-columns: 1fr;
    }

    #map {
        height: 300px;
    }
}


/* Paginado */
.pagination-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: 0.5rem 0;
}

.pagination-info {
    font-size: 0.95rem;
    color: #555;
    white-space: nowrap;
    flex: 0 0 auto;
}

.pagination-list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex: 0 1 auto;
}

.page-link {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: #333;
    background: #fff;
    border: 1px solid #e6e6e6;
    font-size: 0.95rem;
}

.page-item .page-link:hover {
    background: #f4f6f8;
}

.page-item.active .page-link {
    background: #9b1b5a;
    color: #fff;
    border-color: #9b1b5a;
    font-weight: 600;
}

.page-item.disabled .page-link {
    color: #999;
    background: #fafafa;
    border-color: #f0f0f0;
    pointer-events: none;
}

.ellipsis .page-link {
    pointer-events: none;
    cursor: default;
}

@media (max-width: 640px) {
    .pagination-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }

    .pagination-list {
        justify-content: flex-start;
    }
}

.tag-especialidad {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    margin: 0 0.35rem 0.35rem 0;
    border-radius: 6px;
    background: #ece8e8;
    color: #7a1540;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid #d8cfd2;
}

.boton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    padding: 0.5rem 1rem;
    border: 1px solid #cfcfcf;
    border-radius: 6px;
    background: linear-gradient(to bottom, #f5f5f5 0%, #e7e7e7 100%);
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.9),
        0 1px 2px rgba(0,0,0,0.06);
}

.boton:hover {
    background: linear-gradient(to bottom, #fbfbfb 0%, #eaeaea 100%);
    border-color: #b8b8b8;
    color: #444;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.95),
        0 2px 4px rgba(0,0,0,0.08);
}

.boton:active {
    background: linear-gradient(to bottom, #e3e3e3 0%, #f1f1f1 100%);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.10);
}

.boton-activo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    padding: 0.5rem 1rem;
    border: 1px solid #8e0e3a;
    border-radius: 6px;
    background: linear-gradient(to bottom, #ffffff 0%, #f6edf1 100%);
    color: #8e0e3a;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: default;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,1),
        inset 0 -1px 0 rgba(142,14,58,0.08),
        0 1px 3px rgba(0,0,0,0.10);
}

.otros-despachos {
    margin-top: 20px;
    border-top: 1px solid #cfc7b8;
    padding-top: 16px;
}

.tarjetas-despachos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.tarjeta-despacho {
    display: block;
    text-decoration: none;
    color: #333;
    background: #ffffff;
    border: 1px solid #d9d0c2;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.tarjeta-despacho:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.10);
    border-color: #b8ac9a;
}

.tarjeta-despacho__titulo {
    font-weight: 700;
    color: #7a0040;
    margin-bottom: 6px;
}

.tarjeta-despacho__direccion,
.tarjeta-despacho__poblacion {
    font-size: 0.95rem;
    line-height: 1.35;
}

.tarjeta-despacho__poblacion {
    margin-top: 4px;
    color: #666;
}

p.no-margin {
    padding: 0px;
    margin: 5px 0;
}

h1.no-margin {
    padding: 0px;
    margin: 0px;
}

p.centrado {
    text-align: center;
}

h1.cabecera-solida {
    color: #4f4a45 !important;

}

.btn-ver-datos {
    text-decoration: none;
    color: #FFF !important;
    font-size: 80%;
    padding: 10px;
}

.breadcrumb {
    max-width: 1200px;
    margin: 0 auto 0 auto;
    padding: 0 0 1rem 0;
    font-size: 0.9rem;
    color: #7a7a7a;
}

.breadcrumb a {
    color: #8e0e3a;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: #6f0b2e;
    text-decoration: underline;
}

.breadcrumb-separador {
    display: inline-block;
    margin: 0 0.45rem;
    color: #a8a8a8;
}

.breadcrumb [aria-current="page"] {
    color: #555;
    font-weight: 600;
}

.sin-mapa {
    position: relative;
    min-height: 320px;
    border-radius: 20px;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.08), transparent 22%),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,0.06), transparent 20%),
        linear-gradient(135deg, #1f2937 0%, #111827 45%, #0f172a 100%);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.sin-mapa::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.9), rgba(0,0,0,0.35));
    pointer-events: none;
}

.sin-mapa::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(45deg, transparent 48%, rgba(239,68,68,0.18) 49%, rgba(239,68,68,0.18) 51%, transparent 52%);
    pointer-events: none;
}

.oculto {
    display: none;
}

.footer-logos-separado {
    margin-top: 10px;
}

.no-borde {
    border: 0;
}

.gestor-captcha-info {
    font-size: small;
    font-style: italic;
}

.max-h-100 {
    max-height: 100px;
}

.max-w-100 {
    width: 100%;
}

.align-r {
    text-align: right
}

.margin-t-20 {
    margin-top: 20px;
}

.grid-1-1 {
    grid-column: 1 / -1;
}
