/* ============================================
   CASE CATEGORIES - ACCORDION + CAROUSEL
   Premium Mobile-First UI/UX
   ============================================ */

/* ========== CATEGORY ACCORDION ========== */
.category-accordion {
    margin-bottom: 16px;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-accordion:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Accordion Header */
.category-header {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    position: relative;
    gap: 16px;
}

.category-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.category-header:active {
    transform: scale(0.995);
}

/* Category Icon */
.category-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.category-accordion:hover .category-icon {
    transform: scale(1.1);
}

/* Category Info */
.category-info {
    flex: 1;
    min-width: 0;
}

.category-name {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-count {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.category-desc {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Toggle Arrow */
.category-toggle {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.category-toggle i {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-accordion.is-open .category-toggle {
    background: rgba(255, 255, 255, 0.1);
}

.category-accordion.is-open .category-toggle i {
    transform: rotate(180deg);
}

/* Accordion Content */
.category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease,
        padding 0.3s ease;
    opacity: 0;
    padding: 0 24px;
}

.category-accordion.is-open .category-content {
    max-height: 500px;
    opacity: 1;
    padding: 0 24px 24px;
}

/* ========== SWIPER CAROUSEL ========== */
.category-swiper {
    overflow: hidden;
    position: relative;
    padding: 8px 0 16px;
}

.category-swiper .swiper-wrapper {
    align-items: stretch;
}

.category-swiper .swiper-slide {
    height: auto;
    width: 200px;
}

/* Swiper Navigation */
.swiper-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.swiper-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.swiper-nav-btn.prev {
    left: -8px;
}

.swiper-nav-btn.next {
    right: -8px;
}

.swiper-nav-btn.swiper-button-disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* Swiper Pagination */
.category-swiper .swiper-pagination {
    position: relative;
    margin-top: 16px;
}

.category-swiper .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    opacity: 1;
    transition: all 0.3s ease;
}

.category-swiper .swiper-pagination-bullet-active {
    width: 24px;
    border-radius: 4px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
}

/* ========== CASE CARD (Enhanced) ========== */
.case-card-mini {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.case-card-mini:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.case-card-mini:active {
    transform: translateY(-2px) scale(0.98);
}

.case-card-mini-image {
    position: relative;
    padding-top: 100%;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.8));
    overflow: hidden;
}

.case-card-mini-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.case-card-mini:hover .case-card-mini-image img {
    transform: scale(1.1);
}

.case-card-mini-info {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.case-card-mini-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 8px 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 34px;
}

.case-card-mini-price {
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-top: auto;
}

.case-card-mini-items {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

/* ========== EMPTY STATE ========== */
.category-empty {
    text-align: center;
    padding: 32px 16px;
    color: rgba(255, 255, 255, 0.4);
}

.category-empty i {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* ========== MOBILE OPTIMIZATIONS ========== */
@media (max-width: 768px) {
    .category-accordion {
        margin-bottom: 12px;
        border-radius: 16px;
    }

    .category-header {
        padding: 16px 18px;
        gap: 12px;
    }

    .category-icon {
        width: 42px;
        height: 42px;
        border-radius: 12px;
        font-size: 18px;
    }

    .category-name {
        font-size: 16px;
    }

    .category-count {
        font-size: 11px;
        padding: 3px 8px;
    }

    .category-desc {
        font-size: 12px;
    }

    .category-toggle {
        width: 32px;
        height: 32px;
    }

    .category-content {
        padding: 0 18px;
    }

    .category-accordion.is-open .category-content {
        padding: 0 18px 18px;
    }

    .category-swiper .swiper-slide {
        width: 150px;
    }

    .swiper-nav-btn {
        display: none;
        /* Use swipe on mobile */
    }

    .case-card-mini-info {
        padding: 12px;
    }

    .case-card-mini-name {
        font-size: 12px;
        min-height: 32px;
    }

    .case-card-mini-price {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .category-swiper .swiper-slide {
        width: 140px;
    }

    .category-header {
        padding: 14px 16px;
    }

    .category-icon {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

    .category-name {
        font-size: 15px;
        flex-wrap: wrap;
    }

    .category-count {
        order: 1;
    }
}

/* ========== TOUCH INTERACTIONS ========== */
@media (hover: none) {
    .category-header:hover {
        background: transparent;
    }

    .category-accordion:hover .category-icon {
        transform: none;
    }

    .case-card-mini:hover {
        transform: none;
    }

    .case-card-mini:active {
        transform: scale(0.97);
    }
}

/* ========== REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {

    .category-content,
    .category-toggle i,
    .case-card-mini,
    .case-card-mini-image img,
    .swiper-pagination-bullet {
        transition: none !important;
    }

    .category-accordion.is-open .category-content {
        max-height: 1000px;
    }
}

/* ========== SCROLLBAR IN SWIPER ========== */
.category-swiper::-webkit-scrollbar {
    height: 4px;
}

.category-swiper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.category-swiper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

/* ========== LOADING SKELETON ========== */
.case-card-skeleton {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    overflow: hidden;
}

.case-card-skeleton .skeleton-image {
    padding-top: 100%;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.03) 25%,
            rgba(255, 255, 255, 0.08) 50%,
            rgba(255, 255, 255, 0.03) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.case-card-skeleton .skeleton-text {
    height: 14px;
    margin: 14px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 7px;
}

.case-card-skeleton .skeleton-price {
    height: 20px;
    width: 60%;
    margin: 0 14px 14px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}