/* ============================================================
   Product listing page (/List/{category}/{id}) — scoped under .pl-page.
   Card style matches the home page / product details redesign.
   ============================================================ */

.pl-page {
    --pl-navy: #173a75;
    --pl-navy-2: #214687;
    --pl-blue: #3066be;
    --pl-light: #f0f5ff;
    --pl-chip: #dae7ff;
    --pl-yellow: #ffd812;
    --pl-green: #0bb17a;
    --pl-text: #2b3a55;
    --pl-muted: #5f6f8c;
    --pl-border: #e1e8f5;

    padding-bottom: 48px;
    color: var(--pl-text);
    background: var(--pl-light);
    overflow-x: hidden;
}

.pl-page .tab-pane {
    display: none;
}

.pl-page .tab-pane.active {
    display: block;
}

/* ---------- Head ---------- */
.pl-head {
    padding: 32px 0 8px;
}

.pl-page .pl-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    width: auto;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--pl-muted);
}

.pl-crumbs a {
    color: var(--pl-blue);
    text-decoration: none;
}

.pl-crumbs a:hover {
    text-decoration: underline;
}

.pl-crumbs .fa-chevron-right {
    font-size: 10px;
    opacity: .6;
}

.pl-head h1 {
    margin: 0 0 4px;
    font-size: 34px;
    font-weight: 700;
    color: var(--pl-navy);
}

.pl-head p {
    margin: 0;
    font-size: 14.5px;
    color: var(--pl-muted);
}

/* ---------- Category chips ---------- */
.pl-cats-wrap {
    padding-top: 18px;
}

.pl-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pl-chip {
    flex: 0 0 auto;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    color: var(--pl-navy);
    background: var(--pl-chip);
    text-decoration: none;
    transition: background .2s, color .2s;
}

.pl-chip:hover {
    color: var(--pl-navy);
    background: #c8dbff;
    text-decoration: none;
}

.pl-chip.active {
    color: #fff;
    background: var(--pl-navy);
}

/* ---------- Toolbar ---------- */
.pl-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 20px 0 18px;
    padding: 8px 10px;
    border: 1px solid var(--pl-border);
    border-radius: 14px;
    background: #fff;
}

.pl-views {
    display: flex;
    gap: 6px;
}

.pl-view {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    font-size: 15px;
    color: var(--pl-muted);
    background: var(--pl-light);
    cursor: pointer;
    transition: background .2s, color .2s;
}

.pl-view:hover {
    color: var(--pl-navy);
    background: var(--pl-chip);
}

.pl-view.active {
    color: #fff;
    background: var(--pl-navy);
}

.pl-sort {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pl-sort label {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    color: var(--pl-muted);
}

/* override the 32px-wide mobile select from style.css */
.pl-page .pl-sort select,
.pl-page .pl-sort select.selection {
    width: auto;
    min-width: 170px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #c9d5ea;
    border-radius: 10px;
    font-size: 14px;
    color: var(--pl-navy);
    background-color: #fff;
    cursor: pointer;
}

/* ---------- Product card (shared by list + grid) ---------- */
.pl-card {
    display: flex;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--pl-border);
    border-radius: 20px;
    color: var(--pl-text);
    background: #fff;
    text-decoration: none;
    transition: transform .2s, box-shadow .2s;
}

.pl-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 32px rgba(23, 58, 117, .12);
    color: var(--pl-text);
    text-decoration: none;
}

.pl-card-img {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    background: #fff;
}

.pl-card-img img {
    width: 100%;
    height: 100%;
    padding: 12px;
    object-fit: contain;
    transition: transform .3s;
}

.pl-card:hover .pl-card-img img {
    transform: scale(1.04);
}

.pl-save {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: var(--pl-green);
}

.pl-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    padding: 14px 16px 16px;
}

.pl-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 15.5px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--pl-navy);
}

.pl-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.5;
    color: var(--pl-muted);
}

.pl-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: auto;
    padding-top: 4px;
}

.pl-price b {
    font-size: 20px;
    color: var(--pl-navy);
}

.pl-price s {
    font-size: 14px;
    color: #9aa4b8;
}

.pl-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    padding: 10px 16px;
    border: 0;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    color: #1c2430;
    background: var(--pl-yellow);
    text-decoration: none;
    transition: background .2s;
}

