/* ============================================
   CATEGORY PAGE — Maison Noir (PREMIUM v3)
   Complete Redesign — Luxury Furniture Store
   ============================================ */

/* ============ 1. CATEGORY BANNER ============ */
.cat-banner {
    position: relative;
    height: 400px;
    min-height: 360px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    padding: 130px 0 55px;
    overflow: hidden;
}

.cat-banner-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(26,22,18,0.5) 0%, rgba(26,22,18,0.25) 40%, rgba(26,22,18,0.72) 100%);
    z-index: 1;
}

.cat-banner-inner { position: relative; z-index: 2; width: 100%; }

.cat-breadcrumb {
    display: flex; align-items: center; gap: 10px;
    font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
    color: rgba(255,255,255,0.75); margin-bottom: 24px; font-weight: 500;
}
.cat-breadcrumb a { color: rgba(255,255,255,0.75); transition: color 0.3s; text-decoration: none; }
.cat-breadcrumb a:hover { color: var(--accent); }
.cat-breadcrumb .bc-sep { color: rgba(255,255,255,0.35); font-size: 10px; }
.cat-breadcrumb .bc-current { color: var(--accent); }

.cat-banner-content { max-width: 660px; }

.cat-eyebrow {
    display: inline-block; font-size: 10px; letter-spacing: 0.3em;
    text-transform: uppercase; color: var(--accent);
    margin-bottom: 12px; padding-left: 42px; position: relative; font-weight: 600;
}
.cat-eyebrow::before {
    content: ''; position: absolute; left: 0; top: 50%;
    width: 32px; height: 1px; background: var(--accent);
}

.cat-title {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 4.5vw, 4rem);
    color: var(--white); font-weight: 400; line-height: 1.05;
    margin-bottom: 14px; letter-spacing: -0.01em;
}

.cat-desc {
    font-family: var(--font-display); font-style: italic;
    font-size: 16px; color: rgba(255,255,255,0.8);
    max-width: 520px; line-height: 1.6;
}


/* ============ 2. SUB-CATEGORIES CAROUSEL ============ */
.subcat-carousel-section { padding: 55px 0 25px; background: var(--bg); }

.subcat-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 26px;
}
.subcat-header h3 {
    font-family: var(--font-display); font-size: 24px; font-weight: 500; color: var(--ink);
}

.subcat-nav { display: flex; gap: 8px; }
.subcat-nav button {
    width: 42px; height: 42px; border: 1px solid var(--line); background: var(--white);
    color: var(--ink); border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-size: 12px; cursor: pointer;
    transition: all 0.3s;
}
.subcat-nav button:hover { background: var(--ink); color: var(--accent); border-color: var(--ink); }

.subcat-carousel .subcat-card { display: block; text-decoration: none; }

.subcat-card-img {
    position: relative; aspect-ratio: 16/10; overflow: hidden;
    background: var(--bg-alt); transition: all 0.4s;
    border: 1px solid var(--line);
}
.subcat-card:hover .subcat-card-img { border-color: var(--accent); }
.subcat-card.active .subcat-card-img {
    border-color: var(--accent); box-shadow: 0 10px 28px rgba(184, 147, 90, 0.2);
}

.subcat-card-img img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.7s;
}
.subcat-card:hover .subcat-card-img img { transform: scale(1.06); }

.subcat-card-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(26,22,18,0.8) 100%);
    transition: background 0.3s;
}
.subcat-card:hover .subcat-card-overlay {
    background: linear-gradient(180deg, rgba(26,22,18,0.08) 0%, rgba(26,22,18,0.85) 100%);
}

.subcat-card-name {
    position: absolute; bottom: 16px; left: 18px; right: 18px;
    color: var(--white); font-family: var(--font-display);
    font-size: 17px; font-weight: 500; margin: 0;
}
.subcat-card.active .subcat-card-name { color: var(--accent); }


/* ============================================
   3. PRODUCTS SECTION — CLEAN LUXURY
   ============================================ */
.products-section {
    position: relative;
    padding: 50px 0 100px;
    overflow: hidden;
    background: var(--bg);
}

/* Clean subtle dot pattern */
.products-bg-pattern {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.025;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40'><circle cx='20' cy='20' r='0.8' fill='%231a1612'/></svg>");
    background-size: 40px 40px;
}

/* Soft ambient glow */
.products-section::before {
    content: '';
    position: absolute;
    top: -150px; right: -150px;
    width: 450px; height: 450px;
    background: radial-gradient(circle, rgba(184,147,90,0.05) 0%, transparent 70%);
    pointer-events: none; z-index: 0;
}
.products-section::after {
    content: '';
    position: absolute;
    bottom: -100px; left: -100px;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(184,147,90,0.03) 0%, transparent 70%);
    pointer-events: none; z-index: 0;
}

