/* Variables personalizadas */
:root {
    --primary:       #00b2c7;
    --primary-dark:  #0097aa;
    --primary-light: #e0f7fa;
    --text-dark:     #1a1a2e;
    --text-muted:    #6c757d;
    --bg-light:      #f8fafb;
    --border-color:  #e2e8f0;
    --shadow-sm:     0 2px 8px rgba(0, 178, 199, 0.08);
    --shadow-md:     0 4px 20px rgba(0, 178, 199, 0.15);
    --radius:        0.75rem;
}

/* Overrides Bootstrap con color primario */
.btn-primary {
    background-color: var(--primary);
    border-color:     var(--primary);
    color: #fff;
}
.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--primary-dark);
    border-color:     var(--primary-dark);
    color: #fff;
}
.btn-outline-primary {
    color:        var(--primary);
    border-color: var(--primary);
}
.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color:     var(--primary);
    color: #fff;
}
.text-primary  { color: var(--primary) !important; }
.bg-primary    { background-color: var(--primary) !important; }
.border-primary{ border-color: var(--primary) !important; }
.badge.bg-primary { background-color: var(--primary) !important; }

/* Layout general */
html, body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    min-height: 100vh;
}

/* ── Navbar ──────────────────────────────────────────────── */
.navbar-brand span {
    font-weight: 700;
    letter-spacing: -0.5px;
    font-size: 0.95rem;
}
.navbar-brand .brand-dot {
    color: var(--primary);
}
.navbar.bg-white {
    box-shadow: 0 1px 12px rgba(0,0,0,0.07);
}
.nav-link {
    font-weight: 500;
    font-size: 0.92rem;
    color: var(--text-dark) !important;
    transition: color 0.2s;
}
.nav-link:hover,
.nav-link.active {
    color: var(--primary) !important;
}
.navbar-toggler {
    border-color: var(--primary);
}
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%2300b2c7' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ── Dropdown provincias ─────────────────────────────────── */
.dropdown-menu-provincias {
    min-width: 200px;
    max-height: 70vh;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 0.4rem 0;
}
.dropdown-menu-provincias .dropdown-item {
    font-size: 0.9rem;
    color: var(--text-dark);
    padding: 0.45rem 1rem;
    transition: background 0.15s, color 0.15s;
}
.dropdown-menu-provincias .dropdown-item:hover,
.dropdown-menu-provincias .dropdown-item:focus {
    background-color: var(--primary-light);
    color: var(--primary);
}

/* ── Hero / Page header ──────────────────────────────────── */
.page-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 3.5rem 0 3rem;
}
.page-hero h1 { font-weight: 700; font-size: 2rem; margin-bottom: 0.4rem; }
.page-hero .lead { opacity: 0.9; font-size: 1rem; }
.breadcrumb-item a { color: rgba(255,255,255,0.75); text-decoration: none; }
.breadcrumb-item a:hover { color: #fff; }
.breadcrumb-item.active { color: rgba(255,255,255,0.9); }
.breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,0.5); }

/* ── Cards ───────────────────────────────────────────────── */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.25s, transform 0.25s;
    background: #fff;
}
.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}
.card-provincia {
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--primary);
    border-radius: var(--radius);
    background: #fff;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-top-color 0.22s ease;
}
.card-provincia:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 28px rgba(0, 178, 199, 0.18);
    border-top-color: var(--primary-dark);
}
.card-provincia:hover .card-icon {
    background: var(--primary);
    color: #fff;
}
.card-provincia:hover .card-provincia__name {
    color: var(--primary);
}
.card-provincia:hover .card-provincia__arrow {
    transform: translateX(3px);
    color: var(--primary-dark);
}
.card-provincia__name {
    font-size: 0.97rem;
    font-weight: 700;
    color: var(--text-dark);
    transition: color 0.2s;
    line-height: 1.3;
}
.card-provincia__arrow {
    flex-shrink: 0;
    color: var(--primary);
    transition: transform 0.2s;
}
.card-juzgado {
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    background: #fff;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-left-color 0.22s ease;
}
.card-juzgado:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 28px rgba(0, 178, 199, 0.18);
    border-left-color: var(--primary-dark);
}
.card-juzgado:hover .card-icon {
    background: var(--primary);
    color: #fff;
}
.card-juzgado:hover .card-provincia__name {
    color: var(--primary);
}
.card-juzgado:hover .card-provincia__arrow {
    transform: translateX(3px);
}
.card-icon {
    width: 46px;
    height: 46px;
    background-color: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.22s ease, color 0.22s ease;
}

/* ── Info rows dentro del detalle ────────────────────────── */
.info-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}
.info-row:last-child { border-bottom: none; }
.info-icon {
    width: 36px; height: 36px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}
.info-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.info-value { font-size: 0.95rem; color: var(--text-dark); font-weight: 500; }

/* ── Mapa iframe ─────────────────────────────────────────── */
.map-wrapper {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.map-wrapper iframe {
    display: block;
    width: 100%;
    height: 380px;
    border: none;
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
    background-color: var(--text-dark);
    color: rgba(255,255,255,0.75);
    font-size: 0.88rem;
}
.footer h6 {
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.78rem;
    margin-bottom: 1rem;
}
.footer a {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    transition: color 0.2s;
}
.footer a:hover { color: var(--primary); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.25rem;
    color: rgba(255,255,255,0.4);
    font-size: 0.8rem;
}
.footer-brand-name {
    color: var(--primary);
    font-weight: 700;
}

/* ── Sección index home ──────────────────────────────────── */
.section-title {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-dark);
}
.section-title span { color: var(--primary); }

