/* B2B Catalog Custom Styles */
/* Import brand color system */
@import url("./brand-colors.fccdd202019f.css");

/* Global Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--brand-secondary);
    background-color: var(--brand-white);
}

/* Unified primary CTA: Bootstrap's default blue primary → brand red (design audit) */
.btn.btn-primary {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
    color: var(--brand-white);
}
.btn.btn-primary:hover,
.btn.btn-primary:focus {
    background-color: var(--brand-primary-dark);
    border-color: var(--brand-primary-dark);
    color: var(--brand-white);
}
.btn.btn-primary:active {
    background-color: var(--brand-primary-darker);
    border-color: var(--brand-primary-darker);
    color: var(--brand-white);
}

/* Custom marketing button class names used outside Bootstrap */
.cta-btn.cta-btn-primary,
.btn-hero.btn-hero-primary {
    background: var(--brand-gradient-primary);
    border-color: var(--brand-primary);
    color: var(--brand-white);
}
.cta-btn.cta-btn-primary:hover,
.btn-hero.btn-hero-primary:hover {
    background: linear-gradient(135deg, var(--brand-primary-dark) 0%, var(--brand-primary-darker) 100%);
    color: var(--brand-white);
}

/* Sticky header shell: one stacking context so content cannot show through gaps */
.site-header-stack {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--brand-white);
    box-shadow: var(--brand-shadow);
}

/* Header Styles */
.header {
    background: var(--brand-white);
    position: relative;
    z-index: 1;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--brand-gray-200);
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--brand-black);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.logo:hover {
    color: var(--brand-primary);
}

.header-logo-img {
    height: 70px;
    width: auto;
    max-width: 500px;
    display: block;
}

.logo img {
    height: 70px;
    width: auto;
    max-width: 500px;
    object-fit: contain;
    object-position: left;
    flex-shrink: 0;
    display: block;
    /* SVG optimization */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    filter: none;
    transition: all 0.3s ease;
}

.logo img:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* New CSS Logo Styles */
.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.abacus-icon {
    flex-shrink: 0;
}

.abacus-frame {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.abacus-rod {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    position: relative;
}

.abacus-rod::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: #374151;
    z-index: 1;
}

.abacus-bead {
    width: 8px;
    height: 8px;
    background: var(--brand-primary);
    border-radius: 50%;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.abacus-bead:hover {
    transform: scale(1.2);
    background: var(--brand-primary-dark);
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.logo-main {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--brand-black);
    margin: 0;
}

.logo-sub {
    font-size: 0.9rem;
    color: var(--brand-primary);
    font-weight: 500;
    margin: 0;
    margin-top: -2px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--brand-secondary);
    font-weight: 500;
    transition: color 0.3s;
    padding: 0.5rem 0;
}

.nav-links a:hover {
    color: var(--brand-primary);
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn-primary {
    background: var(--brand-gradient-primary);
    color: var(--brand-white);
    box-shadow: var(--brand-shadow-primary);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--brand-primary-dark) 0%, var(--brand-primary-darker) 100%);
    color: var(--brand-white);
    transform: translateY(-2px);
    box-shadow: var(--brand-shadow-primary-hover);
}

.btn-outline-primary {
    background: transparent;
    color: var(--brand-primary);
    border: 2px solid var(--brand-primary);
}

.btn-outline-primary:hover {
    background: var(--brand-primary);
    color: var(--brand-white);
}

.btn-success {
    background: var(--brand-success);
    color: var(--brand-white);
}

.btn-success:hover {
    background: #059669;
    color: var(--brand-white);
}

.btn-warning {
    background: var(--brand-warning);
    color: var(--brand-white);
}

.btn-warning:hover {
    background: #d97706;
    color: var(--brand-white);
}

.btn-danger {
    background: var(--brand-danger);
    color: var(--brand-white);
}

.btn-danger:hover {
    background: var(--brand-primary);
    color: var(--brand-white);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
    color: white;
}

.btn-outline-secondary {
    background: transparent;
    color: #6b7280;
    border: 2px solid #6b7280;
}

.btn-outline-secondary:hover {
    background: #6b7280;
    color: white;
}

/* Card Styles */
.card {
    background: var(--brand-white);
    border-radius: 12px;
    box-shadow: var(--brand-shadow);
    border: 1px solid var(--brand-gray-200);
    overflow: hidden;
    transition: all 0.3s ease;
}

.card-header {
    background: var(--brand-gray-50);
    border-bottom: 1px solid var(--brand-gray-200);
    padding: 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* Form Styles */
.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--brand-gray-300);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: var(--brand-white);
}

