:root {
    --b2b-primary: #ff4b2b;
    --b2b-primary-dark: #d33418;
    --b2b-dark: #111827;
    --b2b-bg: #f3f4f6;
    --b2b-border: #e5e7eb;
    --b2b-chip-bg: #eff6ff;
    --b2b-chip-text: #1d4ed8;
}

body {
    background-color: var(--b2b-bg);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Topbar */
.topbar {
    background: #020617;
    color: #9ca3af;
    font-size: 0.75rem;
}

.topbar a {
    color: inherit;
    text-decoration: none;
}

.topbar .topbar-item+.topbar-item {
    border-left: 1px solid #374151;
    padding-left: .75rem;
    margin-left: .75rem;
}

/* Main navbar */
.main-navbar {
    background: var(--b2b-dark);
    color: #e5e7eb;
    border-bottom: 1px solid #111827;
    box-shadow: 0 14px 25px rgba(15, 23, 42, .45);
}

.navbar-brand span {
    color: var(--b2b-primary);
}

.main-navbar .nav-link {
    color: #e5e7eb;
    font-size: 0.9rem;
}

.main-navbar .nav-link:hover {
    color: #ffffff;
}

.main-search-input {
    background: #020617;
    border: 1px solid #1f2937;
    color: #e5e7eb;
}

.main-search-input::placeholder {
    color: #6b7280;
}

.main-search-input:focus {
    box-shadow: 0 0 0 1px var(--b2b-primary);
    border-color: var(--b2b-primary);
}

.btn-search-main {
    background: radial-gradient(circle at 0 0, #f97316 0, var(--b2b-primary-dark) 40%, var(--b2b-primary) 100%);
    border: none;
}

.btn-search-main:hover {
    filter: brightness(1.05);
}

.category-pill {
    background: #020617;
    color: #e5e7eb;
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-size: 0.8rem;
    border: 1px solid #1f2937;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.category-pill i {
    font-size: 1rem;
    color: var(--b2b-primary);
}

.category-pill:hover {
    border-color: var(--b2b-primary);
    color: #fff;
}

/* Layout */
.page-shell {
    margin-top: 1.25rem;
}

.filters-card {
    border-radius: 1rem;
    border: 1px solid var(--b2b-border);
    background: #ffffff;
}

.filters-card .card-header {
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.02), rgba(15, 23, 42, 0));
    border-bottom: 1px solid #e5e7eb;
}

.section-title {
    font-size: 0.75rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #6b7280;
}

.text-muted-small {
    font-size: 0.8rem;
    color: #6b7280;
}

.cart-dropdown-menu {
    width: min(420px, calc(100vw - 1rem));
    max-width: calc(100vw - 1rem);
    overflow: hidden;
}

.cart-dropdown-menu.show {
    display: flex;
    max-height: calc(100vh - 5rem);
    max-height: calc(100dvh - 5rem);
    flex-direction: column;
}

.cart-dropdown-items {
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(52vh, 420px);
    max-height: min(52dvh, 420px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.25rem;
}

.cart-dropdown-product-name {
    font-size: 0.82rem;
    line-height: 1.2;
}

.cart-dropdown-menu > .border-top {
    flex: 0 0 auto;
}

.chip-filter {
    border-radius: 999px;
    background: var(--b2b-chip-bg);
    color: var(--b2b-chip-text);
    border: 1px solid #dbeafe;
    font-size: 0.75rem;
    padding: 0.15rem 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.chip-filter button {
    border: none;
    background: transparent;
    padding: 0;
    line-height: 1;
}

/* Product card modern */
.product-card {
    border-radius: 1rem;
    border: 1px solid var(--b2b-border);
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--b2b-primary), #f97316);
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
}

.product-brand-badge {
    font-size: 0.7rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #4b5563;
    border-radius: 999px;
    padding: 0.15rem 0.75rem;
    background: #f3f4f6;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.product-brand-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--b2b-primary);
}

.product-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.product-code {
    font-size: 0.8rem;
    color: #6b7280;
}

.vehicle-tag {
    font-size: 0.75rem;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
}

.badge-discount {
    background: #b91c1c;
}

.badge-availability-high {
    background: #22c55e;
}

.badge-availability-medium {
    background: #f97316;
}

.badge-availability-low {
    background: #ef4444;
}

.price-main {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--b2b-dark);
}

.price-old {
    font-size: 0.8rem;
    text-decoration: line-through;
    color: #9ca3af;
}

.warehouse-pill {
    font-size: 0.75rem;
    background: #f3f4f6;
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
}

.product-actions-quick {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    /* flex-direction: column; */
    gap: 0.25rem;
}

.product-actions-quick button {
    border-radius: 999px;
    width: 2.1rem;
    height: 2.1rem;
    border: none;
    background: rgba(15, 23, 42, 0.04);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
}

.product-actions-quick button:hover {
    background: rgba(15, 23, 42, 0.08);
    color: #111827;
}

/* Product details */
.product-detail-hero {
    border-radius: 1rem;
    border: 1px solid var(--b2b-border);
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.product-detail-title {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.product-detail-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: #111827;
}

.product-gallery-main {
    aspect-ratio: 4 / 3;
    padding: 0.75rem;
}

.product-gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.5rem;
}

.product-gallery-thumb {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: #ffffff;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
}

.section-title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #0f172a;
}

.detail-list {
    display: grid;
    gap: 0.65rem;
}

.detail-list-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}

#productGallery .carousel-control-prev-icon,
#productGallery .carousel-control-next-icon {
    filter: invert(1);
    opacity: 0.8;
}

.replacement-box {
    background: #f8fafc;
    border: 1px dashed #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.75rem 0.9rem;
}

.replacement-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.replacement-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.replacement-pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    font-size: 0.72rem;
    color: #374151;
}

.replacement-availability {
    font-size: 0.72rem;
}

.replacement-row td {
    padding-top: 0.5rem;
    padding-bottom: 1rem;
}

/* Table view */
.table-modern thead {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.table-modern tbody td {
    font-size: 0.82rem;
    vertical-align: middle;
}

/* View mode tabs */
.view-toggle .btn {
    font-size: 0.78rem;
}

.view-toggle .btn.active {
    background: var(--b2b-primary);
    border-color: transparent;
    color: #ffffff;
}

/* Mode switch (standard/scanner) */
.mode-toggle .btn.active {
    background: #0f172a;
    color: #e5e7eb;
    border-color: #111827;
}

.mode-toggle .btn:not(.active) {
    background: #111827;
    color: #9ca3af;
    border-color: #1f2937;
}

.mode-toggle .btn:not(.active):hover {
    color: #e5e7eb;
}

/* Scanner mode */
.scanner-toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
}

.scanner-shell {
    max-width: 1100px;
    margin: 0 auto;
}

.scanner-row {
    border-radius: 0.9rem;
    background: #ffffff;
    border: 1px solid var(--b2b-border);
    padding: 0.9rem 1.1rem;
    margin-bottom: 0.65rem;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.scanner-row .part-name {
    font-size: 0.95rem;
    font-weight: 600;
}

.scanner-row .part-meta {
    font-size: 0.8rem;
    color: #6b7280;
}

.scanner-row .price {
    font-weight: 700;
    font-size: 1rem;
}

.scanner-row input[type="number"] {
    font-size: 1rem;
}

.searchable-results{
    max-height: 300px;
    overflow: auto;
}

@media (max-width: 992px) {
    .filters-column {
        order: 2;
    }
}
