/* ══════════════════ SHOP PAGE ══════════════════ */

/* Sticky header + nav on shop page */
#mainHeader { position: sticky; top: 0; z-index: 600; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.nav-bar    { position: sticky; top: 69px; z-index: 500; }

/* ── Breadcrumb ── */
.breadcrumb-bar { padding: 10px 0; border-bottom: 1px solid #f0f0f0; background: #fff; }
.breadcrumb-list { display: flex; align-items: center; gap: 6px; list-style: none; padding: 0; margin: 0; font-size: 13px; color: #888; flex-wrap: wrap; }
.breadcrumb-list a { color: #555; text-decoration: none; }
.breadcrumb-list a:hover { color: var(--primary); }
.breadcrumb-list .sep { color: #ccc; font-size: 10px; }
.breadcrumb-list .current { color: var(--dark); font-weight: 600; }

/* ── Hero Banner ── */
.page-hero { position: relative; background: linear-gradient(135deg, #1f4a1f 0%, #2d6a2d 55%, #235923 100%); color: #fff; padding: 38px 0 44px; }
.page-hero h1, .page-hero .page-hero-title { font-size: 36px; font-weight: 800; margin: 0 0 6px; letter-spacing: 0.2px; line-height: 1.1; }
.page-hero p { font-size: 13.5px; opacity: 0.92; margin: 0 0 18px; font-weight: 400; }

/* ── Hero Search ── */
.hero-search { position: relative; display: flex; align-items: center; max-width: 460px; background: #fff; border-radius: 999px; overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,0.18); padding: 4px 4px 4px 18px; }
.hero-search .search-ico { color: #b5b5b5; font-size: 13px; flex-shrink: 0; margin-right: 8px; }
.hero-search input { flex: 1; border: none; outline: none; background: transparent; padding: 10px 6px; font-size: 13.5px; font-family: inherit; color: var(--dark); }
.hero-search input::placeholder { color: #b5b5b5; }
.hero-search button { background: linear-gradient(135deg, #1a2e1a, #2c4a2c); color: #fff; border: none; padding: 9px 22px; font-size: 13px; font-weight: 700; cursor: pointer; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; transition: all 0.2s; font-family: inherit; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.hero-search button:hover { background: linear-gradient(135deg, #2c4a2c, #3d6a3d); }
.hero-search button i { font-size: 12px; }

/* ── Page Layout ── */
.products-page { padding: 28px 0 48px; background: #fafafa; }
.products-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: flex-start; }

/* ── Sidebar ── */
.sidebar-card { background: #fff; border: 1px solid #eee; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,0.03); position: sticky; top: 130px; max-height: calc(100vh - 150px); overflow-y: auto; }
.sidebar-card::-webkit-scrollbar { width: 5px; }
.sidebar-card::-webkit-scrollbar-track { background: #f5f5f5; }
.sidebar-card::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 4px; }
.sidebar-card::-webkit-scrollbar-thumb:hover { background: var(--primary); }
.sidebar-title { padding: 14px 16px; font-size: 14px; font-weight: 800; color: var(--dark); border-bottom: 1px solid #eee; background: #fff; letter-spacing: 0.3px; }
.sidebar-accordion .acc-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; cursor: pointer; font-size: 13px; font-weight: 700; color: #333; background: #f9f9f9; border-bottom: 1px solid #eee; transition: background 0.2s; }
.sidebar-accordion .acc-head:hover { background: #f1f1f1; }
.sidebar-accordion .acc-head i { font-size: 11px; transition: transform 0.25s; color: #888; }
.sidebar-accordion .acc-head.collapsed i { transform: rotate(-90deg); }
.sidebar-accordion .acc-body { padding: 6px 0 10px; }
.sidebar-accordion .acc-body a { display: block; padding: 7px 18px; font-size: 12.5px; color: #444; line-height: 1.4; transition: color 0.15s, background 0.15s; }
.sidebar-accordion .acc-body a:hover, .sidebar-accordion .acc-body a.active { color: var(--primary); background: #f4faf3; }

/* ── Sidebar Recent Products ── */
.sidebar-recent-products { padding: 10px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.sidebar-recent-item { display: flex; align-items: center; gap: 12px; text-decoration: none; padding: 8px; border: 1px solid transparent; border-radius: 6px; transition: all 0.2s; }
.sidebar-recent-item:hover { background: #f9f9f9; border-color: #eee; }
.recent-img { width: 50px; height: 50px; flex-shrink: 0; background: #fff; border: 1px solid #f0f0f0; border-radius: 4px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.recent-img img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.recent-info { flex: 1; min-width: 0; }
.recent-name { font-size: 12.5px; font-weight: 700; color: #333; margin: 0 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.recent-price { font-size: 12px; display: flex; align-items: center; gap: 6px; }
.recent-price .curr { font-weight: 800; color: var(--primary); }
.recent-price .old { color: #999; text-decoration: line-through; font-size: 11px; }

/* ── Main Column ── */
.main-col { min-width: 0; }
.results-bar { display: flex; align-items: center; justify-content: space-between; background: #fff; border: 1px solid #eee; border-radius: 8px; padding: 12px 18px; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; box-shadow: 0 2px 6px rgba(0,0,0,0.03); }
.results-count { font-size: 13px; color: #555; }
.results-count strong { color: var(--dark); font-weight: 800; }
.sort-wrap { display: flex; align-items: center; gap: 8px; }
.sort-wrap label { font-size: 13px; color: #555; font-weight: 600; margin: 0; }
.sort-wrap select { border: 1px solid #ddd; border-radius: 6px; padding: 6px 30px 6px 12px; font-size: 13px; font-family: inherit; color: #333; background-color: #fff; cursor: pointer; outline: none; transition: border-color 0.2s; }
.sort-wrap select:focus { border-color: var(--primary); }

/* ── Products Grid ── */
.products-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.product-tag .star { color: #ffc107; font-size: 10px; }
.product-tag .count { color: #888; font-weight: 600; margin-left: 2px; }

/* ── Card badge: keep on a single line, truncate if too long ── */
.products-grid .card-badge {
    max-width: calc(100% - 60px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

/* ── Empty state ── */
.shop-empty { grid-column: 1 / -1; background: #fff; border: 1px dashed #e0e0e0; border-radius: 8px; padding: 40px 20px; text-align: center; color: #777; font-size: 14px; }
.shop-empty p { margin: 0 0 14px; }
.shop-empty .btn-buy-now { display: inline-block; width: auto; padding: 8px 22px; }

/* ── Pagination ── */
.pagination-wrap { display: flex; justify-content: center; margin-top: 30px; }
.pagination-list { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 0; margin: 0; list-style: none; }
.pagination-list a, .pagination-list span { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 10px; background: #fff; border: 1px solid #e0e0e0; border-radius: 6px; color: #444; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.pagination-list a:hover { border-color: var(--primary); color: var(--primary); }
.pagination-list .active { background: var(--primary); border-color: var(--primary); color: #fff; cursor: default; }
.pagination-list .disabled { color: #bbb; cursor: not-allowed; background: #f7f7f7; }

/* ── Mobile Filter Bar (hidden on desktop) ── */
.mob-shop-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0 14px;
}

.mob-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    color: #333;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    flex-shrink: 0;
}
.mob-filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.mob-filter-btn i { font-size: 13px; }

.mob-sort-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    justify-content: flex-end;
}
.mob-sort-inline label { font-size: 13px; color: #555; font-weight: 600; margin: 0; white-space: nowrap; }
.mob-sort-inline select { border: 1.5px solid #ddd; border-radius: 6px; padding: 7px 10px; font-size: 13px; font-family: inherit; color: #333; background: #fff; outline: none; max-width: 160px; }
.mob-sort-inline select:focus { border-color: var(--primary); }

/* Sidebar close button (mobile only) */
.sidebar-cls {
    display: none;
    background: none;
    border: none;
    font-size: 16px;
    color: #888;
    cursor: pointer;
    padding: 2px 0 2px 8px;
    line-height: 1;
    float: right;
}

/* Sidebar overlay */
.sidebar-ov {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
}
.sidebar-ov.show { display: block; }

/* ── Responsive ── */
@media (max-width: 991px) {
    /* Show mobile filter bar */
    .mob-shop-bar { display: flex; }

    /* Hide sidebar by default; it slides in as fixed panel */
    .products-layout { grid-template-columns: 1fr; }
    .products-grid { grid-template-columns: repeat(2, 1fr); }
    .page-hero { padding: 36px 0; }
    .page-hero h1, .page-hero .page-hero-title { font-size: 28px; }

    /* Sidebar becomes slide-in panel */
    .sidebar-card {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        max-width: 85vw;
        height: 100%;
        z-index: 2000;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 0;
        max-height: none;
        overflow-y: auto;
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    }
    .sidebar-card.open { transform: translateX(0); }

    /* Show close button inside sidebar */
    .sidebar-cls { display: inline; }
    .sidebar-title { display: flex; align-items: center; justify-content: space-between; }

    /* Hide desktop results bar sort (we have mob-sort-inline instead) */
    .results-bar .sort-wrap { display: none; }
    .results-bar { margin-bottom: 14px; }
}
@media (max-width: 576px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); }
    .products-grid .card-badge {
        top: 8px;
        left: 8px;
        font-size: 8px;
        padding: 3px 6px;
        letter-spacing: 0.3px;
        max-width: calc(100% - 30px);
    }
    .results-bar { flex-direction: row; }
    .page-hero { padding: 28px 0 32px; }
    .page-hero h1, .page-hero .page-hero-title { font-size: 22px; }
    .page-hero p { font-size: 12.5px; margin-bottom: 14px; }

    /* Break search into stacked layout so button never overflows */
    .hero-search {
        max-width: 100%;
        border-radius: 8px;
        flex-wrap: wrap;
        padding: 6px 8px;
        gap: 6px;
    }
    .hero-search input {
        width: 100%;
        flex: none;
        padding: 8px 6px;
        font-size: 13px;
        min-width: 0;
    }
    .hero-search .search-ico { display: none; }
    .hero-search button {
        width: 100%;
        justify-content: center;
        border-radius: 6px;
        padding: 10px 16px;
    }
}
