/* =============================================
   Fajr Advanced — Product Category Styles
   fajradv.net | Arabic RTL
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;900&display=swap');

/* --- Shared Variables (mirrors homepage) --- */
:root {
    --fajr-primary:       #0f4c81;
    --fajr-primary-light: #1a6bb5;
    --fajr-accent:        #f59e0b;
    --fajr-accent-dark:   #d97706;
    --fajr-dark:          #0d1b2a;
    --fajr-dark2:         #1a2d42;
    --fajr-light-bg:      #f0f6ff;
    --fajr-white:         #ffffff;
    --fajr-text:          #374151;
    --fajr-text-light:    #6b7280;
    --fajr-border:        #e5e7eb;
    --fajr-shadow:        0 4px 24px rgba(15, 76, 129, 0.10);
    --fajr-shadow-lg:     0 8px 40px rgba(15, 76, 129, 0.18);
    --fajr-radius:        14px;
    --fajr-radius-sm:     8px;
    --fajr-transition:    0.3s ease;
}

/* =============================================
   CATEGORY HERO BANNER
   ============================================= */

.fajr-cat-banner {
    position: relative;
    background: linear-gradient(150deg, #071624 0%, #0a2540 35%, #0f4c81 80%, #1565c0 100%);
    padding: 72px 0 90px;
    overflow: hidden;
    direction: rtl;
    font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
}

.fajr-cat-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
}

/* Bottom wave */
.fajr-cat-banner::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0; right: 0;
    height: 60px;
    background: #f8f9fb;
    clip-path: ellipse(60% 100% at 50% 100%);
    z-index: 3;
}

/* Accent glow blob */
.fajr-cat-banner-glow {
    position: absolute;
    top: -100px;
    left: -100px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(21,101,192,0.4) 0%, transparent 65%);
    pointer-events: none;
    z-index: 1;
}

.fajr-cat-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 4;
}

/* Breadcrumbs */
.fajr-cat-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.fajr-cat-breadcrumb a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    transition: color var(--fajr-transition);
}

.fajr-cat-breadcrumb a:hover {
    color: #fbbf24;
}

.fajr-cat-breadcrumb .sep {
    color: rgba(255,255,255,0.3);
    font-size: 11px;
    transform: scaleX(-1);
    display: inline-block;
}

.fajr-cat-breadcrumb .current {
    color: #fbbf24;
    font-weight: 600;
}

/* Icon + Title row */
.fajr-cat-title-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}

.fajr-cat-icon {
    width: 64px;
    height: 64px;
    background: rgba(245,158,11,0.18);
    border: 2px solid rgba(245,158,11,0.35);
    border-radius: var(--fajr-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fajr-cat-icon svg {
    width: 32px;
    height: 32px;
    fill: #fbbf24;
}

.fajr-cat-title {
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    font-weight: 900;
    color: #fff;
    line-height: 1.15;
    font-family: 'Cairo', sans-serif;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5), 0 8px 32px rgba(0,0,0,0.3);
    letter-spacing: -0.3px;
    margin: 0;
}

.fajr-cat-desc {
    font-size: 1rem;
    color: rgba(255,255,255,0.78);
    max-width: 640px;
    line-height: 1.85;
    font-family: 'Cairo', sans-serif;
    margin-bottom: 28px;
}

/* Meta row: count + CTA */
.fajr-cat-meta-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.fajr-cat-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.9);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
}

.fajr-cat-count-badge svg {
    width: 14px;
    height: 14px;
    fill: rgba(255,255,255,0.7);
}

.fajr-cat-wa-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #25d366;
    color: #fff !important;
    padding: 8px 22px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    font-family: 'Cairo', sans-serif;
    transition: all var(--fajr-transition);
    box-shadow: 0 4px 16px rgba(37,211,102,0.35);
}

.fajr-cat-wa-btn:hover {
    background: #1db954;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37,211,102,0.5);
    color: #fff !important;
    text-decoration: none;
}

.fajr-cat-wa-btn svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

/* =============================================
   SUBCATEGORY NAV PILLS
   ============================================= */

.fajr-subcat-nav {
    background: var(--fajr-white);
    padding: 24px 0 0;
    border-bottom: 1px solid var(--fajr-border);
    direction: rtl;
    font-family: 'Cairo', sans-serif;
}