.form-control:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--brand-secondary);
}

.form-check-input {
    margin-right: 0.5rem;
}

.form-text {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Alert Styles */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-color: #a7f3d0;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-color: #93c5fd;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.bg-primary { background: #2563eb; color: white; }
.bg-success { background: #10b981; color: white; }
.bg-warning { background: #f59e0b; color: white; }
.bg-danger { background: #ef4444; color: white; }
.bg-info { background: #06b6d4; color: white; }
.bg-secondary { background: #6b7280; color: white; }
.bg-light { background: #f3f4f6; color: #374151; }

/* Table Styles */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.table-striped tbody tr:nth-child(odd) {
    background: #f9fafb;
}

.table-hover tbody tr:hover {
    background: #f3f4f6;
}

/* Pagination Styles */
.pagination {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 2rem 0;
}

.page-item {
    margin: 0 0.25rem;
}

.page-link {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #2563eb;
    text-decoration: none;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    transition: all 0.3s;
}

.page-link:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.page-item.active .page-link {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-muted { color: #6b7280; }
.text-primary { color: #2563eb; }
.text-success { color: #10b981; }
.text-warning { color: #f59e0b; }
.text-danger { color: #ef4444; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.d-flex { display: flex; }
.d-grid { display: grid; }
.d-none { display: none; }

.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }

.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }

.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .table-responsive {
        overflow-x: auto;
    }
}

/* Loading States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Focus States for Accessibility */
.btn:focus,
.form-control:focus,
.page-link:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Auth card (registration, etc.) — keep red header styling scoped; do not bleed to site-wide .card-header */
.auth-card.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.auth-card .card-header {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border: none;
    padding: 2rem 1.5rem;
    color: white;
}

.auth-card .card-header * {
    color: white;
}

.auth-card .card-header .btn,
.auth-card .card-header a.btn {
    color: white;
    border-color: white;
}

.auth-card .card-header .btn:hover,
.auth-card .card-header a.btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.auth-card .card-header h3,
.auth-card .card-header h5,
.auth-card .card-header .card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
}

.auth-card .card-header i,
.auth-card .card-header .fas,
.auth-card .card-header .far,
.auth-card .card-header .fa {
    color: white;
}

.auth-card .card-header p {
    color: #ffffff;
    opacity: 0.95;
    font-size: 0.95rem;
    margin: 0;
}

.auth-card .card-body {
    padding: 2rem 1.5rem;
}

.auth-card .form-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.auth-card .form-control {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.auth-card .form-control:hover {
    border-color: #d1d5db;
}

.auth-card .form-control:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
    outline: none;
    transform: translateY(-1px);
}

.auth-card .form-check-input:checked {
    background-color: #dc2626;
    border-color: #dc2626;
}

.auth-card .form-check-label {
    color: #6b7280;
    font-weight: 500;
}

.auth-card .card-footer {
    background-color: #f9fafb;
    border-top: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
}

.auth-card .card-footer a {
    color: #dc2626;
    text-decoration: none;
    font-weight: 600;
}

.auth-card .card-footer a:hover {
    color: #b91c1c;
    text-decoration: underline;
}

/* Alerts inside auth cards only (avoid duplicating global .alert rules site-wide) */
.auth-card .alert {
    border: none;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.auth-card .alert-success {
    background-color: #d1fae5;
    color: #065f46;
}

.auth-card .alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.auth-card .alert-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.auth-card .alert-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Professional Homepage Styles */
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
}

.manufacturer-logo:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.hero-stats {
    transition: all 0.3s ease;
}

.hero-stats:hover {
    transform: translateY(-5px);
    background: rgba(255,255,255,0.15) !important;
}

/* Dashboard Styles */
.dashboard-card {
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stats-card {
    transition: all 0.3s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Homepage Product Cards */
.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.hero-image:hover {
    transform: translateY(-5px);
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.15) 0%, rgba(185, 28, 28, 0.15) 100%) !important;
    border-color: rgba(220, 38, 38, 0.5) !important;
}

/* Micro header (utility bar): collapse layout when hidden — avoid translate-only hide (layout hole) */
.micro-header {
    background: #dc2626;
    border-bottom: 1px solid #b91c1c;
    font-size: 0.8125rem;
    padding: 0.5rem 0;
    position: relative;
    z-index: 2;
    max-height: 4rem;
    overflow: hidden;
    opacity: 1;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        padding-top 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        padding-bottom 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.25s ease,
        border-width 0.2s ease;
}

.micro-header.hidden {
    max-height: 0;
    min-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-bottom-width: 0;
    opacity: 0;
    pointer-events: none;
}

.micro-header .container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.micro-header-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.micro-header a {
    color: #e2e8f0;
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 400;
    white-space: nowrap;
    letter-spacing: 0.01em;
    position: relative;
}

.micro-header a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #ffffff;
    transition: width 0.2s ease;
}

.micro-header a:hover {
    color: #ffffff;
}

.micro-header a:hover::after {
    width: 100%;
}

.micro-header .phone-link {
    color: #e2e8f0;
    font-weight: 500;
}

.micro-header .phone-link:hover {
    color: #ffffff;
}

@media (max-width: 768px) {
    .micro-header {
        display: none;
    }
}

.header-main-inner {
    padding: 1rem 0;
}

.header-search-row {
    background: #f8f9fa;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 0;
}

.header-search-form {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 992px) {
    .header-search-form {
        max-width: 100%;
    }
}

.header-search-form .form-control {
    height: 52px;
    padding: 0 12px;
    border-radius: 4px 0 0 4px;
    border: 1px solid #ccc;
    border-right: none;
}

.header-search-form .btn-search-submit {
    height: 52px;
    padding: 0 20px;
    background: #dc2626;
    border: none;
    border-radius: 0 4px 4px 0;
    font-weight: 600;
}

.navbar-toggler.header-mobile-toggle {
    border: 1px solid #ccc;
    padding: 0.5rem;
}

.btn-header-quote {
    background: #dc2626;
    border: none;
    font-weight: 600;
}

.site-footer-main {
    background: #1f2937;
    color: white;
    padding: 4rem 0 2rem;
}

.site-footer-main a:hover {
    color: #dc2626 !important;
}

.site-footer-main .fab:hover,
.site-footer-main .fas:hover {
    color: #dc2626 !important;
}

.site-footer-muted {
    color: #9ca3af;
}

.footer-col-title {
    color: white;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.footer-link-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-link-list li {
    margin-bottom: 0.75rem;
}

a.footer-link {
    color: #9ca3af;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

a.footer-social-link {
    color: #9ca3af;
    font-size: 1.25rem;
    transition: color 0.3s;
}

.footer-logo-img {
    height: 50px;
    filter: brightness(0) invert(1);
}

.footer-contact-icon {
    color: #dc2626;
    margin-right: 1rem;
    margin-top: 0.25rem;
}

.footer-bottom-bar {
    border-top: 1px solid #374151;
    padding-top: 2rem;
    margin-top: 2rem;
}

.footer-copyright {
    color: #9ca3af;
    margin: 0;
}

.footer-badge {
    margin-right: 0.5rem;
}

.site-cta-bottom {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.site-cta-bottom .cta-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.site-cta-bottom .cta-lead {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.site-cta-bottom .cta-btn {
    font-weight: 600;
    color: #dc2626;
}

.site-cta-bottom .site-cta-actions {
    margin-top: 0.25rem;
}

.mobile-nav-panel {
    background: #f8f9fa;
    border-bottom: 1px solid #e5e7eb;
}

/* Large screens: slightly larger body text */
@media (min-width: 1400px) {
    body {
        font-size: 1.0625rem;
    }
}

/* Header search autocomplete (global) */
.header-search-form {
    position: relative;
}
#global-search-suggestions {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 1050;
    max-height: 320px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    margin-top: 2px;
}
#global-search-suggestions.show {
    display: block;
}
#global-search-suggestions .suggestion-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
}
#global-search-suggestions .suggestion-item:hover,
#global-search-suggestions .suggestion-item.active {
    background: #fef2f2;
}
#global-search-suggestions .suggestion-type {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: #6b7280;
}
#global-search-suggestions .suggestion-highlight {
    font-weight: 600;
    color: #dc2626;
}

/* Floating quote cart FAB */
.quote-fab {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1040;
    display: none;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: #dc2626;
    color: #fff;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.45);
    text-decoration: none;
}
.quote-fab:hover {
    color: #fff;
    background: #b91c1c;
}
.quote-fab-count {
    position: absolute;
    top: -0.25rem;
    right: -0.25rem;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.35rem;
    font-size: 0.7rem;
    line-height: 1.35rem;
    text-align: center;
    background: #fbbf24;
    color: #1f2937;
    border-radius: 999px;
    font-weight: 700;
}

/* Print Styles */
@media print {
    .btn,
    .pagination,
    .alert {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #000;
    }
}
