/* ============================
   SPARE PART FINDER STYLES
   Matches Woodmart theme design
   ============================ */

/* Hero */
.saltospares-spare-finder {
    font-family: inherit;
}

.sf-hero {
    background: #009797;
    padding: 60px 20px;
    text-align: center;
}

.sf-hero-inner {
    max-width: 800px;
    margin: 0 auto;
}

.sf-hero h1 {
    font-size: 36px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 8px;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.sf-hero>.sf-hero-inner>p,
.sf-hero p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0 0 28px;
}

/* Search Box */
.sf-search-section {
    width: 100%;
}

.sf-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 2px solid transparent;
    border-radius: 4px;
    padding: 0 16px;
    max-width: 640px;
    margin: 0 auto;
    transition: border-color .2s, box-shadow .2s;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.sf-search-box:focus-within {
    border-color: #009797;
    box-shadow: 0 0 0 4px rgba(0, 151, 151, 0.18);
}

.sf-search-icon {
    color: #aaa;
    flex-shrink: 0;
}

.sf-search-box input {
    flex: 1;
    border: none;
    padding: 14px 0;
    font-size: 15px;
    outline: none;
    background: transparent;
    color: #1a2b47;
    min-width: 0;
}

.sf-search-box input::placeholder {
    color: #aaa;
}

.sf-clear-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #aaa;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    transition: color .2s;
}

.sf-clear-btn:hover {
    color: #555;
}

.sf-results-summary {
    text-align: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 10px;
    min-height: 18px;
}

/* Body + Layout */
.sf-body {
    background: #f7f7f7;
    padding: 32px 20px 60px;
}

.sf-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    max-width: 1360px;
    margin: 0 auto;
}

.sf-products-column {
    flex: 0 0 360px;
    min-width: 0;
}

.sf-spares-column {
    flex: 1;
    min-width: 0;
}

/* Column Headings */
.sf-column-heading {
    font-size: 14px;
    font-weight: 700;
    color: #1a2b47;
    margin: 0 0 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sf-count {
    font-weight: 400;
    font-size: 12px;
    color: #888;
    text-transform: none;
    letter-spacing: 0;
}

/* Products List */
.sf-products-list {
    max-height: 640px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background: #fff;
}

.sf-products-list::-webkit-scrollbar {
    width: 5px;
}

.sf-products-list::-webkit-scrollbar-track {
    background: #f7f7f7;
}

.sf-products-list::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

/* Product Items */
.sf-product-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background .12s;
    position: relative;
}

.sf-product-item:last-child {
    border-bottom: none;
}

.sf-product-item:hover {
    background: #f0fdfa;
}

.sf-product-item.active {
    background: #009797;
}

.sf-product-item.active:hover {
    background: #008585;
}

.sf-pi-thumb {
    width: 48px;
    height: 48px;
    border-radius: 3px;
    object-fit: contain;
    background: #f3f4f6;
    flex-shrink: 0;
    border: 1px solid #eee;
}

.sf-pi-thumb-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 3px;
    background: #f3f4f6;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 20px;
    border: 1px solid #eee;
}

.sf-pi-info {
    flex: 1;
    min-width: 0;
}

.sf-pi-title {
    font-size: 12.5px;
    font-weight: 600;
    color: #1a2b47;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sf-product-item.active .sf-pi-title {
    color: #fff;
}

.sf-pi-meta {
    font-size: 11px;
    color: #888;
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sf-product-item.active .sf-pi-meta {
    color: rgba(255, 255, 255, 0.75);
}

.sf-pi-badge {
    flex-shrink: 0;
    background: #e6f7f7;
    color: #009797;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
    margin-left: auto;
}

.sf-product-item.active .sf-pi-badge {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

/* Loading spinner */
.sf-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 20px;
    color: #888;
    font-size: 14px;
}

.sf-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #e5e7eb;
    border-top-color: #009797;
    border-radius: 50%;
    animation: sf-spin .7s linear infinite;
    flex-shrink: 0;
}

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

.sf-empty,
.sf-no-spares {
    padding: 40px 20px;
    text-align: center;
    color: #888;
    font-size: 14px;
}

