/* ==================================================
   Category Subnavigation
================================================== */

.category-subnav {
    position: relative;
    z-index: 2;

    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 12px;

    width: 100%;
    margin: 0 0 22px;
    direction: rtl;
}

.category-subnav-link {
    position: relative;
    isolation: isolate;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;

    min-width: 0;
    min-height: 86px;
    padding: 14px 18px;
    overflow: hidden;

    color: var(--text-light);
    text-align: center;

    background:
            linear-gradient(
                    145deg,
                    rgba(255, 255, 255, 0.1),
                    rgba(255, 255, 255, 0.035)
            );

    border: 1px solid rgba(214, 173, 85, 0.34);
    border-radius: 8px;

    box-shadow:
            0 9px 24px rgba(0, 0, 0, 0.24),
            inset 0 1px 0 rgba(255, 255, 255, 0.07);

    transition:
            transform 0.22s ease,
            border-color 0.22s ease,
            background 0.22s ease,
            box-shadow 0.22s ease;
}

/* خط طلایی بالای هر لینک */
.category-subnav-link::before {
    content: "";
    position: absolute;
    top: 0;
    right: 12%;
    left: 12%;
    height: 2px;

    background: linear-gradient(
            90deg,
            transparent,
            var(--gold-dark),
            var(--gold-light),
            var(--gold-dark),
            transparent
    );

    opacity: 0.8;
    transition:
            right 0.22s ease,
            left 0.22s ease,
            opacity 0.22s ease;
}

/* فلش لینک */
.category-subnav-link::after {
    content: "‹";
    position: absolute;
    left: 16px;
    top: 50%;

    color: var(--gold-light);
    font-size: 25px;
    font-weight: 400;
    line-height: 1;

    transform: translateY(-50%);
    transition: transform 0.22s ease;
}

.category-subnav-title {
    display: block;
    max-width: 100%;

    color: var(--gold-light);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.7;
}

.category-subnav-description {
    display: block;
    max-width: 100%;

    color: #c8d1dc;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.7;
}

.category-subnav-link:hover,
.category-subnav-link:focus-visible {
    color: var(--text-light);
    border-color: rgba(242, 210, 122, 0.65);

    background:
            linear-gradient(
                    145deg,
                    rgba(214, 173, 85, 0.17),
                    rgba(255, 255, 255, 0.045)
            );

    box-shadow:
            0 13px 30px rgba(0, 0, 0, 0.33),
            0 0 0 1px rgba(242, 210, 122, 0.16);

    transform: translateY(-3px);
}

.category-subnav-link:hover::before,
.category-subnav-link:focus-visible::before {
    right: 4%;
    left: 4%;
    opacity: 1;
}

.category-subnav-link:hover::after,
.category-subnav-link:focus-visible::after {
    transform: translate(-4px, -50%);
}

.category-subnav-link:focus-visible {
    outline: 2px solid var(--gold-light);
    outline-offset: 3px;
}

/* صفحه فعال */
.category-subnav-link.active {
    color: var(--navy-deep);

    background: linear-gradient(
            135deg,
            var(--gold-light),
            var(--gold)
    );

    border-color: var(--gold-light);
}

.category-subnav-link.active .category-subnav-title,
.category-subnav-link.active .category-subnav-description,
.category-subnav-link.active::after {
    color: var(--navy-deep);
}

/* ==================================================
   Responsive
================================================== */

@media (max-width: 768px) {
    .category-subnav {
        gap: 8px;
        margin-bottom: 16px;
    }

    .category-subnav-link {
        min-height: 76px;
        padding: 11px 28px 11px 10px;
    }

    .category-subnav-title {
        font-size: 13px;
    }

    .category-subnav-description {
        display: none;
    }

    .category-subnav-link::after {
        left: 10px;
        font-size: 21px;
    }
}

