/* ============================================
   Products Category Pages — CSS (Enhanced)
   ============================================ */

/* ---------- Breadcrumb ---------- */
.breadcrumb-section {
    padding: 120px 0 48px;
    background: linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
    position: relative;
}
.breadcrumb-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-lighter);
    margin-bottom: 20px;
}
.breadcrumb a {
    color: var(--text-light);
    transition: var(--transition);
}
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-sep { color: var(--text-lighter); }
.breadcrumb-current { color: var(--primary); font-weight: 600; }
.category-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}
.category-desc {
    font-size: 1.05rem;
    color: var(--text-light);
    max-width: 700px;
    line-height: 1.7;
}

/* ---------- Category Stats ---------- */
.category-stats {
    padding: 40px 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: relative;
}
.cat-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    text-align: center;
}
.cat-stat {
    padding: 24px 16px;
    border-radius: var(--radius);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}
.cat-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    opacity: 0;
    transition: opacity 0.3s ease;
}
.cat-stat:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(26,58,92,0.08);
}
.cat-stat:hover::before {
    opacity: 1;
}
.cat-stat-num {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
    line-height: 1.2;
}
.cat-stat-label {
    font-size: 0.8rem;
    color: var(--text-lighter);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 500;
}

/* ---------- Product Listing ---------- */
.product-listing {
    padding: 60px 0 80px;
    position: relative;
}

/* ---------- Filter Buttons (Pill Style) ---------- */
.product-filter-row {
    display: flex;
    gap: 10px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    justify-content: flex-start;
}
.product-filter-row .filter-btn {
    padding: 10px 24px;
    border: 2px solid var(--border);
    border-radius: 50px;
    background: var(--bg);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-light);
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}
.product-filter-row .filter-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--primary);
    border-radius: 50px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}
.product-filter-row .filter-btn span,
.product-filter-row .filter-btn {
    position: relative;
    z-index: 1;
}
.product-filter-row .filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(26,58,92,0.1);
}
.product-filter-row .filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(26,58,92,0.25);
    transform: translateY(-1px);
}
.product-filter-row .filter-btn.active::before {
    transform: scaleX(1);
}

/* ---------- Product Grid ---------- */
.product-listing .product-grid {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ---------- Enhanced Product Card for Category Pages ---------- */
.product-listing .product-card {
    display: grid;
    grid-template-columns: 320px 1fr;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--bg-card);
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    border: 1px solid var(--border);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s ease;
}
.product-listing .product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.1);
    border-color: rgba(26,58,92,0.15);
}

/* Product Image */
.product-listing .product-img {
    height: 100%;
    min-height: 280px;
    position: relative;
    overflow: hidden;
    background: var(--bg-alt);
}
.product-listing .product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.product-listing .product-card:hover .product-img img {
    transform: scale(1.06);
}

/* Product Badge */
.product-listing .product-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 5px 14px;
    background: var(--primary);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(26,58,92,0.3);
}

/* Product Info */
.product-listing .product-info {
    padding: 32px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.product-listing .product-info h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
    letter-spacing: -0.3px;
    transition: color 0.3s ease;
}
.product-listing .product-card:hover .product-info h3 {
    color: var(--primary);
}
.product-listing .product-info > p {
    color: var(--text-light);
    font-size: 0.92rem;
    line-height: 1.7;
    margin-bottom: 20px;
}

/* ---------- Product Specs Grid ---------- */
.product-specs {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin-bottom: 24px;
    flex-grow: 1;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.product-specs li {
    font-size: 0.85rem;
    color: var(--text-light);
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    background: var(--bg-alt);
    transition: background 0.2s ease;
    line-height: 1.5;
}
.product-specs li:nth-child(even) {
    border-right: none;
}
.product-specs li:nth-last-child(-n+2) {
    border-bottom: none;
}
.product-specs li:hover {
    background: rgba(26,58,92,0.04);
}
.product-specs li strong {
    color: var(--text);
    font-weight: 600;
    display: inline;
}

/* ---------- Small Button ---------- */
.btn-sm {
    padding: 11px 28px;
    font-size: 0.85rem;
    align-self: flex-start;
    border-radius: var(--radius-sm);
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26,58,92,0.2);
}