.sf-no-spares {
    border: 2px dashed #e5e7eb;
    border-radius: 4px;
}

/* Prompt state */
.sf-prompt {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 50px 30px;
    border: 2px dashed #d1d5db;
    border-radius: 4px;
    background: #fff;
    color: #9ca3af;
}

.sf-prompt svg {
    flex-shrink: 0;
    color: #d1d5db;
}

.sf-prompt strong {
    display: block;
    font-size: 15px;
    color: #555;
    margin-bottom: 4px;
}

.sf-prompt p {
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
}

/* Spares Header */
.sf-spares-header {
    margin-bottom: 16px;
}

.sf-spares-header h2 {
    font-size: 17px;
    font-weight: 700;
    color: #1a2b47;
    margin: 0 0 3px;
}

.sf-spares-header p {
    font-size: 13px;
    color: #888;
    margin: 0;
}

/* Spares Grid */
.sf-spares-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

/* Spare Card */
.sf-spare-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
    display: flex;
    flex-direction: column;
}

.sf-spare-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.09);
    transform: translateY(-2px);
}

.sf-sc-img-wrap {
    width: 100%;
    height: 160px;
    background: #f7f7f7;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #f3f4f6;
    overflow: hidden;
}

.sf-sc-img {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
}

.sf-sc-placeholder {
    color: #d1d5db;
    font-size: 40px;
}

.sf-sc-body {
    padding: 14px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sf-sc-sku {
    font-size: 11px;
    color: #aaa;
    margin-bottom: 5px;
    font-family: monospace;
}

.sf-sc-body h3 {
    font-size: 13px;
    font-weight: 600;
    color: #1a2b47;
    margin: 0 0 5px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sf-sc-cats {
    font-size: 11px;
    color: #888;
    margin-bottom: 10px;
}

.sf-sc-price {
    font-size: 18px;
    font-weight: 700;
    color: #009797;
    margin-bottom: 8px;
}

.sf-sc-price del {
    font-size: 13px;
    color: #bbb;
    font-weight: 400;
}

.sf-sc-stock {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.sf-sc-stock.in-stock {
    color: #27ae60;
}

.sf-sc-stock.out-of-stock {
    color: #e74c3c;
}

.sf-sc-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sf-sc-btn {
    display: block;
    text-align: center;
    padding: 10px 12px;
    background: #009797;
    color: #fff !important;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background .2s;
    border: none;
    cursor: pointer;
}

.sf-sc-btn:hover {
    background: #007a7a;
    color: #fff !important;
}

/* Pagination */
.sf-pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 14px 0 0;
    flex-wrap: wrap;
}

.sf-page-btn {
    padding: 6px 11px;
    border: 1px solid #e5e7eb;
    border-radius: 3px;
    background: #fff;
    font-size: 12px;
    cursor: pointer;
    color: #1a2b47;
    transition: all .15s;
    font-family: inherit;
}

.sf-page-btn:hover:not(:disabled) {
    background: #f0fdfa;
    border-color: #009797;
    color: #009797;
}

.sf-page-btn.active {
    background: #009797;
    border-color: #009797;
    color: #fff;
}

.sf-page-btn:disabled {
    opacity: .4;
    cursor: default;
}

/* Mobile */
@media (max-width: 900px) {
    .sf-layout {
        flex-direction: column;
        gap: 20px;
    }

    .sf-products-column {
        flex: none;
        width: 100%;
    }

    .sf-products-list {
        max-height: 320px;
    }
}

@media (max-width: 768px) {
    .sf-hero {
        padding: 40px 16px;
    }

    .sf-hero h1 {
        font-size: 26px;
    }

    .sf-body {
        padding: 20px 16px 40px;
    }

    .sf-spares-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .sf-sc-img-wrap {
        height: 120px;
    }

    .sf-prompt {
        flex-direction: column;
        text-align: center;
        padding: 36px 20px;
    }

    .sf-prompt svg {
        display: none;
    }
}

@media (max-width: 480px) {
    .sf-spares-grid {
        grid-template-columns: 1fr;
    }
}