/* Topbar moderno — barra superior Rodamientos Blanco */

#page-topbar.topbar-modern {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.94) 100%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.07);
    box-shadow: none;
}

#page-topbar.topbar-modern::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: linear-gradient(
        90deg,
        rgba(0, 59, 113, 0.9) 0%,
        rgba(0, 59, 113, 0.45) 45%,
        rgba(255, 95, 0, 0.85) 100%
    );
    pointer-events: none;
    opacity: 0.85;
}

[data-layout-mode="dark"] #page-topbar.topbar-modern {
    background: linear-gradient(180deg, rgba(22, 28, 42, 0.98) 0%, rgba(18, 23, 35, 0.96) 100%);
    border-bottom-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
}

[data-layout-mode="dark"] #page-topbar.topbar-modern::after {
    opacity: 0.55;
}

#page-topbar.topbar-modern .navbar-header {
    position: relative;
    min-height: 4.35rem;
    padding-block: 0.55rem;
    gap: 0.75rem;
}

/* Marca / título */
#page-topbar.topbar-modern .topbar-brand {
    gap: 0.8rem;
    min-width: 0;
    padding: 0.2rem 0.55rem 0.2rem 0.2rem;
    border-radius: 0.85rem;
    transition: background-color 0.18s ease;
}

#page-topbar.topbar-modern .topbar-brand:hover {
    background: rgba(15, 23, 42, 0.03);
}

#page-topbar.topbar-modern .topbar-brand__logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.85rem;
    height: 2.85rem;
    padding: 0.4rem;
    border-radius: 0.75rem;
    background:
        linear-gradient(145deg, #ffffff 0%, #f1f5f9 100%);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 6px 16px rgba(15, 23, 42, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    text-decoration: none;
}

#page-topbar.topbar-modern .topbar-brand__logo:hover {
    transform: translateY(-1px);
    box-shadow:
        0 2px 4px rgba(15, 23, 42, 0.05),
        0 10px 22px rgba(255, 95, 0, 0.12);
}

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

#page-topbar.topbar-modern .topbar-brand__text {
    min-width: 0;
    line-height: 1.2;
    padding-right: 0.35rem;
}

#page-topbar.topbar-modern .topbar-brand__title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #003b71;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#page-topbar.topbar-modern .topbar-brand__subtitle {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #ff5f00;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-layout-mode="dark"] #page-topbar.topbar-modern .topbar-brand:hover {
    background: rgba(255, 255, 255, 0.04);
}

[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: #ffb380;
}

[data-layout-mode="dark"] #page-topbar.topbar-modern .topbar-brand__logo {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.04) 100%);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

/* Hamburguesa */
#page-topbar.topbar-modern .topnav-hamburger {
    width: 2.35rem;
    height: 2.35rem;
    margin-inline: 0.25rem 0.45rem;
    padding: 0 !important;
    border-radius: 0.65rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

#page-topbar.topbar-modern .topnav-hamburger:hover {
    background: #f8fafc;
    border-color: rgba(255, 95, 0, 0.28);
    box-shadow: 0 2px 8px rgba(255, 95, 0, 0.1);
}

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

/* Acciones derecha */
#page-topbar.topbar-modern .topbar-actions {
    gap: 0.4rem;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

[data-layout-mode="dark"] #page-topbar.topbar-modern .topbar-actions {
    background: transparent;
    border: 0;
    box-shadow: none;
}

#page-topbar.topbar-modern .btn-topbar {
    width: 2.35rem;
    height: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px !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: #ff5f00 !important;
    transform: none;
    box-shadow: none;
}

#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: #ffb380 !important;
    box-shadow: none;
}

#page-topbar.topbar-modern .carrito-total-topbar {
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 95, 0, 0.1);
    border: 1px solid rgba(255, 95, 0, 0.16);
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    color: #003b71 !important;
}

/* Usuario */
#page-topbar.topbar-modern .topbar-user .btn {
    padding: 0.3rem 0.65rem 0.3rem 0.3rem;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: #fff;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    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: #fff;
    border-color: rgba(255, 95, 0, 0.35);
    box-shadow: 0 4px 14px rgba(255, 95, 0, 0.12);
}

#page-topbar.topbar-modern .topbar-user-avatar {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.05rem;
    height: 2.05rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(135deg, #ff5f00 0%, #003b71 55%, #00284f 100%);
    box-shadow: 0 2px 8px rgba(255, 95, 0, 0.3);
}

#page-topbar.topbar-modern .topbar-user .user-name-text {
    font-size: 0.86rem !important;
    font-weight: 600 !important;
    color: #003b71 !important;
    max-width: 11rem;
    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.12);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: none;
}

[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(94, 234, 212, 0.35);
    background: rgba(255, 255, 255, 0.08);
}

[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.55rem !important;
    padding: 0.45rem;
    min-width: 13.5rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 0.9rem;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(15, 23, 42, 0.04);
}

#page-topbar.topbar-modern .topbar-user .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.6rem 0.8rem;
    border-radius: 0.6rem;
    font-size: 0.875rem;
    font-weight: 500;
    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(255, 95, 0, 0.1);
    color: #003b71;
}

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

#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 12px 32px rgba(0, 0, 0, 0.4);
}

[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(45, 212, 191, 0.12);
    color: #99f6e4;
}

#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;
    }
}