/* ---------- Scroll Animation for Product Cards ---------- */
.product-listing .product-card {
    opacity: 0;
    transform: translateY(30px);
    animation: productCardReveal 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.product-listing .product-card:nth-child(1) { animation-delay: 0.05s; }
.product-listing .product-card:nth-child(2) { animation-delay: 0.12s; }
.product-listing .product-card:nth-child(3) { animation-delay: 0.19s; }
.product-listing .product-card:nth-child(4) { animation-delay: 0.26s; }
.product-listing .product-card:nth-child(5) { animation-delay: 0.33s; }
.product-listing .product-card:nth-child(6) { animation-delay: 0.40s; }
.product-listing .product-card:nth-child(7) { animation-delay: 0.47s; }
.product-listing .product-card:nth-child(8) { animation-delay: 0.54s; }
.product-listing .product-card:nth-child(9) { animation-delay: 0.61s; }
.product-listing .product-card:nth-child(10) { animation-delay: 0.68s; }

@keyframes productCardReveal {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- CTA Banner ---------- */
.category-cta {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}
.category-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(255,255,255,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(255,255,255,0.04) 0%, transparent 50%);
    pointer-events: none;
}
.cta-inner {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}
.cta-inner h2 {
    font-size: 2rem;
    margin-bottom: 16px;
    color: #fff;
    letter-spacing: -0.3px;
}
.cta-inner p {
    font-size: 1.05rem;
    opacity: 0.9;
    margin-bottom: 32px;
    line-height: 1.7;
}
.cta-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}
.btn-outline-dark {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.4);
    text-decoration: none;
}
.btn-outline-dark:hover {
    background: #fff;
    color: var(--primary);
    border-color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255,255,255,0.2);
}

/* ---------- Other Categories ---------- */
.other-categories {
    padding: 80px 0;
    background: var(--bg-alt);
}
.other-categories .section-title {
    margin-bottom: 48px;
}
.other-cat-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}
.other-cat-card {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    height: 200px;
    display: block;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.other-cat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}
.other-cat-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.other-cat-card:hover img {
    transform: scale(1.1);
}
.other-cat-card span {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 16px 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    letter-spacing: 0.3px;
    transition: padding-bottom 0.3s ease;
}
.other-cat-card:hover span {
    padding-bottom: 20px;
}

/* ---------- Product Header (no preloader flash) ---------- */
.product-header {
    background: rgba(255,255,255,0.97) !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .cat-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .product-listing .product-card {
        grid-template-columns: 1fr;
    }
    .product-listing .product-img {
        min-height: 240px;
        height: 240px;
    }
    .product-listing .product-info {
        padding: 28px;
    }
    .other-cat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .breadcrumb-section { padding: 100px 0 32px; }
    .cat-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .cat-stat {
        padding: 16px 12px;
    }
    .cat-stat-num {
        font-size: 1.6rem;
    }
    .product-specs { grid-template-columns: 1fr; }
    .product-specs li { border-right: none; }
    .product-specs li:last-child { border-bottom: none; }
    .product-listing .product-info {
        padding: 24px;
    }
    .product-listing .product-info h3 {
        font-size: 1.1rem;
    }
    .other-cat-grid { grid-template-columns: repeat(2, 1fr); }
    .cta-inner h2 { font-size: 1.5rem; }
    .product-filter-row {
        justify-content: center;
    }
    .product-filter-row .filter-btn {
        padding: 8px 18px;
        font-size: 0.82rem;
    }
}
@media (max-width: 480px) {
    .other-cat-grid { grid-template-columns: 1fr; }
    .other-cat-card { height: 160px; }
    .product-listing .product-img {
        min-height: 200px;
        height: 200px;
    }
    .cat-stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
}
