/**
 * Equipment Browser Styles
 * Modern, interactive equipment catalog browsing experience
 */

/* ==================== LAYOUT ==================== */
.equipment-browser {
    display: flex;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.equipment-sidebar {
    flex: 0 0 260px;
}

.equipment-main {
    flex: 1;
    min-width: 0;
}

/* ==================== SIDEBAR ==================== */
.sidebar-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 20px;
    margin-bottom: 16px;
}

.sidebar-section h3 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin: 0 0 12px 0;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 10px 12px 10px 38px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

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

/* Scrollable filter list with indicator */
.filter-list-scroll {
    max-height: none;
    overflow-y: visible;
    position: relative;
    padding-bottom: 8px;
}

.filter-list-scroll::-webkit-scrollbar {
    width: 6px;
}

.filter-list-scroll::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.filter-list-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.filter-list-scroll::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Scroll indicator */
.scroll-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    margin-top: 8px;
    background: linear-gradient(to bottom, transparent, #f8fafc);
    color: #64748b;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-top: 1px dashed #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
}

.scroll-indicator:hover {
    color: #3b82f6;
}

.scroll-indicator i {
    animation: bounce 1.5s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}

.filter-list li {
    margin-bottom: 8px;
}

.filter-list label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.2s;
    font-size: 0.9rem;
    color: #334155;
}

.filter-list label:hover {
    background: #f1f5f9;
}

.filter-list input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3b82f6;
}

.filter-count {
    margin-left: auto;
    font-size: 0.75rem;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 10px;
}

.clear-filters {
    display: block;
    width: 100%;
    padding: 8px;
    margin-top: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    color: #64748b;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-filters:hover {
    background: #f1f5f9;
    color: #334155;
}

/* ==================== PRODUCT GRID ==================== */
.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.products-count {
    font-size: 0.9rem;
    color: #64748b;
}

.products-count strong {
    color: #1e293b;
}

.sort-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-dropdown label {
    font-size: 0.85rem;
    color: #64748b;
}

.sort-dropdown select {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.85rem;
    background: #fff;
    cursor: pointer;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

/* ==================== PRODUCT CARD ==================== */
.product-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    transform: translateY(-4px);
}

.product-image {
    height: 180px;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.product-image img {
    max-width: 85%;
    max-height: 85%;
    object-fit: contain;
}

.product-image .placeholder-icon {
    font-size: 3.5rem;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Brand Logo Display - Prominent on cards */
.brand-logo-display {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.brand-logo-display .brand-logo-img {
    max-width: 70%;
    max-height: 100px;
    object-fit: contain;
    filter: grayscale(0%);
    transition: all 0.3s ease;
}

.product-card:hover .brand-logo-display .brand-logo-img {
    transform: scale(1.05);
}

.brand-text-fallback {
    font-size: 2rem;
    font-weight: 800;
    color: #0056b3;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.category-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 4px 8px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
    z-index: 1;
}

.brand-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #0056b3;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.product-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Legacy category tag - keeping for backwards compatibility */
.category-tag {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    width: fit-content;
}

.product-name {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.product-part-number {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 8px;
    font-family: 'Courier New', monospace;
}

.product-description {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: all 0.3s ease;
}

.description-wrapper {
    position: relative;
}

.description-wrapper.expandable .product-description {
    cursor: pointer;
}

.description-wrapper.expanded .product-description {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}

.expand-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.7rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 0 0;
    transition: color 0.2s;
    user-select: none;
}

.description-wrapper.expandable .expand-toggle {
    display: flex;
}

.expand-toggle:hover {
    color: #3b82f6;
}

.expand-toggle i {
    font-size: 0.6rem;
    transition: transform 0.3s ease;
}

.description-wrapper.expanded .expand-toggle i {
    transform: rotate(180deg);
}

.description-wrapper.expanded .expand-toggle .toggle-text::after {
    content: 'Less';
}

.description-wrapper:not(.expanded) .expand-toggle .toggle-text::after {
    content: 'More';
}

.product-actions {
    padding: 0 16px 16px;
}

.add-to-quote-btn {
    width: 100%;
    padding: 10px 16px;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    background: #fff;
    color: #3b82f6;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-to-quote-btn:hover {
    background: #3b82f6;
    color: #fff;
}

.add-to-quote-btn.added {
    background: #22c55e;
    border-color: #22c55e;
    color: #fff;
}

.add-to-quote-btn.added:hover {
    background: #16a34a;
    border-color: #16a34a;
}

/* ==================== QUOTE CART ==================== */
.quote-cart-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    border: none;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: all 0.3s;
    z-index: 1000;
}

.quote-cart-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(59, 130, 246, 0.5);
}

.quote-cart-button .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.quote-cart-button.empty .badge {
    display: none;
}

.quote-cart-panel {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    max-height: 500px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 999;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.quote-cart-panel.open {
    display: flex;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quote-cart-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quote-cart-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #1e293b;
}

.quote-cart-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
}

.quote-cart-close:hover {
    color: #64748b;
}

.quote-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.quote-cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 8px;
}

.quote-cart-item:last-child {
    margin-bottom: 0;
}

.quote-cart-item-info {
    flex: 1;
    min-width: 0;
}

.quote-cart-item-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quote-cart-item-part {
    font-size: 0.7rem;
    color: #94a3b8;
}