/* ── Badge total ─────────────────────────────────────────── */
.badge-total {
    display: inline-block;
    background-color: var(--primary-light);
    color: var(--primary);
    font-size: 0.73rem;
    font-weight: 700;
    border-radius: 20px;
    padding: 0.22em 0.7em;
    letter-spacing: 0.2px;
    margin-top: 0.25rem;
}

/* ── Responsive map ──────────────────────────────────────── */
@media (max-width: 767px) {
    .map-wrapper iframe { height: 260px; }
    .page-hero h1 { font-size: 1.5rem; }
}

/* ── Acordeón FAQ ────────────────────────────────────────── */
.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius) !important;
    margin-bottom: 0.6rem;
    overflow: hidden;
}
.accordion-button {
    font-weight: 600;
    font-size: 0.97rem;
    color: var(--text-dark);
    background: #fff;
    box-shadow: none !important;
}
.accordion-button:not(.collapsed) {
    color: var(--primary);
    background: var(--primary-light);
}
.accordion-button::after {
    filter: none;
}
.accordion-button:not(.collapsed)::after {
    filter: none;
}
.accordion-body {
    font-size: 0.93rem;
    color: #555;
    line-height: 1.75;
    background: #fff;
}

/* ── Artículo SEO home ───────────────────────────────────── */
.home-seo-article {
    color: var(--text-dark);
    line-height: 1.8;
    font-size: 1rem;
}
.home-seo-section {
    margin-bottom: 2.5rem;
}
.home-seo-article h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-light);
}
.home-seo-article h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-top: 1.25rem;
    margin-bottom: 0.4rem;
}
.home-seo-article p {
    color: #444;
    margin-bottom: 0.9rem;
}
.home-seo-article ul,
.home-seo-article ol {
    padding-left: 1.5rem;
    color: #444;
    margin-bottom: 1rem;
}
.home-seo-article li {
    margin-bottom: 0.45rem;
}
.home-seo-provincias {
    list-style: none;
    padding-left: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.5rem;
}
.home-seo-provincias li {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.5rem 0.85rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.home-seo-provincias a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.2s;
}
.home-seo-provincias a:hover {
    color: var(--primary);
}

/* ── Artículo detalle juzgado ────────────────────────────── */
.detalle-articulo {
    color: var(--text-dark);
    line-height: 1.75;
    font-size: 1rem;
}

/* Secciones internas del artículo */
.detalle-articulo section {
    margin-bottom: 2.5rem;
}

/* Títulos h2 del artículo */
.detalle-articulo h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-top: 0;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-light);
}

/* Títulos h3 del artículo (tramites y FAQ) */
.detalle-articulo h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-top: 0;
    margin-bottom: 0.4rem;
}

/* Cada bloque de trámite */
.tramite-item {
    background: var(--bg-light);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.tramite-item p {
    margin-bottom: 0;
    font-size: 0.95rem;
    color: #444;
}

/* Pasos numerados */
.detalle-articulo ol {
    padding-left: 1.5rem;
}
.detalle-articulo ol li {
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

/* Preguntas frecuentes */
.faq-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 0.85rem;
    background: #fff;
}
.faq-item h3 {
    font-size: 0.97rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.35rem;
}
.faq-item p {
    margin-bottom: 0;
    font-size: 0.92rem;
    color: #555;
}

/* Botón CTA sacar turno */
.cta-turno-wrapper {
    margin: 1.5rem 0;
    text-align: center;
}
.btn-turno {
    display: inline-block;
    background: var(--primary);
    color: #fff !important;
    font-weight: 700;
    font-size: 1rem;
    padding: 0.75rem 2.25rem;
    border-radius: 50px;
    text-decoration: none !important;
    box-shadow: 0 4px 14px rgba(0, 178, 199, 0.35);
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
    letter-spacing: 0.02em;
}
.btn-turno:hover {
    background: var(--primary-dark);
    box-shadow: 0 6px 20px rgba(0, 178, 199, 0.45);
    transform: translateY(-2px);
}
.btn-turno--disabled {
    background: #adb5bd;
    box-shadow: none;
    cursor: default;
}
.btn-turno--disabled:hover {
    background: #adb5bd;
    transform: none;
    box-shadow: none;
}

@media (max-width: 767px) {
    .detalle-articulo h2 { font-size: 1.15rem; }
    .btn-turno { font-size: 0.95rem; padding: 0.65rem 1.5rem; }
}

/* ── Stat cards (home) ─────────────────────────────────── */
.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
.stat-card--accent {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-color: transparent;
    color: #fff;
}
.stat-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    margin-bottom: 1rem;
}
.stat-card--accent .stat-card__icon {
    background: rgba(255,255,255,0.2);
    color: #fff;
}
.stat-card__number {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
    color: var(--primary);
    margin-bottom: 0.4rem;
    letter-spacing: -1px;
}
.stat-card--accent .stat-card__number {
    color: #fff;
}
.stat-card__label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.stat-card--accent .stat-card__label {
    color: rgba(255,255,255,0.85);
}
@media (max-width: 575px) {
    .stat-card { padding: 1.5rem 1rem; }
    .stat-card__number { font-size: 2rem; }
}

/* ── Badge tipo juzgado ──────────────────────────────────── */
.badge-tipo {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 20px;
    padding: 0.2em 0.75em;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.badge-tipo--municipal {
    background-color: #e8f4fd;
    color: #1a6fa8;
}
.badge-tipo--provincial {
    background-color: #fef3e2;
    color: #a06000;
}
