/* ==========================================================================
   Katalog Produk Sinar Raya Motor — Public Section (parts.welcome.catalog)
   ========================================================================== */

.catalog-section {
    border-top: 1px solid var(--line, #e3e7ed);
    scroll-margin-top: 84px;
}

.catalog-head {
    margin-bottom: 32px;
}

.catalog-search-form {
    margin-bottom: 36px;
}

.catalog-search-field {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--white, #ffffff);
    border: 1.5px solid #d5dce6;
    border-radius: 6px;
    padding: 6px 6px 6px 16px;
    box-shadow: 0 8px 24px rgba(12, 20, 30, 0.05);
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.catalog-search-field:focus-within {
    border-color: var(--red, #e63b32);
    box-shadow: 0 10px 28px rgba(230, 59, 50, 0.12);
}

.catalog-search-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6b7685;
    flex-shrink: 0;
    margin-right: 12px;
}

.catalog-search-field:focus-within .catalog-search-icon {
    color: var(--red, #e63b32);
}

.catalog-search-input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font-family:
        "Inter",
        system-ui,
        -apple-system,
        sans-serif;
    font-size: 0.98rem;
    color: var(--ink, #1a2330);
    padding: 10px 8px 10px 0;
}

.catalog-search-input::placeholder {
    color: #8a95a5;
}

.catalog-search-input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.catalog-search-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-right: 8px;
    border-radius: 50%;
    background: #eef1f5;
    color: #4f5b69;
    font-size: 1.2rem;
    line-height: 1;
    text-decoration: none;
    flex-shrink: 0;
    transition:
        background-color 0.15s ease,
        color 0.15s ease;
}

.catalog-search-clear:hover {
    background: #dfe5ec;
    color: var(--navy, #0c141e);
}

.catalog-search-clear[hidden] {
    display: none !important;
}

.catalog-search-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: 0;
    border-radius: 4px;
    background: var(--red, #e63b32);
    color: #ffffff;
    font-family: "Plus Jakarta Sans", "Inter", sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    flex-shrink: 0;
    transition:
        background-color 0.2s ease,
        transform 0.15s ease;
}

.catalog-search-submit:hover {
    background: var(--red-dark, #c92f27);
}

.catalog-search-submit:active {
    transform: translateY(1px);
}

.catalog-search-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding: 0 4px;
}

.catalog-result-info {
    font-size: 0.88rem;
    color: var(--muted, #5a6573);
    margin: 0;
}

.catalog-result-info strong {
    color: var(--navy, #0c141e);
    font-weight: 700;
}

.catalog-result-info span {
    color: #7a8594;
}

/* Grid Kartu Produk — Gambar, Nomor Part, Nama Barang, Deskripsi Barang */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
}

.catalog-grid[hidden] {
    display: none !important;
}

.catalog-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--white, #ffffff);
    border: 1px solid var(--line, #e3e7ed);
    border-radius: 6px;
    overflow: hidden;
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease;
}

.catalog-card[hidden] {
    display: none !important;
}

.catalog-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--red, #e63b32);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.28s ease;
    z-index: 2;
}

.catalog-card:hover {
    transform: translateY(-4px);
    border-color: #cfd7e2;
    box-shadow: 0 16px 34px rgba(12, 20, 30, 0.08);
}

.catalog-card:hover::before {
    transform: scaleX(1);
}

.catalog-card-media {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #f8fafc;
    overflow: hidden;
    border-bottom: 1px solid var(--line, #e3e7ed);
}

.catalog-card-img {
    width: 100%;
    height: 100%;
    padding: 14px;
    object-fit: contain;
    object-position: center;
    background:
        radial-gradient(circle at 50% 42%, rgba(230, 59, 50, 0.04), rgba(248, 250, 252, 0) 68%),
        #f8fafc;
    display: block;
}

.catalog-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.72);
    background:
        radial-gradient(
            circle at 50% 50%,
            rgba(230, 59, 50, 0.16) 0%,
            rgba(12, 20, 30, 0) 68%
        ),
        linear-gradient(145deg, #0f1924 0%, #1b2a3b 100%);
    transition: color 0.25s ease;
}

.catalog-card:hover .catalog-card-placeholder {
    color: #ffffff;
}

.catalog-card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 22px 24px 24px;
}

.catalog-card-part {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 10px;
}

.catalog-card-part-label,
.catalog-card-part-value {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.45;
    letter-spacing: 0.02em;
}

.catalog-card-part-label {
    background: #f3f5f8;
    border: 1px solid #e1e6ee;
    color: #475569;
    text-transform: uppercase;
}

.catalog-card-part-value {
    max-width: 100%;
    background: #fff2f1;
    border: 1px solid #f7d1cd;
    color: #b42318;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    overflow-wrap: anywhere;
}

.catalog-card-title {
    font-family: "Plus Jakarta Sans", "Inter", sans-serif;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.38;
    color: var(--navy, #0c141e);
    margin: 0 0 10px;
}

.catalog-card-desc {
    font-family:
        "Inter",
        system-ui,
        -apple-system,
        sans-serif;
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--muted, #5a6573);
    margin: 0;
}

.catalog-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 20px;
}

.catalog-product-link {
    display: inline-flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #ffffff;
    text-decoration: none;
    transition:
        filter 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.catalog-product-link svg {
    display: block;
    width: 23px;
    height: 23px;
}

.catalog-product-link:hover {
    color: #ffffff;
    filter: brightness(0.92);
    transform: translateY(-1px);
}

.catalog-product-link:focus-visible {
    outline: 3px solid rgba(12, 20, 30, 0.35);
    outline-offset: 3px;
}

.catalog-product-link-whatsapp {
    background: #168b54;
}

.catalog-product-link-shopee {
    background: #ee4d2d;
}

.catalog-product-link-tokopedia {
    background: #fff;
}

/* Empty Search State */
.catalog-empty {
    text-align: center;
    background: var(--white, #ffffff);
    border: 1px dashed #cbd4e1;
    border-radius: 6px;
    padding: 52px 24px;
}

.catalog-empty[hidden] {
    display: none !important;
}

.catalog-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(230, 59, 50, 0.08);
    color: var(--red, #e63b32);
    margin-bottom: 16px;
}

.catalog-empty-title {
    font-family: "Plus Jakarta Sans", "Inter", sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--navy, #0c141e);
    margin: 0 0 8px;
}

.catalog-empty-desc {
    max-width: 480px;
    margin: 0 auto 22px;
    font-size: 0.94rem;
    line-height: 1.6;
    color: var(--muted, #5a6573);
}

.catalog-reset-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 22px;
    border-radius: 4px;
    border: 1.5px solid var(--navy, #0c141e);
    background: transparent;
    color: var(--navy, #0c141e);
    font-family: "Plus Jakarta Sans", "Inter", sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

.catalog-reset-link:hover {
    background: var(--navy, #0c141e);
    color: #ffffff;
}

.catalog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 36px;
}

.catalog-page-numbers {
    display: flex;
    align-items: center;
    gap: 5px;
}

.catalog-page-link,
.catalog-page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 11px;
    border: 1px solid #d4dde4;
    border-radius: 4px;
    background: #ffffff;
    color: #50606d;
    font-family: "Plus Jakarta Sans", "Inter", sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.catalog-page-link:hover {
    border-color: var(--red, #e63b32);
    color: var(--red, #e63b32);
}

.catalog-page-link.is-current {
    border-color: var(--red, #e63b32);
    background: var(--red, #e63b32);
    color: #ffffff;
}

.catalog-page-link.is-disabled {
    border-color: #e3e8ec;
    background: #f7f9fa;
    color: #aab4bc;
    cursor: not-allowed;
}

.catalog-page-ellipsis {
    min-width: 22px;
    padding: 0;
    border-color: transparent;
    background: transparent;
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
    .catalog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (max-width: 640px) {
    .catalog-search-field {
        flex-wrap: wrap;
        padding: 10px 12px;
        gap: 8px;
    }

    .catalog-search-input {
        width: calc(100% - 76px);
        padding: 6px 0;
        font-size: 0.94rem;
    }

    .catalog-search-submit {
        width: 100%;
        padding: 11px 18px;
    }

    .catalog-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .catalog-card-body {
        padding: 18px 20px 20px;
    }

    .catalog-pagination {
        flex-wrap: wrap;
    }

    .catalog-pagination > .catalog-page-link {
        order: 2;
    }

    .catalog-page-numbers {
        order: 1;
        width: 100%;
        justify-content: center;
    }
}