.quote-cart-item-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 4px;
    font-size: 0.9rem;
}

.quote-cart-item-remove:hover {
    color: #dc2626;
}

.quote-cart-empty {
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
}

.quote-cart-empty i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
}

.quote-cart-footer {
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
}

.request-quote-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.request-quote-btn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.request-quote-btn:disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

/* ==================== NO RESULTS ==================== */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.no-results i {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 20px;
    display: block;
}

.no-results h3 {
    color: #1e293b;
    margin-bottom: 8px;
}

.no-results p {
    margin-bottom: 20px;
}

/* ==================== LOADING STATE ==================== */
.loading-skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.product-card.loading .product-image {
    background: none;
}

.product-card.loading .product-image::after {
    content: '';
    width: 100%;
    height: 100%;
    position: absolute;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .equipment-browser {
        flex-direction: column;
    }
    
    .equipment-sidebar {
        flex: none;
        position: relative;
        top: auto;
        max-height: none;
        display: flex;
        gap: 16px;
        flex-wrap: wrap;
    }
    
    .sidebar-section {
        flex: 1;
        min-width: 200px;
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    .equipment-browser {
        padding: 0 12px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 12px;
    }
    
    .product-image {
        height: 150px;
    }
    
    .quote-cart-panel {
        left: 12px;
        right: 12px;
        width: auto;
        bottom: 90px;
    }
    
    .sidebar-section {
        min-width: 100%;
    }
}

/* ==================== QUOTE MODAL ==================== */
.quote-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.quote-modal-overlay.open {
    display: flex;
}

.quote-modal {
    background: #fff;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.quote-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quote-modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #1e293b;
}

.quote-modal-body {
    padding: 24px;
}

.quote-form-group {
    margin-bottom: 20px;
}

.quote-form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.quote-form-group input,
.quote-form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.quote-form-group input:focus,
.quote-form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.quote-products-summary {
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.quote-products-summary h4 {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0 0 12px 0;
}

.quote-products-summary ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.quote-products-summary li {
    font-size: 0.85rem;
    color: #334155;
    padding: 6px 0;
    border-bottom: 1px solid #e2e8f0;
}

.quote-products-summary li:last-child {
    border-bottom: none;
}

.submit-quote-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.submit-quote-btn:hover {
    background: linear-gradient(135deg, #16a34a, #15803d);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

/* ==================== ACTIVE FILTERS DISPLAY ==================== */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eff6ff;
    color: #3b82f6;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.active-filter-tag button {
    background: none;
    border: none;
    color: #3b82f6;
    cursor: pointer;
    padding: 0;
    font-size: 0.9rem;
}

.active-filter-tag button:hover {
    color: #1d4ed8;
}

/* ==================== PRODUCT IMAGE STATES ==================== */
.product-image.loading::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.product-image img {
    transition: opacity 0.3s;
}

.product-image img.loaded {
    opacity: 1;
}

/* ==================== ENHANCED HOVER STATES ==================== */
.product-card:hover .product-image {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

.product-card:hover .brand-logo-display {
    background: #fafbfc;
}

.product-card:hover .placeholder-icon i {
    color: #3b82f6;
    transform: scale(1.1);
    transition: all 0.3s;
}

/* ==================== BRAND COLORS ==================== */
.brand-badge.advance { background: #0056b3; }
.brand-badge.clarke { background: #cc0000; }
.brand-badge.viper { background: #ff6600; }
.brand-badge.minuteman { background: #c41230; }
.brand-badge.taski { background: #e31937; }
.brand-badge.nss { background: #005a9c; }
.brand-badge.ipceagle { background: #4a9c2d; }
.brand-badge.nacecare { background: #1a4d8c; }
.brand-badge.betco { background: #003366; }

/* ==================== SUCCESS TOAST ==================== */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #22c55e;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 2000;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ==================== PAGINATION ==================== */
.pagination-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 50px auto 20px;
    padding: 20px 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    max-width: 600px;
}

.pagination-info {
    font-size: 0.9rem;
    color: #64748b;
}

.pagination-info .pagination-total {
    color: #94a3b8;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.pagination-btn:hover:not(:disabled):not(.active) {
    border-color: #3b82f6;
    color: #3b82f6;
    background: #eff6ff;
}

.pagination-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
    font-weight: 600;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8fafc;
}

.pagination-prev,
.pagination-next {
    padding: 0 16px;
    font-weight: 600;
}

.pagination-ellipsis {
    color: #94a3b8;
    padding: 0 4px;
}

@media (max-width: 768px) {
    .pagination-container {
        padding: 16px;
        margin-top: 24px;
    }
    
    .pagination-btn {
        min-width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
    
    .pagination-prev,
    .pagination-next {
        padding: 0 12px;
    }
    
    /* Hide page numbers on very small screens, keep prev/next */
    .pagination-btn:not(.pagination-prev):not(.pagination-next):not(.active) {
        display: none;
    }
    
    .pagination-ellipsis {
        display: none;
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .equipment-sidebar,
    .quote-cart-button,
    .quote-cart-panel,
    .add-to-quote-btn,
    .pagination-container {
        display: none !important;
    }
    
    .equipment-main {
        width: 100%;
    }
    
    .product-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }
}

