/* ================================================
   Find Parts Page Styles
   ================================================ */

.fp-container {
    max-width: 100%;
}

/* ---- Quick-Info Panels ---- */
.fp-info-panels {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 1200px) {
    .fp-info-panels {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .fp-info-panels {
        grid-template-columns: 1fr;
    }
}

.fp-info-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    max-height: 320px;
}

/* Recent Orders - Blue theme */
.fp-info-card:nth-child(1) {
    border-top: 3px solid #2563eb;
}
.fp-info-card:nth-child(1) .fp-info-card-header {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    border-bottom: 1px solid #1d4ed8;
}
.fp-info-card:nth-child(1) .fp-info-icon {
    color: rgba(255,255,255,0.85);
}

/* Recent Searches - Amber/Orange theme */
.fp-info-card:nth-child(2) {
    border-top: 3px solid #f59e0b;
}
.fp-info-card:nth-child(2) .fp-info-card-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    border-bottom: 1px solid #d97706;
}
.fp-info-card:nth-child(2) .fp-info-icon {
    color: rgba(255,255,255,0.85);
}

/* Load up Quote - Green theme */
.fp-info-card:nth-child(3) {
    border-top: 3px solid #10b981;
}
.fp-info-card:nth-child(3) .fp-info-card-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border-bottom: 1px solid #059669;
}
.fp-info-card:nth-child(3) .fp-info-icon {
    color: rgba(255,255,255,0.85);
}

.fp-load-quote-body {
    padding: 14px 10px;
}

.fp-info-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.fp-info-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.fp-info-card-body {
    padding: 0;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
}

.fp-info-card-body::-webkit-scrollbar {
    width: 4px;
}

.fp-info-card-body::-webkit-scrollbar-track {
    background: transparent;
}

.fp-info-card-body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

/* Mini Table (Orders / Cart) */
.fp-mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.fp-mini-table thead th {
    padding: 6px 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    position: sticky;
    top: 0;
    z-index: 1;
}

.fp-mini-table tbody td {
    padding: 5px 10px;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
    white-space: nowrap;
}

.fp-mini-table tbody tr:last-child td {
    border-bottom: none;
}

.fp-mini-table tbody tr:hover {
    background: #f9fafb;
}

.fp-mini-right {
    text-align: right !important;
}

.fp-mini-center {
    text-align: center !important;
}

.fp-invoice-id {
    font-weight: 600;
    color: #3b82f6;
    font-size: 12px;
    text-decoration: none;
}
.fp-invoice-id:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.fp-cart-item-name {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fp-cart-item-note {
    display: block;
    font-size: 10px;
    color: #9ca3af;
    font-style: italic;
}

.fp-info-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 14px;
    font-size: 12px;
    color: #9ca3af;
    font-style: italic;
}

/* Recent Searches List (inside info panel) */
.fp-recent-list {
    display: flex;
    flex-direction: column;
}

.fp-recent-row {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 4px 0 0;
    border-bottom: 1px solid #f3f4f6;
}

.fp-recent-row:last-child {
    border-bottom: none;
}

.fp-recent-link {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-size: 12px;
    color: #374151;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.12s;
    min-width: 0;
}

.fp-recent-link:hover {
    background: #f9fafb;
    color: #3b82f6;
}

.fp-recent-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fp-recent-type-icon {
    width: 14px;
    height: 14px;
    color: #9ca3af;
    flex-shrink: 0;
}

.fp-recent-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: none;
    border: none;
    color: #d1d5db;
    cursor: pointer;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.12s;
}

.fp-recent-x:hover {
    color: #ef4444;
    background: #fef2f2;
}

/* ---- Search Section ---- */
.fp-search-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .fp-search-section {
        grid-template-columns: 1fr;
    }
}

.fp-search-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border-top: 3px solid #1e3a8a;
}

.fp-search-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    border-bottom: 1px solid #1e3a8a;
}

.fp-search-card-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.fp-search-icon {
    width: 18px;
    height: 18px;
    color: rgba(255,255,255,0.85);
}

.fp-search-card-body {
    padding: 14px 16px;
}

/* YMM Row */
.fp-ymm-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.fp-ymm-field {
    flex: 1;
    min-width: 0;
}

.fp-ymm-btn-wrap,
.fp-part-btn-wrap {
    padding-bottom: 1px;
}

/* Part Number Row */
.fp-part-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.fp-part-field {
    flex: 1;
    min-width: 0;
}

/* Form Elements */
.fp-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    margin-bottom: 4px;
}

.fp-select,
.fp-input {
    width: 100%;
    padding: 7px 10px;
    font-size: 13px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #111827;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    height: 36px;
}

.fp-select:focus,
.fp-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
}

.fp-select:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

.fp-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: #3b82f6;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
    height: 36px;
}

.fp-search-btn:hover:not(:disabled) {
    background: #2563eb;
}

.fp-search-btn:disabled {
    background: #93c5fd;
    cursor: not-allowed;
}

/* ---- Stock Filter Toggle ---- */
.fp-filter-bar {
    display: flex;
    align-items: center;
    padding: 8px 0;
}

.fp-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.fp-toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.fp-toggle-track {
    position: relative;
    width: 36px;
    height: 20px;
    background: #d1d5db;
    border-radius: 10px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.fp-toggle-input:checked + .fp-toggle-track {
    background: #3b82f6;
}

.fp-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    transition: transform 0.2s;
}

