/* ========== Root Variables ========== */
:root {
    --sf-primary:    #0d4f8c;
    --sf-primary-lt: #1565c0;
    --sf-accent:     #f0a500;
    --sf-bg:         #f5f7fa;
    --sf-card-hover: #e8f0fe;
    --sf-sidebar-w:  280px;
}

/* ========== Base ========== */
body {
    background-color: var(--sf-bg);
    font-family: 'Segoe UI', system-ui, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main { flex: 1; }

/* ========== Navbar ========== */
.navbar.bg-primary {
    background-color: var(--sf-primary) !important;
}
.navbar-brand { letter-spacing: .5px; }
.nav-link.active { background: rgba(255,255,255,.15); border-radius: 6px; }

/* ========== Sidebar ========== */
.filter-sidebar {
    width: var(--sf-sidebar-w);
    min-width: var(--sf-sidebar-w);
    background: #fff;
    border-right: 1px solid #dee2e6;
    padding: 1.25rem 1rem;
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
}

.filter-sidebar .form-label { font-size: .8rem; font-weight: 600; text-transform: uppercase; color: #6c757d; letter-spacing: .4px; }
.filter-sidebar .accordion-button { font-size: .875rem; font-weight: 600; padding: .6rem .75rem; }
.filter-sidebar .accordion-body   { padding: .5rem .75rem; }
.filter-sidebar select.form-select { font-size: .85rem; }

/* ========== Product Cards ========== */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.product-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    box-shadow: 0 6px 20px rgba(13,79,140,.15);
    transform: translateY(-2px);
}

.product-card .card-img-top {
    height: 160px;
    object-fit: contain;
    background: #f8f9fa;
    padding: .75rem;
    border-bottom: 1px solid #f0f0f0;
}
.product-card .card-img-placeholder {
    height: 160px;
    background: linear-gradient(135deg, #e8f0fe 0%, #dce8ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sf-primary);
    font-size: 3rem;
    border-bottom: 1px solid #f0f0f0;
}
.product-card .card-body { padding: 1rem; flex: 1; }
.product-card .card-title { font-size: .95rem; font-weight: 700; margin-bottom: .4rem; color: #1a1a2e; }
.product-card .card-footer { background: #f8f9fa; padding: .65rem 1rem; border-top: 1px solid #eee; }

.badge-condition-new  { background-color: #198754; }
.badge-condition-ref  { background-color: #fd7e14; }

/* ========== Spec Table ========== */
.spec-table td:first-child { color: #6c757d; font-size: .8rem; font-weight: 600; white-space: nowrap; width: 40%; }
.spec-table td:last-child  { font-size: .85rem; }

/* ========== Calculator Page ========== */
.calc-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(13,79,140,.1);
    padding: 2rem;
}
.calc-result-box {
    background: linear-gradient(135deg, var(--sf-primary) 0%, var(--sf-primary-lt) 100%);
    color: #fff;
    border-radius: 10px;
    padding: 1.5rem;
}
.calc-result-box .n2-value { font-size: 2.5rem; font-weight: 700; line-height: 1; }
.calc-result-box .n2-unit  { font-size: 1rem; opacity: .85; }

/* ========== Admin ========== */
.admin-sidebar {
    width: 220px;
    min-width: 220px;
    background: var(--sf-primary);
    min-height: calc(100vh - 56px);
    padding-top: 1rem;
}
.admin-sidebar .nav-link { color: rgba(255,255,255,.75); font-size: .875rem; padding: .5rem 1.25rem; border-radius: 0; }
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active { color: #fff; background: rgba(255,255,255,.15); }
.admin-sidebar .nav-link i { width: 1.25rem; }

.admin-table th { background: #f8f9fa; font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; color: #6c757d; }
.admin-table td { vertical-align: middle; font-size: .875rem; }

/* ========== Pagination ========== */
.page-link { color: var(--sf-primary); }
.page-item.active .page-link { background-color: var(--sf-primary); border-color: var(--sf-primary); }

/* ========== Badges / Misc ========== */
.flow-range-badge { background: #e8f0fe; color: var(--sf-primary); border-radius: 20px; padding: 2px 10px; font-size: .75rem; font-weight: 600; }
.availability-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.availability-dot.yes { background: #198754; }
.availability-dot.no  { background: #dc3545; }

/* ========== Search bar ========== */
.search-bar-wrapper { max-width: 480px; }
.search-bar-wrapper .form-control { border-right: 0; }
.search-bar-wrapper .btn { border-left: 0; background: #fff; border-color: #ced4da; }

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .filter-sidebar { width: 100%; min-width: unset; height: auto; position: relative; top: 0; border-right: none; border-bottom: 1px solid #dee2e6; }
    .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
