:root {
    /* Colores institucionales: vino + dorado */
    --primary-color: #581845;
    --primary-dark: #3A0F1B;
    --primary-light: #7E243B;
    --secondary-color: #D4AF37;
    --secondary-light: #F0D67A;
    --secondary-dark: #B8941E;
    --white: #FFFFFF;
    --gray-light: #F5F7FA;
    --gray: #E2E8F0;
    --gray-dark: #64748B;
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    --text-dark: #1E293B;
    --text-gray: #475569;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Fix global para evitar partes blancas (scroll lateral) en todas las páginas */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    background-image: linear-gradient(rgba(245, 247, 250, 0.9), rgba(245, 247, 250, 0.9)), url('../img/fondo.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    font-family: 'Poppins', sans-serif;
    color: var(--text-dark);
}

.navbar-institucional {
    background-color: var(--primary-color);
    border-bottom: 4px solid var(--secondary-color);
    padding: 1rem 0;
}

.navbar-brand .nav-logo {
    height: 55px;
    width: auto;
    margin-right: 10px;
}

.navbar-brand .nav-slogan {
    height: 40px;
    width: auto;
}

.refrendo-user-pill {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    padding: 0.35rem 0.75rem;
    transition: background 0.2s;
}

.refrendo-user-pill:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff !important;
}

.refrendo-tarjeta {
    border-radius: 12px !important;
}

.refrendo-page .badge-estado.bg-success,
.refrendo-page .badge-estado.bg-primary,
.refrendo-page .badge-estado.bg-info,
.refrendo-page .badge-estado.bg-secondary,
.refrendo-tarjeta .badge-estado.bg-success,
.refrendo-tarjeta .badge-estado.bg-primary,
.refrendo-tarjeta .badge-estado.bg-info,
.refrendo-tarjeta .badge-estado.bg-secondary {
    color: #fff !important;
}

.campana-activa i {
    animation: campana-ring 1.2s ease-in-out infinite;
    color: #ffd54f !important;
}

/* ===== Notificaciones estilo Facebook ===== */
.lista-alertas-menu.dropdown-menu {
    border: 0 !important;
    border-radius: 12px !important;
    overflow: hidden;
    padding: 0 !important;
}
.lista-alertas-menu .dropdown-header {
    padding: 14px 16px 10px !important;
    background: #fff !important;
    border-bottom: 1px solid #e4e6eb;
}
.lista-alertas-menu .dropdown-header .fw-bold {
    font-size: 1.15rem;
    color: #050505;
}
.fb-notif-empty {
    text-align: center;
    padding: 28px 16px;
    color: #65676b;
}
.fb-notif-empty i {
    font-size: 2rem;
    display: block;
    margin-bottom: 8px;
    color: #bcc0c4;
}
.alertas-lista {
    list-style: none;
    margin: 0;
    padding: 0;
}
.fb-notif-row {
    position: relative;
    overflow: hidden;
    background: #fff;
}
.fb-notif-actions {
    position: absolute;
    inset: 0 0 0 auto;
    width: 88px;
    background: #e41e3f;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 0;
}
.fb-notif-delete {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 1.15rem;
    width: 100%;
    height: 100%;
}
.fb-notif-front {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: stretch;
    background: #fff;
    will-change: transform;
}
.fb-notif-row.is-unread .fb-notif-front {
    background: #e7f3ff;
}
.fb-notif-main {
    flex: 1;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 8px 12px 14px;
    text-decoration: none !important;
    color: #050505 !important;
    min-width: 0;
}
.fb-notif-main:hover {
    background: rgba(0, 0, 0, 0.03);
}
.fb-notif-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.25rem;
}
.fb-notif-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.fb-notif-text {
    font-size: 0.9rem;
    line-height: 1.35;
    color: #050505;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.fb-notif-text.is-new {
    font-weight: 700;
}
.fb-notif-meta {
    font-size: 0.78rem;
    color: #65676b;
}
.fb-notif-row.is-unread .fb-notif-meta {
    color: #1877f2;
    font-weight: 600;
}
.fb-notif-tag {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 7px;
    border-radius: 8px;
    background: #fff3cd;
    color: #856404;
    font-size: 0.7rem;
    font-weight: 700;
}
.fb-notif-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #1877f2;
    flex-shrink: 0;
    margin-top: 6px;
    margin-right: 2px;
    box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.18);
}
.fb-notif-more {
    border: 0;
    background: #f0f2f5;
    color: #050505;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    margin: 8px 10px 8px 0;
    align-self: center;
    font-size: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.fb-notif-more:hover {
    background: #e4e6eb;
    color: #e41e3f;
}
.fb-notif-more i {
    font-size: 1.2rem;
}
.fb-notif-removing {
    max-height: 0 !important;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.28s ease, opacity 0.22s ease, margin 0.22s ease, padding 0.22s ease;
    margin: 0 !important;
    padding: 0 !important;
}

@keyframes campana-ring {
    0%, 100% { transform: rotate(0deg); }
    15% { transform: rotate(12deg); }
    30% { transform: rotate(-10deg); }
    45% { transform: rotate(8deg); }
    60% { transform: rotate(-6deg); }
    75% { transform: rotate(3deg); }
}

.card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
}

