/* ============================================================
   SafeBuy — Shop / Product Listing Page Styles
   Used by: shop/index.php
   ============================================================ */

.shop-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem 5rem;
}

/* ── Page header ── */
.shop-header {
    padding: 6rem 0 3rem;
    border-bottom: 1px solid #E8E5E0;
    margin-bottom: 2.5rem;
}
.shop-header h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 700;
    color: #0B1628;
    line-height: 1.1;
    margin: 0 0 0.5rem;
}
.shop-header p { color: #888; font-size: 0.9rem; margin: 0; }

/* ── Search bar ── */
.search-row { display: flex; gap: 0.75rem; margin-bottom: 2rem; }
.search-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid #E8E5E0;
    border-radius: 0.75rem;
    overflow: hidden;
    transition: border-color 0.2s;
}
.search-wrap:focus-within { border-color: #C9933A; }
.search-wrap i { padding: 0 1rem; color: #bbb; font-size: 1.1rem; flex-shrink: 0; }
.search-wrap input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.85rem 0;
    font-size: 0.9rem;
    color: #0B1628;
    background: transparent;
    font-family: 'Plus Jakarta Sans', sans-serif;
}
.search-wrap input::placeholder { color: #bbb; }

.btn-search {
    background: #0B1628;
    color: #fff;
    border: none;
    padding: 0.85rem 1.75rem;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Plus Jakarta Sans', sans-serif;
    border-radius: 0.65rem;
    white-space: nowrap;
    transition: background 0.2s;
}
.btn-search:hover { background: #1B3A6B; }

/* ── Layout ── */
.shop-body {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 3rem;
    align-items: start;
}
@media (max-width: 768px) {
    .shop-body { grid-template-columns: 1fr; }
}

/* ── Sidebar ── */
.sidebar { position: sticky; top: 5rem; }
.filter-section { margin-bottom: 2rem; }
.filter-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #aaa;
    margin-bottom: 0.85rem;
    display: block;
}

.filter-cat { display: flex; flex-direction: column; gap: 0.15rem; }
.filter-cat a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.6rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #555;
    text-decoration: none;
    transition: all 0.15s;
}
.filter-cat a:hover { background: #F7F5F2; color: #0B1628; }
.filter-cat a.active { background: #0B1628; color: #fff; font-weight: 600; }
.filter-cat a .count { font-size: 0.72rem; opacity: 0.6; }
.filter-cat a.active .count { opacity: 0.7; }

.filter-state select {
    width: 100%;
    border: 1.5px solid #E8E5E0;
    border-radius: 0.6rem;
    padding: 0.6rem 0.8rem;
    font-size: 0.875rem;
    color: #0B1628;
    background: #fff;
    outline: none;
    font-family: 'Plus Jakarta Sans', sans-serif;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}
.filter-state select:focus { border-color: #C9933A; }

.sidebar-escrow-badge {
    margin-top: 2rem;
    padding: 1rem;
    background: #F7F5F2;
    border-radius: 0.75rem;
    border-left: 3px solid #C9933A;
}
.sidebar-escrow-badge p:first-child {
    font-size: 0.75rem;
    font-weight: 700;
    color: #0B1628;
    margin-bottom: 0.35rem;
}
.sidebar-escrow-badge p:last-child {
    font-size: 0.72rem;
    color: #888;
    line-height: 1.5;
}

/* ── Results bar ── */
.results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.results-count { font-size: 0.875rem; color: #888; }
.results-count strong { color: #0B1628; }
.sort-wrap { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: #888; }
.sort-wrap select {
    border: 1.5px solid #E8E5E0;
    border-radius: 0.5rem;
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
    color: #0B1628;
    outline: none;
    cursor: pointer;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: #fff;
}
.sort-wrap select:focus { border-color: #C9933A; }

/* ── Active filter pills ── */
.active-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #F7F5F2;
    border: 1px solid #E8E5E0;
    color: #555;
    font-size: 0.775rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
}
.filter-pill a { color: #aaa; text-decoration: none; font-size: 0.9rem; }
.filter-pill a:hover { color: #E24B4A; }

/* ── Product grid ── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
}

/* ── Product card ── */
.p-card {
    background: #fff;
    border: 1.5px solid #F0EDE8;
    border-radius: 0.85rem;
    overflow: hidden;
    text-decoration: none;
    display: block;
    transition: border-color 0.2s, transform 0.2s;
}
.p-card:hover { border-color: #C9933A; transform: translateY(-3px); }
.p-card:hover .p-name { color: #C9933A; }

.p-img { aspect-ratio: 1; overflow: hidden; background: #F7F5F2; position: relative; }
.p-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}
.p-card:hover .p-img img { transform: scale(1.04); }

.p-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #ccc;
}
.p-img-placeholder i { font-size: 2rem; }
.p-img-placeholder span {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.p-sponsored {
    position: absolute;
    top: 0;
    left: 0;
    background: #C9933A;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.3rem 0.6rem;
    border-bottom-right-radius: 0.5rem;
}

.p-unavailable { opacity: 0.45; pointer-events: none; }

.p-body { padding: 0.9rem; }
.p-cat {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #C9933A;
    margin-bottom: 0.35rem;
}
.p-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #0B1628;
    line-height: 1.35;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}
.p-price { font-size: 0.95rem; font-weight: 700; color: #0B1628; }
.p-price.negotiable { color: #C9933A; font-size: 0.825rem; }
.p-meta { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.5rem; font-size: 0.72rem; color: #bbb; }
.p-meta i { font-size: 0.8rem; }

/* ── Empty state ── */
.empty-state { grid-column: 1 / -1; padding: 5rem 2rem; text-align: center; }
.empty-state h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    color: #0B1628;
    margin-bottom: 0.5rem;
}
.empty-state p { color: #aaa; font-size: 0.875rem; margin-bottom: 2rem; }
.btn-clear {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1.5px solid #0B1628;
    color: #0B1628;
    padding: 0.7rem 1.5rem;
    border-radius: 0.65rem;
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-clear:hover { background: #0B1628; color: #fff; }

/* ── Mobile sidebar ── */
.mob-filter-btn { display: none; }

@media (max-width: 768px) {
    .mob-filter-btn {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        border: 1.5px solid #E8E5E0;
        background: #fff;
        padding: 0.65rem 1.1rem;
        border-radius: 0.65rem;
        font-size: 0.875rem;
        font-weight: 600;
        color: #0B1628;
        cursor: pointer;
        font-family: 'Plus Jakarta Sans', sans-serif;
    }
    .sidebar {
        position: fixed;
        inset: 0;
        background: #fff;
        z-index: 100;
        overflow-y: auto;
        padding: 2rem 1.5rem;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.open { transform: translateX(0); }
}

.sidebar-close {
    display: none;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.sidebar-close-btn {
    border: none;
    background: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: #888;
    padding: 0.25rem;
}

@media (max-width: 768px) {
    .sidebar-close { display: flex; }
}