/**
 * استایل Category Carousel
 * 
 * @package Plus_Modiresabz
 * @since 1.0.0
 */

/* ===== Container ===== */
.categoryCarousel-wrap {
    position: relative;
    padding: 0;
    width: 100%;
}

.categoryCarousel-swiper {
    overflow: hidden;
    width: 100%;
}

/* ارتفاع یکسان برای تمام اسلایدها */
.categoryCarousel-swiper .swiper-wrapper {
    align-items: stretch;
}

.categoryCarousel-swiper .swiper-slide {
    height: auto;
}

/* ===== Card ===== */
.categoryCarousel-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0;
    background: #fff;
    transition: all 0.3s ease;
    height: 100%;
    cursor: pointer;
    border: 1px solid #ddd;
}


/* ===== Thumbnail ===== */
.categoryCarousel-thumb {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f8f9fa;
}

.categoryCarousel-thumb::before {
    content: "";
    display: block;
    padding-top: 58%;
}

.categoryCarousel-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.categoryCarousel-card:hover .categoryCarousel-thumb img {
    transform: scale(1.08);
}

/* ===== Info ===== */
.categoryCarousel-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    text-align: center;
	padding-bottom: 7px;
}

.categoryCarousel-name {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.categoryCarousel-count {
    font-size: 13px;
    color: #64748b;
}

/* ===== View All Card ===== */
.categoryCarousel-viewall {
    background: linear-gradient(3deg, #30336b 0%, #3c41a7 100%);
    color: #fff;
    justify-content: center;
    align-items: center;
}


.categoryCarousel-plus {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.25);
    display: grid;
    place-items: center;
    margin-bottom: 8px;
	border-radius: 0;
}

.categoryCarousel-plus svg {
    width: 28px;
    height: 28px;
    color: #fff;
}

.categoryCarousel-viewall .categoryCarousel-name,
.categoryCarousel-viewall .categoryCarousel-count {
    color: #fff;
}

/* ===== Navigation Buttons ===== */
.categoryCarousel-nav {
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 42px;
    height: 42px;
    margin-top: -21px;
    background: rgba(15, 23, 42, 0.9);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    border: none;
}

.categoryCarousel-nav:hover {
    background: #ffc31d;
    transform: translateY(-2px);
}

.categoryCarousel-nav svg {
    width: 20px;
    height: 20px;
}

.categoryCarousel-nav-prev {
    left: 15px;
}

.categoryCarousel-nav-next {
    right: 15px;
}

.categoryCarousel-nav.swiper-button-disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ===== Popup ===== */
.categoryCarousel-popup {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.categoryCarousel-popup.active {
    display: flex;
}

.categoryCarousel-popup-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(2px);
    animation: categoryCarousel-fadeIn 0.3s ease;
}

.categoryCarousel-popup-content {
    position: relative;
    background: #fff;
    padding: 32px;
    max-width: 800px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: categoryCarousel-slideUp 0.4s ease;
}

.categoryCarousel-popup-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: #f1f5f9;
    border: none;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1;
}

.categoryCarousel-popup-close:hover {
    background: #e2e8f0;
    transform: rotate(90deg);
}

.categoryCarousel-popup-close svg {
    width: 18px;
    height: 18px;
    color: #475569;
}

.categoryCarousel-popup-title {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 24px 0;
    text-align: center;
}

.categoryCarousel-popup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.categoryCarousel-popup-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #f8fafc;
    text-decoration: none;
    transition: all 0.25s ease;
    border: 2px solid transparent;
}

.categoryCarousel-popup-item:hover {
    background: #ffc31d;
    border-color: #ffc31d;
    transform: translateX(-3px);
}

.categoryCarousel-popup-item-name {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
}

.categoryCarousel-popup-item:hover .categoryCarousel-popup-item-name {
    color: #fff;
}

.categoryCarousel-popup-item-count {
    font-size: 13px;
    color: #64748b;
}

.categoryCarousel-popup-item:hover .categoryCarousel-popup-item-count {
    color: rgba(255, 255, 255, 0.9);
}

/* ===== Animations ===== */
@keyframes categoryCarousel-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes categoryCarousel-slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Responsive - Mobile ===== */
@media (max-width: 767px) {
    .categoryCarousel-wrap {
        padding: 0;
    }
    
    .categoryCarousel-nav {
        width: 36px;
        height: 36px;
        margin-top: -18px;
    }
    
    .categoryCarousel-nav svg {
        width: 18px;
        height: 18px;
    }
    
    .categoryCarousel-popup {
        padding: 0;
        align-items: flex-end;
    }
    
    .categoryCarousel-popup-content {
        max-width: 100%;
        max-height: 85vh;
        animation: categoryCarousel-slideUpMobile 0.35s ease;
    }
    
    .categoryCarousel-popup-grid {
        grid-template-columns: 1fr;
    }
    
    @keyframes categoryCarousel-slideUpMobile {
        from {
            transform: translateY(100%);
        }
        to {
            transform: translateY(0);
        }
    }
}

/* ===== Scrollbar Styling ===== */
.categoryCarousel-popup-content::-webkit-scrollbar {
    width: 8px;
}

.categoryCarousel-popup-content::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.categoryCarousel-popup-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}

.categoryCarousel-popup-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

