/* ======================================================
   ONPAL WEB — Product Search/List Page
   File: /web/assets/product_list.css
====================================================== */

body {
    background: #f4f5f7;
}

.op-product-list-page {
    max-width: 1220px;
    margin: 0 auto;
    padding: 18px 14px 70px;
}

.op-product-list-head {
    background: #ffffff;
    border: 1px solid #e5ece7;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
}

.op-product-list-head h1 {
    margin: 0;
    color: #12372a;
    font-size: 22px;
    line-height: 1.2;
}

.op-product-list-head p {
    margin: 6px 0 0;
    color: #64746b;
    font-size: 14px;
}

.op-product-filter-bar {
    background: #ffffff;
    border: 1px solid #e5ece7;
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
}

.op-product-filter-label {
    color: #65766c;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.op-product-filter-btn {
    border: 1px solid #dfe8e1;
    background: #ffffff;
    color: #1f3327;
    border-radius: 10px;
    min-height: 38px;
    padding: 0 14px;
    font-weight: 900;
    white-space: nowrap;
}

.op-product-filter-btn.is-active {
    border-color: #0b7a31;
    background: #0b7a31;
    color: #ffffff;
}

.op-product-list-grid {
    background: #ffffff;
    border: 1px solid #e5ece7;
    border-radius: 16px;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.op-product-list-loading,
.op-product-list-empty,
.op-product-list-error {
    grid-column: 1 / -1;
    padding: 42px 18px;
    text-align: center;
    color: #65766c;
}

.op-product-card {
    min-width: 0;
    cursor: pointer;
    overflow: hidden;
    border: 1px solid #e5ece7;
    border-radius: 10px;
    background: #ffffff;
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.op-product-card:hover {
    transform: translateY(-1px);
    border-color: #16a34a;
    box-shadow: 0 8px 18px rgba(0, 80, 35, 0.10);
}

.op-product-card__image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f6f7f6;
    border-bottom: 1px solid #edf2ee;
}

.op-product-card__image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.op-product-card__badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    padding: 5px 8px;
    border-radius: 999px;
    background: #ff3b30;
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}

.op-product-card__body {
    padding: 8px 9px 9px;
    display: flex;
    flex-direction: column;
    min-height: 126px;
}

.op-product-card__name {
    color: #111827;
    font-size: 14px;
    font-weight: 800;
    line-height: 17px;
    min-height: 34px;
    max-height: 34px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.op-product-card__seller {
    margin-top: 4px;
    color: #6b7280;
    font-size: 11px;
    line-height: 14px;
    min-height: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.op-product-card__price {
    margin-top: 5px;
    color: #f0441f;
    font-size: 18px;
    font-weight: 900;
    line-height: 1.15;
    min-height: 21px;
}

.op-product-card__meta {
    margin-top: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    color: #6b7280;
    font-size: 11px;
    line-height: 14px;
}

.op-product-card__actions {
    margin-top: auto;
    padding-top: 7px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.op-product-card__btn {
    width: 100%;
    height: 34px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.op-product-card__btn--cart {
    background: #ffffff;
    color: #0b7a31;
    border: 1px solid #0b7a31;
}

.op-product-card__btn--buy {
    background: #0b7a31;
    color: #ffffff;
    border: 1px solid #0b7a31;
}

.op-product-card__btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

@media screen and (max-width: 1100px) {
    .op-product-list-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media screen and (max-width: 760px) {
    .op-product-list-page {
        padding: 10px 6px 60px;
    }

    /* Mobile: keep product list compact. Hide the page title block and top pagination. */
    .op-product-list-head,
    #productPagerTop {
        display: none !important;
    }

    .op-product-list-head,
    .op-product-filter-bar,
    .op-product-list-grid {
        border-radius: 0;
        border-right: 0;
        border-left: 0;
    }

    .op-product-list-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
        padding: 5px;
    }

    .op-product-card {
        border-radius: 6px;
    }

    .op-product-card__badge {
        top: 5px;
        left: 5px;
        padding: 3px 6px;
        font-size: 9px;
    }

    .op-product-card__body {
        min-height: 108px;
        padding: 5px;
    }

    .op-product-card__name {
        font-size: 10px;
        line-height: 13px;
        min-height: 26px;
        max-height: 26px;
    }

    .op-product-card__seller {
        display: none;
    }

    .op-product-card__price {
        margin-top: 3px;
        font-size: 12px;
    }

    .op-product-card__meta {
        margin-top: 2px;
        font-size: 9px;
        line-height: 12px;
    }

    .op-product-card__actions {
        gap: 5px;
        padding-top: 4px;
    }

    .op-product-card__btn {
        height: 28px;
        border-radius: 5px;
        font-size: 10px;
    }
}