/* listView-only — common already loaded */

/* ===== Category Buttons ===== */
.category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.category-buttons button {
    border-radius: 8px;
    padding: 6px 14px;
    background: #F5E8D9;
    color: #1D1616;
    border: 2px solid #E67E22;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.2;
}
.category-buttons button:hover {
    background: #E67E22;
    color: #fff;
    transform: none;
}
button.active {
    background: #8B0000;
    color: #FFD700;
    border-color: #8B0000;
}

/* ===== Variant Select ===== */
.variant-select {
    width: 100%;
    max-width: 110px;
    padding: 5px 8px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1.5px solid #d4a017;
    border-radius: 6px;
    background: #fffef5;
    color: #643805;
    text-align: center;
    cursor: pointer;
}

/* ===== Discount Badge ===== */
.discount-badge {
    display: inline-block;
    background: #2e7d32;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    white-space: nowrap;
}
.discount-badge.empty {
    background: transparent;
    color: transparent;
}

/* ===== Image Column ===== */
.col-image {
    width: 64px;
    max-width: 72px;
}
.col-image img,
td.col-image img {
    width: 48px !important;
    height: 48px !important;
    max-width: 48px !important;
    max-height: 48px !important;
    object-fit: cover !important;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

/* ===== Stock Column ===== */
.col-stock {
    text-align: center;
    vertical-align: middle;
    width: 100px;
    min-width: 90px;
}
.stock-urgency {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    min-width: 72px;
    padding: 0 10px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #FFFFFF !important;
    border-radius: 6px;
    white-space: nowrap;
    letter-spacing: 0.3px;
    margin: 0 auto;
}

/* ===== Shop Column ===== */
.col-shop {
    text-align: center;
    vertical-align: middle;
    min-width: 70px;
}

/* ===== Default Table ===== */
table {
    table-layout: auto;
    width: 100%;
}
.col-image,
.col-discount {
    display: table-cell;
}

/* =====================================================
   TABLET (769px – 1024px)
   ===================================================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .col-stock {
        width: 90px;
        min-width: 80px;
    }
    .stock-urgency {
        min-width: 64px;
        height: 26px;
        font-size: 0.72rem;
        padding: 0 6px;
    }
    .variant-select {
        max-width: 100px;
        font-size: 0.75rem;
    }
}

/* =====================================================
   MOBILE (max-width: 768px)
   ===================================================== */
@media (max-width: 768px) {
    /* Hide only Image + Discount */
    .col-image,
    .col-discount,
    th.col-image,
    td.col-image,
    th.col-discount,
    td.col-discount {
        display: none !important;
        width: 0 !important;
        padding: 0 !important;
        border: none !important;
    }

    table {
        table-layout: fixed !important;
        width: 100% !important;
    }

    th {
        font-size: 0.62rem !important;
        padding: 6px 2px !important;
        white-space: nowrap;
    }

    td {
        padding: 5px 2px !important;
    }

    .col-product,
    th.col-product {
        width: 26% !important;
        text-align: left !important;
        font-size: 0.72rem !important;
    }
    .col-variant,
    th.col-variant {
        width: 20% !important;
    }
    .col-price,
    th.col-price {
        width: 18% !important;
        font-size: 0.70rem !important;
    }
    .col-stock,
    th.col-stock {
        width: 18% !important;
        min-width: 0 !important;
    }
    .col-shop,
    th.col-shop {
        width: 18% !important;
        min-width: 0 !important;
    }

    .stock-urgency {
        min-width: 0;
        width: 100%;
        max-width: 62px;
        height: 22px;
        font-size: 0.60rem;
        padding: 0 3px;
        letter-spacing: 0;
    }

    .variant-select {
        max-width: 100%;
        width: 100%;
        font-size: 0.62rem;
        padding: 2px 1px;
    }

    .add-to-cart-btn {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.75rem !important;
        padding: 0 !important;
    }

    .product-name {
        font-size: 0.70rem !important;
        line-height: 1.2;
    }

    .category-buttons {
        gap: 6px;
        margin-bottom: 10px;
    }
    .category-buttons button {
        font-size: 0.70rem;
        padding: 4px 10px;
        border-radius: 6px;
        border-width: 1.5px;
    }
}

/* =====================================================
   VERY SMALL 360px (max-width: 400px)
   Stock column STAYS visible — only tighter padding
   ===================================================== */
@media (max-width: 400px) {
    th {
        font-size: 0.58rem !important;
        padding: 5px 1px !important;
    }

    td {
        padding: 4px 1px !important;
    }

    .col-product,
    th.col-product {
        width: 24% !important;
        font-size: 0.66rem !important;
        padding: 4px 2px !important;
    }
    .col-variant,
    th.col-variant {
        width: 20% !important;
        padding: 4px 1px !important;
    }
    .col-price,
    th.col-price {
        width: 18% !important;
        font-size: 0.64rem !important;
        padding: 4px 1px !important;
    }
    .col-stock,
    th.col-stock {
        width: 20% !important;
        padding: 4px 1px !important;
    }
    .col-shop,
    th.col-shop {
        width: 18% !important;
        padding: 4px 1px !important;
    }

    .stock-urgency {
        max-width: 56px;
        height: 20px;
        font-size: 0.55rem;
        padding: 0 2px;
        border-radius: 4px;
    }

    .variant-select {
        font-size: 0.55rem;
        padding: 2px 0;
        border-width: 1px;
    }

    .add-to-cart-btn {
        width: 26px !important;
        height: 26px !important;
        font-size: 0.70rem !important;
    }

    .product-name {
        font-size: 0.64rem !important;
    }

    /* Category buttons - compact but readable */
    .category-buttons {
        gap: 5px;
        margin-bottom: 8px;
    }
    .category-buttons button {
        font-size: 0.65rem;
        padding: 4px 9px;
        border-radius: 5px;
    }
}

/* =====================================================
   LARGE DESKTOP (min-width: 1025px)
   ===================================================== */
@media (min-width: 1025px) {
    .variant-select {
        max-width: 130px;
        font-size: 0.9rem;
    }
    .col-image img,
    td.col-image img {
        width: 52px !important;
        height: 52px !important;
    }
    .col-stock {
        width: 110px;
        min-width: 100px;
    }
    .stock-urgency {
        min-width: 78px;
        height: 30px;
        font-size: 0.82rem;
    }
}