/* ═══════════════════════════════════════════════════════════
   SAN-PHAM.CSS — Trang danh sách sản phẩm
   Bao Bì Tân Long
═══════════════════════════════════════════════════════════ */

/* ── Breadcrumb bar ── */
.breadcrumb-bar {
    background: var(--blue-deep);
    padding: 0.65rem 0;
}
.breadcrumb-bar .breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    flex-wrap: wrap;
}
.breadcrumb-bar .breadcrumb a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    transition: color 0.2s;
}
.breadcrumb-bar .breadcrumb a:hover { color: var(--yellow); }
.breadcrumb-bar .bc-sep { color: rgba(255,255,255,0.3); }
.breadcrumb-bar .bc-cur { color: rgba(255,255,255,0.9); font-weight: 600; }

/* ── Section bọc ngoài ── */
.section-products-page {
    padding: 2.5rem 0 4rem;
    background: var(--off-white);
    min-height: 60vh;
}

/* ── Layout 2 cột: sidebar + main ── */
.products-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
    align-items: start;
}

/* ════════════════════════════
   SIDEBAR
════════════════════════════ */
.products-sidebar {
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.sidebar-box {
    background: #fff;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--gray-200);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.sidebar-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--blue-dark);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 0.9rem 1.1rem 0.75rem;
    border-bottom: 2px solid var(--blue);
    background: var(--blue-light);
}

.sidebar-cats {
    list-style: none;
    padding: 0.5rem 0;
}

.sidebar-cats li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 1.1rem;
    font-size: 0.83rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: all 0.18s;
    border-left: 3px solid transparent;
}
.sidebar-cats li a:hover {
    background: var(--blue-light);
    color: var(--blue);
    border-left-color: var(--blue);
}
.sidebar-cats li a.active {
    background: var(--blue-light);
    color: var(--blue);
    font-weight: 700;
    border-left-color: var(--blue);
}

.cat-count {
    background: var(--blue-light);
    color: var(--blue);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.1rem 0.5rem;
    border-radius: 20px;
    min-width: 22px;
    text-align: center;
    flex-shrink: 0;
    transition: all 0.18s;
}
.sidebar-cats li a:hover .cat-count,
.sidebar-cats li a.active .cat-count {
    background: var(--blue);
    color: #fff;
}

/* CTA box trong sidebar */
.sidebar-cta {
    background: linear-gradient(135deg, var(--blue-deep), var(--blue-dark));
    border-radius: var(--radius-md);
    padding: 1.5rem 1.2rem;
    text-align: center;
    color: #fff;
}
.sidebar-cta-icon {
    font-size: 2rem;
    color: var(--yellow);
    margin-bottom: 0.6rem;
    display: block;
}
.sidebar-cta h4 {
    font-size: 0.95rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
}
.sidebar-cta p {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 1rem;
    line-height: 1.5;
}
.btn-sidebar-quote {
    display: inline-block;
    background: var(--yellow);
    color: var(--gray-900);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.55rem 1.3rem;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    transition: filter 0.2s;
    font-family: var(--font);
}
.btn-sidebar-quote:hover { filter: brightness(1.1); }

/* ════════════════════════════
   MAIN CONTENT
════════════════════════════ */
.products-main { min-width: 0; }

/* Tiêu đề + search */
.products-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.products-page-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--blue-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.products-search {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.products-search:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(var(--rgb-primary),0.1);
}
.products-search input {
    border: none;
    outline: none;
    padding: 0.5rem 1rem;
    font-size: 0.82rem;
    font-family: var(--font);
    color: var(--gray-900);
    background: transparent;
    width: 220px;
}
.products-search input::placeholder { color: var(--gray-400); }
.products-search button {
    background: var(--blue);
    border: none;
    padding: 0.52rem 0.9rem;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.82rem;
}
.products-search button:hover { background: var(--blue-dark); }

.search-note {
    font-size: 0.82rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
    padding: 0.6rem 1rem;
    background: var(--blue-light);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--blue);
}

/* ════════════════════════════
   GRID SẢN PHẨM
════════════════════════════ */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

/* ── Product Card ── */
.product-card {
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid #c8955a;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: all 0.22s;
    box-shadow: var(--shadow-sm);
}
.product-card:hover {
    border-color: #9a6030;
    box-shadow: 0 8px 24px rgba(155,100,60,.2);
    transform: translateY(-4px);
}

/* Ảnh sản phẩm */
.product-img {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #fef3e2;
    flex-shrink: 0;
}
.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
    display: block;
}
.product-card:hover .product-img img { transform: scale(1.06); }

/* Placeholder khi không có ảnh */
.product-img-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fef3e2;
}
.product-img-placeholder i {
    font-size: 3rem;
    color: var(--blue);
    opacity: 0.35;
}

/* Overlay khi hover */
.product-overlay {
    position: absolute;
    inset: 0;
    background: rgba(var(--rgb-deep),0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s;
}
.product-card:hover .product-overlay { opacity: 1; }
.product-overlay span {
    background: #fff;
    color: var(--blue-dark);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.45rem 1.2rem;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

/* Nội dung card */
.product-info {
    padding: 0.9rem 1rem 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
}

.product-cat {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.product-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-desc {
    font-size: 0.75rem;
    color: var(--gray-400);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.6rem;
    gap: 0.5rem;
}

.product-detail {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--blue);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: gap 0.2s;
}
.product-card:hover .product-detail { gap: 0.5rem; }
.product-detail::after { content: '→'; }

.product-quote {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--gray-200);
    background: #fff;
    color: var(--gray-400);
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s;
    flex-shrink: 0;
}
.product-quote:hover {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
}

/* ── Pagination ── */
.pagination-wrap {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: center;
}

/* ════════════════════════════
   RESPONSIVE
════════════════════════════ */
@media (max-width: 1100px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); }
    .products-layout { grid-template-columns: 220px 1fr; }
}

@media (max-width: 768px) {
    .products-layout {
        grid-template-columns: 1fr;
    }
    .products-sidebar {
        position: static;
    }
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .section-products-page { padding: 1.5rem 0 3rem; }
    .products-top { flex-direction: column; align-items: flex-start; }
    .products-search input { width: 160px; }
}

@media (max-width: 480px) {
    .products-grid { grid-template-columns: 1fr; }
}
/* ── Custom Pagination ── */
.pag-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}
.pag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--gray-200);
    background: #fff;
    color: var(--gray-700);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.18s;
    cursor: pointer;
}
.pag-btn:hover {
    border-color: var(--blue);
    color: var(--blue);
    background: var(--blue-light);
}
.pag-btn.pag-active {
    background: var(--blue);
    border-color: var(--blue);
    color: #fff;
    cursor: default;
}
.pag-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}
.pag-btn.pag-dots {
    border: none;
    background: transparent;
    cursor: default;
    color: var(--gray-400);
}