@media (max-width: 420px) {
    .category-subnav {
        /*
         * لینک‌ها همچنان کنار هم می‌مانند.
         * برای دو لینک، هرکدام نصف عرض صفحه را می‌گیرد.
         * برای سه لینک، هرکدام یک‌سوم عرض را می‌گیرد.
         */
        gap: 6px;
    }

    .category-subnav-link {
        min-height: 70px;
        padding: 9px 7px;
    }

    .category-subnav-title {
        font-size: 12px;
        line-height: 1.8;
    }

    .category-subnav-link::after {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .category-subnav-link,
    .category-subnav-link::before,
    .category-subnav-link::after {
        transition: none;
    }

    .category-subnav-link:hover {
        transform: none;
    }
}
/* =========================================================
   Product List Page Cards
========================================================= */

.product-category-section {
    padding-top: 42px;
    padding-bottom: 72px;
    direction: rtl;
}

.product-category-section .product-list-heading {
    margin-bottom: 24px;
}

.product-category-section .product-list-heading h4 {
    margin: 4px 0 0;
    color: var(--text-light, #f5f7fa);
    font-weight: 800;
}

.product-category-section .product-list-heading span {
    color: var(--text-muted-light, #b8c2cf);
}

.product-category-section .product-list-count {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid rgba(214, 173, 85, 0.24);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.055);
    color: var(--text-muted-light, #b8c2cf);
    font-size: 13px;
}

.product-category-section .product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-category-section .product-image {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 210px;
    padding: 16px;
    overflow: hidden;
    text-decoration: none;
}

.product-category-section .product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.28s ease;
}

.product-category-section .product-card:hover .product-image img {
    transform: scale(1.045);
}

.product-category-section .product-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 14px;
}

.product-category-section .product-info h3 {
    min-height: 42px;
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.6;
}

.product-category-section .product-info h3 a {
    color: inherit;
    text-decoration: none;
}

.product-category-section .product-info h3 a:hover {
    color: var(--gold-light, #f2d27a);
}

.product-category-section .product-short-description {
    display: -webkit-box;
    min-height: 42px;
    margin: 0 0 12px;
    overflow: hidden;
    color: var(--text-muted-light, #b8c2cf);
    font-size: 13px;
    line-height: 1.7;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-category-section .product-price {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
}

.product-category-section .product-price-values {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.product-category-section .old-price {
    color: var(--text-muted-light, #b8c2cf);
    font-size: 12px;
    line-height: 1.4;
    opacity: 0.78;
}

.product-category-section .price {
    color: var(--gold-light, #f2d27a);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.5;
    white-space: nowrap;
}

.product-category-section .price small {
    margin-right: 2px;
    font-size: 11px;
    font-weight: 600;
}

.product-category-section .add-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 9px;
    background: linear-gradient(
            135deg,
            var(--gold-light, #f2d27a),
            var(--gold, #d6ad55)
    );
    color: var(--navy-deep, #071426);
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 5px 14px rgba(214, 173, 85, 0.24);
    transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.product-category-section .add-cart:hover {
    background: linear-gradient(135deg, #ffe59b, var(--gold-light, #f2d27a));
    color: var(--navy-deep, #071426);
    box-shadow: 0 9px 22px rgba(214, 173, 85, 0.30);
    transform: translateY(-2px);
}

.product-category-section .product-badge {
    position: absolute;
    top: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.20);
}

.product-category-section .product-featured-badge {
    right: 12px;
    border: 1px solid rgba(242, 210, 122, 0.50);
    background: rgba(214, 173, 85, 0.16);
    color: var(--gold-light, #f2d27a);
}

.product-category-section .product-discount-badge {
    left: 12px;
    border: 1px solid rgba(255, 155, 165, 0.45);
    background: rgba(189, 47, 58, 0.18);
    color: #ff9ba5;
}

/* Pagination هماهنگ با تم */
.product-category-section .pagination {
    gap: 6px;
}

.product-category-section .page-link {
    min-width: 38px;
    border-color: rgba(214, 173, 85, 0.26);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.055);
    color: var(--text-light, #f5f7fa);
    text-align: center;
}

.product-category-section .page-link:hover {
    border-color: var(--gold-light, #f2d27a);
    background: rgba(214, 173, 85, 0.12);
    color: var(--gold-light, #f2d27a);
}

.product-category-section .page-item.active .page-link {
    border-color: var(--gold, #d6ad55);
    background: linear-gradient(
            135deg,
            var(--gold-light, #f2d27a),
            var(--gold, #d6ad55)
    );
    color: var(--navy-deep, #071426);
}

.product-category-section .page-item.disabled .page-link {
    border-color: rgba(184, 194, 207, 0.15);
    background: rgba(255, 255, 255, 0.025);
    color: rgba(184, 194, 207, 0.45);
}

/* Mobile */
@media (max-width: 575.98px) {
    .product-category-section {
        padding-top: 28px;
        padding-bottom: 54px;
    }

    .product-category-section .product-list-heading {
        align-items: flex-start;
        gap: 10px;
    }

    .product-category-section .product-list-count {
        font-size: 12px;
    }

    .product-category-section .product-image {
        height: 165px;
        padding: 12px;
    }

    .product-category-section .product-info {
        padding: 12px;
    }

    .product-category-section .product-info h3 {
        min-height: 40px;
        font-size: 13px;
    }

    .product-category-section .product-short-description {
        display: none;
    }

    .product-category-section .price {
        font-size: 13px;
    }

    .product-category-section .add-cart {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
    }
}