.fajr-subcat-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.fajr-subcat-nav-inner::-webkit-scrollbar {
    display: none;
}

.fajr-subcat-pills {
    display: flex;
    gap: 10px;
    padding-bottom: 20px;
    white-space: nowrap;
    flex-wrap: nowrap;
}

.fajr-subcat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border-radius: 50px;
    border: 1.5px solid var(--fajr-border);
    color: var(--fajr-text);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--fajr-transition);
    background: var(--fajr-white);
    font-family: 'Cairo', sans-serif;
}

.fajr-subcat-pill:hover,
.fajr-subcat-pill.active {
    background: var(--fajr-primary);
    border-color: var(--fajr-primary);
    color: var(--fajr-white);
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(15,76,129,0.25);
}

.fajr-subcat-pill .count {
    background: rgba(0,0,0,0.08);
    border-radius: 50px;
    padding: 1px 8px;
    font-size: 11px;
}

.fajr-subcat-pill:hover .count,
.fajr-subcat-pill.active .count {
    background: rgba(255,255,255,0.2);
}

/* =============================================
   SHOP WRAPPER OVERRIDES
   (styles that wrap around Woodmart's product grid)
   ============================================= */

body.tax-product_cat .site-content,
body.post-type-archive-product .site-content {
    background: #f8f9fb;
}

/* Shop content area */
body.tax-product_cat #content,
body.post-type-archive-product #content {
    padding: 0 !important;
}

/* Woodmart shop content wrapper */
body.tax-product_cat .content-wrapper,
body.post-type-archive-product .content-wrapper {
    background: #f8f9fb;
}

/* Remove default page title that Woodmart sometimes adds */
body.tax-product_cat .page-title-default {
    display: none;
}

/* =============================================
   SHOP LOOP HEAD (sort bar)
   ============================================= */

.fajr-shop-container .shop-loop-head {
    background: var(--fajr-white);
    border-radius: var(--fajr-radius);
    padding: 14px 20px;
    margin-bottom: 24px;
    box-shadow: var(--fajr-shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    direction: rtl;
    font-family: 'Cairo', sans-serif;
}

/* =============================================
   PRODUCT GRID WRAPPER
   ============================================= */

.fajr-shop-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 36px 24px 60px;
    direction: rtl;
    font-family: 'Cairo', sans-serif;
}

/* =============================================
   PRODUCT CARD ENHANCEMENTS
   (layer on top of Woodmart's existing styles)
   ============================================= */

body.tax-product_cat ul.products li.product,
body.post-type-archive-product ul.products li.product {
    background: var(--fajr-white);
    border-radius: var(--fajr-radius) !important;
    overflow: hidden;
    box-shadow: var(--fajr-shadow);
    transition: transform var(--fajr-transition), box-shadow var(--fajr-transition);
    border: 1px solid var(--fajr-border);
}

body.tax-product_cat ul.products li.product:hover,
body.post-type-archive-product ul.products li.product:hover {
    transform: translateY(-5px);
    box-shadow: var(--fajr-shadow-lg);
    border-color: transparent;
}

/* Product image wrapper */
body.tax-product_cat .product-image-wrapper,
body.post-type-archive-product .product-image-wrapper {
    overflow: hidden;
}

body.tax-product_cat .product-image-wrapper img,
body.post-type-archive-product .product-image-wrapper img {
    transition: transform 0.4s ease;
}

body.tax-product_cat ul.products li.product:hover .product-image-wrapper img,
body.post-type-archive-product ul.products li.product:hover .product-image-wrapper img {
    transform: scale(1.05);
}

/* Product title */
body.tax-product_cat .woocommerce-loop-product__title,
body.post-type-archive-product .woocommerce-loop-product__title {
    font-family: 'Cairo', sans-serif !important;
    font-weight: 700 !important;
    font-size: 1rem !important;
    color: var(--fajr-dark) !important;
    line-height: 1.4 !important;
}

/* Price */
body.tax-product_cat .price,
body.post-type-archive-product .price {
    color: var(--fajr-primary) !important;
    font-family: 'Cairo', sans-serif !important;
    font-weight: 700 !important;
}