.pl-card:hover .pl-cta,
a.pl-cta:hover {
    color: #1c2430;
    background: #ffe04a;
    text-decoration: none;
}

/* grid card: image on top */
.pl-card-grid {
    flex-direction: column;
}

.pl-card-grid .pl-card-body {
    border-top: 1px solid #eef2f9;
}

/* list card: image left, details right */
.pl-card-list {
    flex-direction: row;
    align-items: stretch;
}

.pl-card-list .pl-card-img {
    flex: 0 0 220px;
    width: 220px;
    border-right: 1px solid #eef2f9;
}

.pl-card-list .pl-card-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "name cta"
        "desc cta"
        "price cta";
    align-content: center;
    column-gap: 24px;
    row-gap: 8px;
    padding: 20px 24px;
}

.pl-card-list .pl-name { grid-area: name; font-size: 18px; }
.pl-card-list .pl-desc { grid-area: desc; font-size: 14px; }
.pl-card-list .pl-price { grid-area: price; margin-top: 4px; }
.pl-card-list .pl-price b { font-size: 22px; }

.pl-card-list .pl-cta {
    grid-area: cta;
    align-self: center;
    margin: 0;
    padding: 12px 22px;
}

/* ---------- Empty state ---------- */
.pl-empty {
    padding: 48px 20px;
    border: 2px dashed var(--pl-border);
    border-radius: 20px;
    text-align: center;
    background: #fff;
}

.pl-empty > i {
    margin-bottom: 12px;
    font-size: 42px;
    color: var(--pl-blue);
}

.pl-empty h3 {
    margin: 0 0 6px;
    font-size: 20px;
    color: var(--pl-navy);
}

.pl-empty p {
    margin: 0 0 18px;
    color: var(--pl-muted);
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .pl-card-list .pl-card-img {
        flex-basis: 180px;
        width: 180px;
    }

    /* button drops under the price */
    .pl-card-list .pl-card-body {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "name" "desc" "price" "cta";
        padding: 16px 18px;
    }

    .pl-card-list .pl-cta {
        justify-self: start;
    }
}

@media (max-width: 767px) {
    .pl-page {
        padding-bottom: 32px;
    }

    .pl-page .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .pl-head {
        padding-top: 22px;
    }

    .pl-head h1 {
        font-size: 26px;
    }

    /* chips: one swipeable row */
    .pl-cats {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin: 0 -16px;
        padding: 2px 16px 6px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .pl-cats::-webkit-scrollbar {
        display: none;
    }

    .pl-chip {
        padding: 7px 14px;
        font-size: 13px;
    }

    .pl-toolbar {
        margin: 14px 0;
    }

    .pl-page .pl-hide-sm {
        display: none !important;
    }

    .pl-sort label {
        display: none;
    }

    .pl-page .pl-sort select,
    .pl-page .pl-sort select.selection {
        min-width: 0;
        max-width: 170px;
        font-size: 13px;
    }

    .pl-card {
        border-radius: 16px;
    }

    .pl-card-img img {
        padding: 8px;
    }

    .pl-save {
        top: 8px;
        left: 8px;
        padding: 3px 8px;
        font-size: 11px;
    }

    .pl-card-body {
        gap: 4px;
        padding: 10px 10px 12px;
    }

    .pl-name {
        font-size: 14px;
    }

    .pl-price b {
        font-size: 17px;
    }

    .pl-price s {
        font-size: 12.5px;
    }

    .pl-cta {
        padding: 8px 10px;
        font-size: 13px;
    }

    .pl-card-grid .pl-desc,
    .pl-card-grid .pl-cta i {
        display: none;
    }

    /* list card on phones: compact image left */
    .pl-card-list .pl-card-img {
        flex-basis: 118px;
        width: 118px;
    }

    .pl-card-list .pl-card-body {
        padding: 12px;
        row-gap: 4px;
    }

    .pl-card-list .pl-name {
        font-size: 15px;
    }

    .pl-card-list .pl-desc {
        font-size: 12.5px;
    }

    .pl-card-list .pl-price b {
        font-size: 18px;
    }

    .pl-card-list .pl-cta {
        justify-self: stretch;
        padding: 8px 12px;
    }
}