.products-section .container { position: relative; z-index: 1; }


/* ============ TOOLBAR ============ */
.products-toolbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 22px;
    background: var(--white);
    border: 1px solid var(--line);
    margin-bottom: 36px;
    flex-wrap: wrap; gap: 14px;
}

.toolbar-left { display: flex; align-items: center; gap: 24px; }

.product-count {
    font-size: 11px; letter-spacing: 0.15em;
    text-transform: uppercase; color: var(--muted); font-weight: 600;
}

.layout-switcher {
    display: flex; gap: 3px; padding-left: 24px;
    border-left: 1px solid var(--line);
}

.layout-btn {
    width: 32px; height: 32px; border: 1px solid var(--line);
    background: transparent; display: flex; align-items: center;
    justify-content: center; gap: 2px; cursor: pointer;
    padding: 7px; transition: all 0.3s;
}
.layout-btn span {
    width: 100%; height: 100%; background: var(--muted);
    transition: all 0.3s; display: block;
}
.layout-btn:hover { border-color: var(--ink); }
.layout-btn:hover span { background: var(--ink); }
.layout-btn.active { border-color: var(--accent); background: var(--accent); }
.layout-btn.active span { background: var(--white); }

.sort-wrapper {
    position: relative; display: flex; align-items: center; gap: 10px;
}
.sort-wrapper label {
    font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--muted); font-weight: 600;
}
.sort-select {
    appearance: none; background: var(--white);
    border: 1px solid var(--line); padding: 10px 38px 10px 14px;
    font-family: var(--font-body); font-size: 12px; color: var(--ink);
    font-weight: 500; cursor: pointer; transition: border-color 0.3s;
    min-width: 170px;
}
.sort-select:focus, .sort-select:hover { outline: none; border-color: var(--accent); }
.sort-wrapper > i {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    font-size: 10px; color: var(--muted); pointer-events: none;
}


/* ============ PRODUCTS GRID ============ */
.products-grid {
    display: grid;
    gap: 24px 20px;
    transition: all 0.4s;
}
.products-grid.cols-2 { grid-template-columns: repeat(2, 1fr); gap: 30px 24px; }
.products-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.products-grid.cols-4 { grid-template-columns: repeat(4, 1fr); gap: 20px 16px; }


/* ============ PRODUCT CARD — COMPACT LUXURY ============ */
.product-card-v2 {
    position: relative;
    background: var(--white);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    overflow: hidden;
}

.product-card-v2:hover {
    border-color: rgba(184,147,90,0.3);
    box-shadow:
        0 12px 32px rgba(26,22,18,0.08),
        0 2px 6px rgba(26,22,18,0.04);
    transform: translateY(-3px);
}

