/* mod_sparepart_search — matches "Unggul Diesel Industrial" template tokens,
   with safe fallback values so it still looks right on any template. */

.sps-wrapper {
    --sps-yellow: var(--udp-yellow, #FFC300);
    --sps-ink: var(--udp-ink, #14171A);
    --sps-steel: var(--udp-steel, #3D4247);
    --sps-alloy: var(--udp-alloy, #EDEBE6);
    --sps-rust: var(--udp-rust, #C1440E);
    --sps-white: #FFFFFF;
    --sps-font-display: var(--udp-font-display, 'Oswald', sans-serif);
    --sps-font-body: var(--udp-font-body, 'Inter', sans-serif);
    --sps-font-mono: var(--udp-font-mono, 'Roboto Mono', monospace);

    font-family: var(--sps-font-body);
    color: var(--sps-steel);
}

.sps-admin-notice {
    background: #FFF3CD;
    border: 1px solid #E0A800;
    color: #5A4400;
    padding: 12px 16px;
    border-radius: 3px;
    font-size: 13px;
    margin-bottom: 16px;
}

.sps-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: var(--sps-ink);
    padding: 16px;
    border-radius: 3px;
    border-top: 4px solid var(--sps-yellow);
}

.sps-input, .sps-select {
    font-family: var(--sps-font-body);
    font-size: 14px;
    padding: 12px 14px;
    border: none;
    border-radius: 3px;
    background: #fff;
    color: var(--sps-ink);
}

.sps-input { flex: 2 1 240px; }
.sps-select { flex: 1 1 160px; }

.sps-btn-search {
    flex: 0 0 auto;
    font-family: var(--sps-font-display);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    font-size: 14px;
    background: var(--sps-yellow);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.sps-btn-search:hover { background: var(--sps-rust, #C1440E); }

.sps-hint, .sps-empty {
    margin-top: 18px;
    padding: 16px;
    background: var(--sps-alloy);
    border-left: 4px solid var(--sps-yellow);
    border-radius: 3px;
    font-size: 14px;
}

.sps-result-count {
    margin: 20px 0 12px;
    font-family: var(--sps-font-display);
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.06em;
    color: var(--sps-steel);
}

.sps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

.sps-card {
    position: relative;
    background: var(--sps-white);
    border: 1px solid #DCD8D0;
    border-radius: 3px;
    box-shadow: 0 2px 10px rgba(20,23,26,0.08);
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.sps-card:hover { box-shadow: 0 12px 28px rgba(20,23,26,0.16); transform: translateY(-2px); }

/* rivet corners — signature detail shared with template's spec-plate cards */
.sps-card::before, .sps-card::after {
    content: '';
    position: absolute;
    top: 8px;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #fff, #9AA0A6 70%);
    z-index: 2;
}
.sps-card::before { left: 8px; }
.sps-card::after { right: 8px; }

.sps-thumb {
    aspect-ratio: 4 / 3;
    background: var(--sps-alloy);
    cursor: zoom-in;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.sps-thumb img { width: 100%; height: 100%; object-fit: cover; }

.sps-card-body { padding: 14px; }

.sps-tag {
    display: inline-block;
    font-family: var(--sps-font-display);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.05em;
    background: var(--sps-ink);
    color: var(--sps-yellow);
    padding: 3px 9px;
    border-radius: 2px;
    margin-bottom: 8px;
}

.sps-part-number {
    font-family: var(--sps-font-mono);
    font-weight: 600;
    font-size: 15px;
    color: var(--sps-ink);
    margin-bottom: 4px;
    word-break: break-word;
}

.sps-desc {
    font-size: 13px;
    color: var(--sps-steel);
    margin-bottom: 8px;
    min-height: 1.2em;
}

.sps-brand, .sps-lokasi {
    font-size: 12px;
    color: #6B7075;
}
.sps-lokasi { margin-top: 4px; }

/* Lightbox */
.sps-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
}
.sps-lightbox.sps-open { display: block; }

.sps-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(20,23,26,0.86);
}

.sps-lightbox-content {
    position: relative;
    max-width: 720px;
    width: 92%;
    margin: 5vh auto;
    background: var(--sps-white);
    border-radius: 4px;
    border-top: 6px solid var(--sps-yellow);
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.sps-lightbox-close {
    position: absolute;
    top: 10px; right: 12px;
    background: var(--sps-ink);
    color: var(--sps-yellow);
    border: none;
    width: 34px; height: 34px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.sps-lightbox-img {
    width: 100%;
    max-height: 45vh;
    object-fit: contain;
    background: var(--sps-alloy);
}

.sps-lightbox-info {
    padding: 20px;
    overflow-y: auto;
}
.sps-lightbox-info h3 {
    font-family: var(--sps-font-display);
    text-transform: uppercase;
    font-size: 18px;
    color: var(--sps-ink);
    margin: 0 0 12px;
}
.sps-lightbox-info p { margin: 0 0 8px; font-size: 14px; }
.sps-lightbox-info .sps-label { color: #8A9096; margin-right: 6px; }
.sps-lightbox-part { font-family: var(--sps-font-mono); font-weight: 600; }

@media (max-width: 640px) {
    .sps-form-row { flex-direction: column; }
    .sps-input, .sps-select, .sps-btn-search {
        width: 100%;
        flex: 0 0 auto;
    }
    .sps-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
}

/* Teks petunjuk + tombol "Lihat Semua Produk" */
.sps-hint { text-align: center; }
.sps-hint-text { margin: 0 0 14px; }
.sps-hint-btn {
    display: inline-block;
    font-family: var(--sps-font-display);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    font-size: 14px;
    background: var(--sps-yellow);
    color: #fff;
    text-decoration: none;
    padding: 12px 28px;
    border-radius: 3px;
    transition: background 0.15s ease;
}
.sps-hint-btn:hover { background: var(--sps-rust, #C1440E); color: #fff; }

.sps-empty { text-align: center; }
.sps-grid + .sps-hint { margin-top: 24px; }