/* Add to cart button */
body.tax-product_cat .button.add_to_cart_button,
body.tax-product_cat .button.single_add_to_cart_button,
body.post-type-archive-product .button.add_to_cart_button {
    background: var(--fajr-primary) !important;
    color: var(--fajr-white) !important;
    border-radius: 50px !important;
    font-family: 'Cairo', sans-serif !important;
    font-weight: 700 !important;
    border: none !important;
    transition: all var(--fajr-transition) !important;
    padding: 10px 20px !important;
}

body.tax-product_cat .button.add_to_cart_button:hover,
body.post-type-archive-product .button.add_to_cart_button:hover {
    background: var(--fajr-primary-light) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(15,76,129,0.3) !important;
}

/* "اطلب الآن" / view product button */
body.tax-product_cat .wd-btn-add-to-cart,
body.post-type-archive-product .wd-btn-add-to-cart {
    border-radius: 50px !important;
}

/* Sale badge */
body.tax-product_cat .onsale,
body.post-type-archive-product .onsale {
    background: var(--fajr-accent) !important;
    color: var(--fajr-dark) !important;
    font-family: 'Cairo', sans-serif !important;
    font-weight: 700 !important;
    border-radius: 50px !important;
}

/* =============================================
   EMPTY CATEGORY STATE
   ============================================= */

.fajr-empty-cat {
    text-align: center;
    padding: 80px 24px;
    direction: rtl;
    font-family: 'Cairo', sans-serif;
}

.fajr-empty-cat-icon {
    width: 80px;
    height: 80px;
    background: var(--fajr-light-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.fajr-empty-cat-icon svg {
    width: 40px;
    height: 40px;
    fill: var(--fajr-primary);
    opacity: 0.5;
}

.fajr-empty-cat h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--fajr-dark);
    margin-bottom: 10px;
}

.fajr-empty-cat p {
    color: var(--fajr-text-light);
    margin-bottom: 28px;
}

.fajr-btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 50px;
    font-family: 'Cairo', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    background: var(--fajr-primary);
    color: var(--fajr-white);
    transition: all var(--fajr-transition);
}

.fajr-btn-sm:hover {
    background: var(--fajr-primary-light);
    transform: translateY(-2px);
    color: var(--fajr-white);
    text-decoration: none;
}

/* =============================================
   PAGINATION
   ============================================= */

body.tax-product_cat .woocommerce-pagination ul,
body.post-type-archive-product .woocommerce-pagination ul {
    display: flex;
    gap: 8px;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 40px 0;
}

body.tax-product_cat .woocommerce-pagination ul li a,
body.tax-product_cat .woocommerce-pagination ul li span,
body.post-type-archive-product .woocommerce-pagination ul li a,
body.post-type-archive-product .woocommerce-pagination ul li span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid var(--fajr-border);
    color: var(--fajr-text);
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all var(--fajr-transition);
    background: var(--fajr-white);
}

body.tax-product_cat .woocommerce-pagination ul li a:hover,
body.post-type-archive-product .woocommerce-pagination ul li a:hover {
    background: var(--fajr-primary);
    border-color: var(--fajr-primary);
    color: var(--fajr-white);
}

body.tax-product_cat .woocommerce-pagination ul li span.current,
body.post-type-archive-product .woocommerce-pagination ul li span.current {
    background: var(--fajr-primary);
    border-color: var(--fajr-primary);
    color: var(--fajr-white);
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 768px) {
    .fajr-cat-banner {
        padding: 56px 0 76px;
    }
    .fajr-cat-title {
        font-size: 1.9rem;
    }
    .fajr-cat-title-row {
        gap: 14px;
    }
    .fajr-cat-icon {
        width: 50px;
        height: 50px;
    }
    .fajr-cat-icon svg {
        width: 24px;
        height: 24px;
    }
    .fajr-shop-container {
        padding: 24px 16px 48px;
    }
    .fajr-cat-banner-inner {
        padding: 0 16px;
    }
    .fajr-subcat-nav-inner {
        padding: 0 16px;
    }
}

@media (max-width: 480px) {
    .fajr-cat-title {
        font-size: 1.6rem;
    }
    .fajr-cat-meta-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .fajr-cat-wa-btn {
        width: 100%;
        justify-content: center;
    }
}