.card-tramite {
    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1), 0 2px 6px rgba(15, 23, 42, 0.06) !important;
    margin-bottom: 0 !important;
    background: #fff;
}

.card-tramite.border-top-dorado {
    border-top: 4px solid var(--secondary-color, #d4af37) !important;
}

/* Combobox filtrable (móvil / escritorio) */
.combo-wrap {
    position: relative;
}
.combo-dropdown {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 1050;
    max-height: min(280px, 45vh);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.15);
}
.combo-dropdown.is-open {
    display: block;
}
.combo-option {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: #fff;
    padding: 0.7rem 0.9rem;
    font-size: 0.92rem;
    color: #212529;
    border-bottom: 1px solid #f1f3f5;
}
.combo-option:last-child {
    border-bottom: 0;
}
.combo-option:hover,
.combo-option:focus {
    background: #f0f4ff;
    color: var(--primary-color, #581845);
}
.combo-empty {
    padding: 0.85rem 0.9rem;
    font-size: 0.85rem;
    color: #6c757d;
}

.card-header {
    background-color: var(--white);
    border-bottom: 1px solid var(--gray);
    font-weight: 600;
    padding: 1.25rem;
}

.bg-institucional-vino {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.bg-institucional-dorado {
    background-color: var(--secondary-color) !important;
    color: var(--primary-dark) !important;
}

/* Solo el botón primario institucional (evita texto negro en btn-warning / outlines) */
.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
}

.btn-institucional-vino {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
}

.btn-institucional-vino:hover {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
    color: var(--white) !important;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.footer-institucional {
    background-color: var(--primary-dark);
    color: white;
    padding: 0;
    margin-top: 4rem;
    width: 100%;
}

.footer-institucional img {
    max-height: none;
    /* Quitamos restricción para que abarque */
    object-fit: cover;
}

#map {
    height: 400px;
    width: 100%;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 2px solid var(--gray);
}

/* Ajustes Responsivos para el Logo y Slogan del Navbar */
@media (max-width: 768px) {
    body {
        /* Fondo más perceptible: bajamos la opacidad del blanco y ajustamos posición */
        background-image: linear-gradient(rgba(245, 247, 250, 0.7), rgba(245, 247, 250, 0.7)), url('../img/fondo.png');
        background-attachment: scroll;
        background-position: center center;
        background-size: cover;
    }

    .navbar-institucional .container {
        display: flex;
        justify-content: center;
        /* Centra los logos horizontalmente */
    }

    .navbar-brand .nav-logo {
        height: 40px;
        /* Logo más pequeño en tablets */
    }

    .navbar-brand .nav-slogan {
        height: 30px;
        /* Slogan más pequeño */
    }

    .navbar-brand .fs-4 {
        font-size: 1.1rem !important;
        /* Texto principal más pequeño */
    }

    .navbar-brand .fs-6 {
        font-size: 0.75rem !important;
        /* Subtexto más pequeño */
    }
}

@media (max-width: 480px) {
    .navbar-brand .nav-slogan {
        display: block !important;
        /* Forzamos que se vea el slogan */
        height: 28px;
    }

    .navbar-brand .nav-logo {
        height: 32px;
        margin-right: 5px;
    }

    .navbar-brand {
        margin-right: 0;
        /* Elimina margen para un centrado perfecto */
    }
}