/* BDStall — pages/category-list.css
   Category listing page: list-view layout styles.
   Triggered by JS adding .list-view to #productGrid via classList.toggle(). */

/* ── List view: single-column grid ── */
.product-grid.list-view {
    grid-template-columns: 1fr;
    gap: 10px;
}

/* Card: 3-column layout — image | title | price */
.product-grid.list-view .product-card {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 150px;
    grid-template-rows: 1fr;
    align-items: stretch;
    border-radius: 12px;
    border: 1px solid var(--color-border-tertiary, #E8E8E4);
    background: #fff;
    transition: box-shadow .15s, border-color .15s;
    overflow: hidden;
    min-height: 110px;
}
.product-grid.list-view .product-card:hover {
    box-shadow: 0 4px 18px rgba(0,0,0,.08);
    border-color: var(--green, #149A49);
}

/* Col 1 — image */
.product-grid.list-view .product-card-image-wrap {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    aspect-ratio: unset;
    background: #f8f8f6;
    border-right: 1px solid var(--color-border-tertiary, #E8E8E4);
    border-radius: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 0 12px 12px;
    box-sizing: border-box;
}
.product-grid.list-view .product-card-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    box-sizing: border-box;
}

/* Col 2 — title, location, rating */
.product-grid.list-view .product-card-body {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 12px 16px;
    min-width: 0;
}

/* Col 3 — price, right-aligned */
.product-grid.list-view .product-card-price-col {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    padding: 12px 18px 12px 10px;
}
.product-grid.list-view .product-card-price-col .product-card-price-row {
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    margin: 0;
}

/* Title */
.product-grid.list-view .product-card-title {
    -webkit-line-clamp: 2;
    line-clamp: 2;
    min-height: auto;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text-primary, #1C1C1A);
    line-height: 1.45;
    margin: 0;
}

/* Price row */
.product-grid.list-view .product-card-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0;
}
.product-grid.list-view .product-card-price {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--green, #149A49);
    white-space: nowrap;
}
.product-grid.list-view .product-card-price-old {
    font-size: 0.8125rem;
    color: #6b7280;
    text-decoration: line-through;
    font-weight: 500;
    white-space: nowrap;
}

/* Rating star */
.product-grid.list-view .product-demand-badge-rating {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #92400e;
}
.product-grid.list-view .product-demand-badge-rating svg {
    stroke: #f59e0b;
    fill: #f59e0b;
    flex-shrink: 0;
}

/* Badges overlay on image */
.product-grid.list-view .product-card-badges {
    position: absolute;
    inset: 6px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
}

/* Stock pill */
.product-grid.list-view .product-card-rating { margin: 0; }
.product-grid.list-view .stock.in-stock {
    font-size: 0.75rem; font-weight: 600;
    color: var(--green, #149A49);
    background: var(--green-light, #D9F0E0);
    padding: 2px 8px; border-radius: 20px; display: inline-block;
}
.product-grid.list-view .stock.out-of-stock {
    font-size: 0.75rem; font-weight: 600;
    color: #dc2626; background: #fee2e2;
    padding: 2px 8px; border-radius: 20px; display: inline-block;
}

/* Demand badge row */
.product-grid.list-view .product-demand-badge-row {
    display: flex; align-items: center; gap: 8px;
    padding: 0 16px 10px; margin: 0;
}

/* Mobile: hide star from image, show below price */
@media (max-width: 767px) {
    .product-grid.list-view .product-card-star-float { display: none; }
    .product-grid.list-view .product-card-rating-below { display: flex; }
}

/* ── Tablet (600–899px) ── */
@media (max-width: 899px) {
    .product-grid.list-view .product-card {
        grid-template-columns: 120px minmax(0, 1fr) 130px;
    }
}

/* ── Mobile (<600px): 2-col — image left, title+price stacked right ── */
@media (max-width: 599px) {
    .product-grid.list-view .product-card {
        grid-template-columns: 100px minmax(0, 1fr);
        grid-template-rows: 1fr auto;
        min-height: 100px;
    }
    .product-grid.list-view .product-card-image-wrap {
        grid-column: 1;
        grid-row: 1 / 3;
        padding: 10px 0 10px 10px;
    }
    .product-grid.list-view .product-card-body {
        grid-column: 2;
        grid-row: 1;
        padding: 10px 12px 4px;
        justify-content: flex-start;
    }
    .product-grid.list-view .product-card-price-col {
        grid-column: 2;
        grid-row: 2;
        align-items: flex-start;
        padding: 2px 12px 10px;
    }
    .product-grid.list-view .product-card-price-col .product-card-price-row {
        flex-direction: row;
        align-items: baseline;
        gap: 6px;
    }
}