.fp-toggle-input:checked + .fp-toggle-track .fp-toggle-thumb {
    transform: translateX(16px);
}

.fp-toggle-label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

/* ---- Loading ---- */
.fp-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: #6b7280;
    font-size: 14px;
}

.fp-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: fp-spin 0.6s linear infinite;
}

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

/* ---- Results Header ---- */
.fp-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    margin-bottom: 4px;
}

.fp-results-title {
    font-size: 14px;
    font-weight: 400;
    color: #374151;
    margin: 0;
}

.fp-results-title strong {
    font-weight: 600;
}

.fp-results-count {
    font-size: 12px;
    color: #1e40af;
    background: #dbeafe;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
}

/* ---- Results Layout (Sidebar + Products) ---- */
.fp-results-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 16px;
    align-items: start;
}

@media (max-width: 900px) {
    .fp-results-layout {
        grid-template-columns: 1fr;
    }
}

/* Category Sidebar */
.fp-category-sidebar {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    position: sticky;
    top: 70px;
    max-height: calc(100vh - 90px);
    display: flex;
    flex-direction: column;
    border-top: 3px solid #2563eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

@media (max-width: 900px) {
    .fp-category-sidebar {
        position: static;
        max-height: 240px;
    }
}

.fp-category-sidebar-header {
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-bottom: 1px solid #1d4ed8;
    flex-shrink: 0;
}

.fp-category-nav {
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
}

.fp-category-nav::-webkit-scrollbar {
    width: 4px;
}

.fp-category-nav::-webkit-scrollbar-track {
    background: transparent;
}

.fp-category-nav::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

.fp-category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: all 0.12s;
    text-align: left;
}

.fp-category-item:hover {
    background: #f9fafb;
    color: #111827;
}

.fp-category-item-active {
    background: #eff6ff;
    color: #2563eb;
    border-left-color: #3b82f6;
    font-weight: 600;
}

.fp-category-item-active:hover {
    background: #dbeafe;
}

.fp-category-item-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fp-category-item-count {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    background: #e5e7eb;
    color: #374151;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    margin-left: 6px;
}

.fp-category-item-active .fp-category-item-count {
    background: #bfdbfe;
    color: #1e40af;
}

/* Products Area */
.fp-products-area {
    min-width: 0;
}

/* Panel Header */
.fp-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.fp-panel-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.fp-panel-count {
    font-size: 12px;
    color: #6b7280;
}

/* ---- Product Cards ---- */
.fp-products-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fp-product-card {
    display: grid;
    grid-template-columns: 100px 1fr 220px;
    gap: 16px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: box-shadow 0.15s, border-color 0.15s;
    align-items: start;
}

.fp-product-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.fp-product-oos {
    opacity: 0.7;
}

@media (max-width: 768px) {
    .fp-product-card {
        grid-template-columns: 1fr;
    }
}

/* Product Image */
.fp-product-image {
    width: 100px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #f3f4f6;
}

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

/* Product Details */
.fp-product-details {
    min-width: 0;
}

.fp-product-name {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
    line-height: 1.3;
}

.fp-product-name-link {
    text-decoration: none;
    color: #111827;
    display: block;
    transition: color 0.12s;
}

.fp-product-name-link:hover {
    color: #2563eb;
}

a.fp-product-image {
    cursor: pointer;
}

.fp-product-numbers {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.fp-part-num {
    font-size: 11px;
    color: #6b7280;
}

.fp-part-num strong {
    color: #374151;
}

/* Certifications */
.fp-product-certs {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
}

.fp-cert {
    display: inline-block;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 700;
    border-radius: 3px;
    letter-spacing: 0.04em;
}

.fp-cert-capa {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.fp-cert-nsf {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.fp-product-submodels {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

/* Product Actions */
.fp-product-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
    min-width: 200px;
}

@media (max-width: 768px) {
    .fp-product-actions {
        align-items: flex-start;
    }
}

.fp-product-pricing {
    text-align: right;
}

@media (max-width: 768px) {
    .fp-product-pricing {
        text-align: left;
    }
}

.fp-price {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
}

.fp-list-price {
    display: block;
    font-size: 11px;
    color: #9ca3af;
    text-decoration: line-through;
}

.fp-product-eta {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.fp-eta-instock {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.fp-eta-oos {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Color Select */
.fp-product-color {
    width: 100%;
}

.fp-color-select {
    width: 100%;
    padding: 5px 8px;
    font-size: 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    color: #374151;
}

/* Quantity & Add to Cart */
.fp-product-cart {
    display: flex;
    gap: 6px;
    align-items: flex-end;
    width: 100%;
}

.fp-qty-wrap {
    display: flex;
    flex-direction: column;
}

.fp-qty-label {
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.fp-qty-input {
    width: 52px;
    padding: 5px 6px;
    font-size: 13px;
    text-align: center;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    color: #111827;
}

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

.fp-add-cart-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: #10b981;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
    height: 32px;
}

.fp-add-cart-btn:hover:not(:disabled) {
    background: #059669;
}

.fp-add-cart-btn:disabled {
    background: #6ee7b7;
    cursor: not-allowed;
}

/* Out of Stock Badge */
.fp-oos-badge {
    display: inline-block;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---- No Results / Welcome ---- */
.fp-no-results,
.fp-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.fp-no-results-title,
.fp-welcome-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 4px;
}

.fp-no-results-text,
.fp-welcome-text {
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
}