/* ---- IMAGE — COMPACT 4:3 RATIO ---- */
.pc-image-wrap {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: linear-gradient(145deg, #f7f3ed 0%, #ede6d9 100%);
}

.pc-image-link {
    display: block; width: 100%; height: 100%;
}
.pc-image-link img {
    width: 100%; height: 100%;  aspect-ratio: 1 / 1;  object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.product-card-v2:hover .pc-image-link img { transform: scale(1.05); }

/* Subtle bottom vignette */
.pc-image-wrap::after {
    content: '';
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 35%;
    background: linear-gradient(180deg, transparent 0%, rgba(26,22,18,0.04) 100%);
    pointer-events: none; z-index: 1;
}

/* ---- BADGE ---- */
.pc-badge {
    position: absolute; top: 12px; left: 12px;
    padding: 5px 11px; font-size: 9px;
    letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700;
    color: var(--white); background: var(--ink); z-index: 3;
}
.pc-badge.badge-new { background: var(--accent); }
.pc-badge.badge-sale { background: #c0392b; }
.pc-badge.badge-best { background: var(--ink); }

/* ---- ACTION ICONS ---- */
.pc-actions {
    position: absolute; top: 12px; right: 12px;
    display: flex; flex-direction: column; gap: 6px; z-index: 3;
    opacity: 0; transform: translateX(10px);
    transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.product-card-v2:hover .pc-actions {
    opacity: 1; transform: translateX(0);
}

.pc-action {
    width: 34px; height: 34px; background: var(--white); color: var(--ink);
    border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-size: 11px; cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 2px 8px rgba(26,22,18,0.1);
    border: none; text-decoration: none;
}
.pc-action:hover { background: var(--accent); color: var(--white); }

/* ---- ADD TO CART ---- */
.pc-add-btn {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 12px 14px;
    background: var(--ink);
    color: var(--white);
    font-family: var(--font-body);
    font-size: 10px; letter-spacing: 0.18em;
    text-transform: uppercase; font-weight: 700;
    cursor: pointer; border: none; text-decoration: none;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transform: translateY(100%);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 4;
}
.pc-add-btn i { font-size: 10px; }
.product-card-v2:hover .pc-add-btn { transform: translateY(0); }
.pc-add-btn:hover { background: var(--accent); }


/* ---- PRODUCT INFO ---- */
.pc-info {
    text-align: center;
    padding: 14px 12px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.pc-category {
    display: block;
    font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--muted); font-weight: 600;
}

.pc-name {
    font-family: var(--font-display);
    font-size: 15px; font-weight: 500;
    margin: 2px 0 4px; line-height: 1.3;
}
.pc-name a {
    color: var(--ink); transition: color 0.3s;
    text-decoration: none;
}
.pc-name a:hover { color: var(--accent); }

.pc-price-row {
    display: flex; justify-content: center; align-items: baseline; gap: 8px;
}
.pc-price {
    font-family: var(--font-display); font-style: italic;
    font-size: 14px; font-weight: 500; color: var(--accent);
}
.pc-old-price {
    font-family: var(--font-body); font-size: 11px;
    color: var(--muted); text-decoration: line-through;
}


/* ============ PAGINATION ============ */
.pagination {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 55px; padding-top: 28px;
    border-top: 1px solid rgba(184,147,90,0.15);
    gap: 14px; flex-wrap: wrap;
}

.pag-btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 11px 20px; background: transparent;
    border: 1px solid var(--line); color: var(--ink);
    font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
    font-weight: 700; cursor: pointer; transition: all 0.3s;
}
.pag-btn:hover:not(:disabled) {
    background: var(--ink); color: var(--accent); border-color: var(--ink);
}
.pag-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.pag-numbers { display: flex; gap: 4px; align-items: center; }

.pag-num {
    width: 36px; height: 36px; background: transparent;
    border: 1px solid var(--line); color: var(--ink);
    font-family: var(--font-display); font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all 0.3s;
    display: flex; align-items: center; justify-content: center;
}
.pag-num:hover { border-color: var(--accent); color: var(--accent); }
.pag-num.active { background: var(--accent); border-color: var(--accent); color: var(--white); }
.pag-dots { color: var(--muted); padding: 0 4px; font-size: 13px; }


/* ============ RESPONSIVE ============ */
@media (max-width: 1100px) {
    .cat-banner { height: 340px; padding: 110px 0 45px; }
    .products-grid.cols-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
    .products-grid.cols-3,
    .products-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
    .products-toolbar { flex-direction: column; align-items: flex-start; }
    .toolbar-right { width: 100%; }
    .sort-select { width: 100%; }
}

@media (max-width: 768px) {
    .cat-banner { height: 300px; min-height: 280px; padding: 100px 0 35px; }
    .cat-title { font-size: 2rem; }
    .cat-desc { font-size: 13px; }
    .subcat-carousel-section { padding: 40px 0 18px; }
    .subcat-header h3 { font-size: 19px; }

    .products-grid { gap: 16px 10px; }
    .products-grid.cols-2,
    .products-grid.cols-3,
    .products-grid.cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .pc-image-wrap { aspect-ratio: 4/3; }
    .pc-name { font-size: 13px; }
    .pc-price { font-size: 12px; }
    .pc-old-price { font-size: 10px; }
    .pc-info { padding: 10px 8px 12px; }
    .pc-category { font-size: 8px; }
    .pc-badge { padding: 4px 8px; font-size: 8px; top: 8px; left: 8px; }

    .toolbar-left { gap: 12px; flex-wrap: wrap; }
    .layout-switcher { padding-left: 12px; }
    .pagination { flex-direction: column; gap: 12px; margin-top: 36px; }

    /* Mobile — always visible */
    .pc-add-btn { transform: translateY(0); padding: 10px; font-size: 9px; }
    .pc-actions { opacity: 1; transform: translateX(0); }
    .pc-action { width: 28px; height: 28px; font-size: 10px; }
}

@media (max-width: 480px) {
    .products-grid.cols-2,
    .products-grid.cols-3,
    .products-grid.cols-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px 8px;
    }
    .layout-btn[data-cols="4"] { display: none; }
    .pc-image-wrap { aspect-ratio: 1/1; }
    .pc-info { padding: 8px 6px 10px; gap: 1px; }
    .pc-name { font-size: 12px; }
    .pc-price { font-size: 11px; }
}