/* =============================================
   Product Listing — Unified
   app_product_listing.css
   ============================================= */

.prl__container {
    margin-bottom: 45px !important;
    overflow: hidden;
}

/* =============================================
   Desktop — table native
   ============================================= */

.prl__table {
    width: 100%;
    border-collapse: collapse;
}

.prl__table thead tr {
    background: #f3f2f7;
    border-bottom: 2px solid rgba(0,0,0,.08);
}

.prl__table thead th {
    font-size: .72rem;
    font-weight: 600;
    color: #6e6b7b;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 8px 10px;
    white-space: nowrap;
}

.prl__table tbody tr {
    border-bottom: 1px solid rgba(0,0,0,.06);
    border-left: 3px solid transparent;
}

.prl__table tbody tr:last-child  { border-bottom: none; }
.prl__table tbody tr.prl__row--active  { border-left-color: #28c76f; }
.prl__table tbody tr.prl__row--passive { border-left-color: #ea5455; }

.prl__table tbody td {
    padding: 8px 10px;
    vertical-align: middle;
    background: #fff;
}

.prl__table tbody tr:hover td {
    background-color: #ff9 !important;
}

.prl__col--flags   { width: 1px; white-space: nowrap; }
.prl__col--name    { }
.prl__col--stock   { width: 160px; white-space: nowrap; }
.prl__col--price   { width: 120px; white-space: nowrap; text-align: right; }
.prl__col--cart    { width: 150px; white-space: nowrap; }
.prl__col--actions { width: 1px; white-space: nowrap; text-align: right; }

/* =============================================
   Cell içerikleri
   ============================================= */

.prl__cell--flags {
    display: flex;
    gap: 3px;
    align-items: center;
}

.prl__name__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #3d3d3d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}

.prl__name__sub {
    font-size: .9rem;
    color: #b9b9c3;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}

.prl__stock__total {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: .8rem;
    font-weight: 700;
    margin-bottom: 3px;
}

.prl__stock__total--in  { background: #e8f9ee; color: #1f9d57; }
.prl__stock__total--out { background: #f3f2f7; color: #82868b; }

.prl__stock__sub {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: .78rem;
}

.prl__stock__sub__label   { color: #82868b; }
.prl__stock__sub__val     { font-weight: 700; color: #3d3d3d; }
.prl__stock__sub__val--res { font-weight: 700; color: #ea5455; }
.prl__stock__sep          { color: #d8d6de; font-size: .65rem; }

.prl__price__val {
    font-size: 1.05rem;
    font-weight: 700;
    color: #3d3d3d;
}

.prl__price__cur {
    font-size: .82rem;
    color: #82868b;
    margin-left: 2px;
}

.prl__cart__group {
    display: flex;
    align-items: stretch;
}

.prl__cart__group .form-control {
    width: 52px;
    min-width: 0;
    height: 32px;
    padding: 0 6px;
    text-align: center;
    border-radius: 4px 0 0 4px;
    border-right: 0;
}

.prl__cart__group .btn-cart {
    height: 32px;
    padding: 0 10px;
    border-radius: 0 4px 4px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prl__cell--actions {
    display: flex;
    justify-content: flex-end;
    gap: 3px;
}

.prl__cell--actions .btn {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.prl__cell--actions .btn svg {
    width: 14px;
    height: 14px;
}

/* =============================================
   Mobil — table → grid/card
   ============================================= */

@media screen and (max-width: 991px) {

    .prl__table,
    .prl__table tbody,
    .prl__table thead,
    .prl__table tr,
    .prl__table td,
    .prl__table th {
        display: block;
        width: auto;
    }

    .prl__table thead {
        display: none;
    }

    .prl__table tbody tr {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "name    flags"
            "stock   price"
            "cartrow cartrow";
        border: 1px solid rgba(0,0,0,.1);
        border-left: 3px solid transparent;
        border-radius: .428rem;
        margin-bottom: 8px;
        align-items: stretch;
    }

    .prl__table tbody tr.prl__row--active  { border-left-color: #28c76f; }
    .prl__table tbody tr.prl__row--passive { border-left-color: #ea5455; }
    .prl__table tbody tr:hover { background: transparent; }

    .prl__table tbody td {
        white-space: normal;
        background: #fff;
    }

    .prl__col--flags {
        grid-area: flags;
        padding: 8px 8px 8px 0;
        display: flex;
        align-items: center;
        align-self: stretch;
        background: #fff;
    }

    .prl__col--name {
        grid-area: name;
        padding: 8px 0 8px 12px;
        border-bottom: 1px solid rgba(0,0,0,.06);
        min-width: 0;
    }

    .prl__col--stock {
        grid-area: stock;
        padding: 8px 8px 8px 12px;
        border-bottom: 1px solid rgba(0,0,0,.06);
        border-right: 1px solid rgba(0,0,0,.06);
    }

    .prl__col--price {
        grid-area: price;
        padding: 8px 12px 8px 8px;
        border-bottom: 1px solid rgba(0,0,0,.06);
        text-align: left;
    }

    .prl__mobile__row {
        display: flex !important;
        align-items: center;
        gap: 8px;
        padding: 8px 12px;
        border-top: 1px solid rgba(0,0,0,.06);
        background: #fff;
    }

    .prl__mobile__row .prl__cart__group {
        flex: 0 0 auto;
    }

    .prl__mobile__row .prl__cart__group .form-control {
        width: 56px;
        flex: 0 0 56px;
        height: 32px;
    }

    .prl__mobile__row .prl__cart__group .btn-cart {
        height: 32px;
        flex: 0 0 auto;
    }

    .prl__mobile__actions {
        display: flex;
        gap: 3px;
        flex-shrink: 0;
        margin-left: auto;
    }

    /* Desktop cart + actions td'leri mobilde gizle */
    .prl__col--cart,
    .prl__col--actions {
        display: none !important;
        grid-area: unset;
    }

    /* Mobil stock içerik */
    .prl__stock__total { margin-bottom: 2px; }

    .prl__stock__sub { flex-wrap: wrap; }

    /* Mobil cart */
    .prl__cart__group {
        width: 100%;
    }

    .prl__cart__group .form-control {
        width: 60px;
        flex: 0 0 60px;
        height: 36px;
    }

    .prl__cart__group .btn-cart {
        flex: 0 0 auto;
        height: 36px;
    }

    /* Mobil actions */
    .prl__cell--actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .prl__name__title,
    .prl__name__sub {
        max-width: calc(100vw - 140px);
        white-space: nowrap;
    }
}

/* =============================================
   Responsive hide utilities
   ============================================= */

/* mobile row sadece mobilde */
.prl__mobile__row { display: none; }

@media screen and (max-width: 575px)  { .prl__hide_xs { display: none !important; } }
@media screen and (max-width: 767px)  { .prl__hide_sm { display: none !important; } }
@media screen and (max-width: 991px)  { .prl__hide_md { display: none !important; } }
@media screen and (max-width: 1199px) { .prl__hide_lg { display: none !important; } }
@media screen and (max-width: 1399px) { .prl__hide_xl { display: none !important; } }
