/* Topbar moderno — barra superior */

#page-topbar.topbar-modern {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.03);
}

[data-layout-mode="dark"] #page-topbar.topbar-modern {
    background: rgba(30, 36, 51, 0.94);
    border-bottom-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

#page-topbar.topbar-modern .navbar-header {
    min-height: 4.25rem;
    padding-block: 0.5rem;
}

/* Marca / título */
#page-topbar.topbar-modern .topbar-brand {
    gap: 0.75rem;
    min-width: 0;
}

#page-topbar.topbar-modern .topbar-brand__logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0.35rem;
    border-radius: 0.65rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(59, 130, 246, 0.08) 100%);
    border: 1px solid rgba(15, 23, 42, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

#page-topbar.topbar-modern .topbar-brand__logo:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

#page-topbar.topbar-modern .topbar-brand__logo img {
    height: 2rem !important;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 0.25rem;
}

#page-topbar.topbar-modern .topbar-brand__text {
    min-width: 0;
    line-height: 1.25;
}

#page-topbar.topbar-modern .topbar-brand__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#page-topbar.topbar-modern .topbar-brand__subtitle {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-layout-mode="dark"] #page-topbar.topbar-modern .topbar-brand__title {
    color: #f1f5f9;
}

[data-layout-mode="dark"] #page-topbar.topbar-modern .topbar-brand__subtitle {
    color: #94a3b8;
}

[data-layout-mode="dark"] #page-topbar.topbar-modern .topbar-brand__logo {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}

/* Hamburguesa */
#page-topbar.topbar-modern .topnav-hamburger {
    width: 2.25rem;
    height: 2.25rem;
    margin-inline: 0.35rem 0.5rem;
    padding: 0 !important;
    border-radius: 0.55rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(15, 23, 42, 0.02);
    transition: background-color 0.18s ease, border-color 0.18s ease;
}

#page-topbar.topbar-modern .topnav-hamburger:hover {
    background: rgba(15, 23, 42, 0.05);
    border-color: rgba(15, 23, 42, 0.12);
}

[data-layout-mode="dark"] #page-topbar.topbar-modern .topnav-hamburger {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
}

/* Acciones derecha */
#page-topbar.topbar-modern .topbar-actions {
    gap: 0.35rem;
}

#page-topbar.topbar-modern .btn-topbar {
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.55rem !important;
    border: 1px solid transparent;
    color: #475569 !important;
    background: transparent;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}

#page-topbar.topbar-modern .btn-topbar:hover {
    background: rgba(15, 23, 42, 0.05) !important;
    border-color: rgba(15, 23, 42, 0.08);
    color: #0f172a !important;
    transform: translateY(-1px);
}

#page-topbar.topbar-modern .btn-topbar i {
    font-size: 1.15rem !important;
    line-height: 1;
}

[data-layout-mode="dark"] #page-topbar.topbar-modern .btn-topbar {
    color: #94a3b8 !important;
}

[data-layout-mode="dark"] #page-topbar.topbar-modern .btn-topbar:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.1);
    color: #f1f5f9 !important;
}

/* Usuario */
#page-topbar.topbar-modern .topbar-user .btn {
    padding: 0.35rem 0.5rem 0.35rem 0.35rem;
    border-radius: 0.65rem;
    border: 1.5px solid rgba(15, 23, 42, 0.18);
    background: transparent;
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

#page-topbar.topbar-modern .topbar-user .btn:hover,
#page-topbar.topbar-modern .topbar-user .btn.show {
    background: transparent;
    border-color: rgba(15, 23, 42, 0.28);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

#page-topbar.topbar-modern .topbar-user-avatar {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

#page-topbar.topbar-modern .topbar-user .user-name-text {
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: #334155 !important;
    max-width: 10rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-layout-mode="dark"] #page-topbar.topbar-modern .topbar-user .btn {
    border-color: rgba(255, 255, 255, 0.22);
    background: transparent;
}

[data-layout-mode="dark"] #page-topbar.topbar-modern .topbar-user .btn:hover,
[data-layout-mode="dark"] #page-topbar.topbar-modern .topbar-user .btn.show {
    border-color: rgba(255, 255, 255, 0.35);
    background: transparent;
}

[data-layout-mode="dark"] #page-topbar.topbar-modern .topbar-user .user-name-text {
    color: #e2e8f0 !important;
}

/* Dropdown usuario */
#page-topbar.topbar-modern .topbar-user .dropdown-menu {
    margin-top: 0.5rem !important;
    padding: 0.4rem;
    min-width: 13rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0.75rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1), 0 2px 6px rgba(15, 23, 42, 0.04);
}

#page-topbar.topbar-modern .topbar-user .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 400;
    color: #334155;
    transition: background-color 0.15s ease, color 0.15s ease;
}

#page-topbar.topbar-modern .topbar-user .dropdown-item i {
    width: 1.15rem;
    text-align: center;
    font-size: 1rem !important;
    color: #64748b;
    transition: color 0.15s ease;
}

#page-topbar.topbar-modern .topbar-user .dropdown-item:hover {
    background: rgba(59, 130, 246, 0.08);
    color: #1e40af;
}

#page-topbar.topbar-modern .topbar-user .dropdown-item:hover i {
    color: #3b82f6;
}

#page-topbar.topbar-modern .topbar-user .dropdown-item:last-child:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #b91c1c;
}

#page-topbar.topbar-modern .topbar-user .dropdown-item:last-child:hover i {
    color: #ef4444;
}

[data-layout-mode="dark"] #page-topbar.topbar-modern .topbar-user .dropdown-menu {
    background: #1e2433;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

[data-layout-mode="dark"] #page-topbar.topbar-modern .topbar-user .dropdown-item {
    color: #cbd5e1;
}

[data-layout-mode="dark"] #page-topbar.topbar-modern .topbar-user .dropdown-item:hover {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
}

#page-topbar.topbar-modern .navbar-brand-box.horizontal-logo {
    display: none !important;
}

#carrito-badge-topbar {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.62rem !important;
    font-weight: 700;
    line-height: 18px;
    border: 2px solid #fff;
    box-shadow: 0 1px 2px rgba(220, 38, 38, 0.35);
}

[data-layout-mode="dark"] #carrito-badge-topbar {
    border-color: #1e2230;
}

@media (max-width: 575.98px) {
    #page-topbar.topbar-modern .topbar-brand__subtitle {
        display: none;
    }

    #page-topbar.topbar-modern .topbar-brand__title {
        font-size: 0.85rem;
        max-width: 9rem;
    }
}
