/* =========================================================
   CyberTech / GamerCore — Modern Categories Carousel V2
   Drop-in styles for the existing:
   .categories-carousel-wrapper
   #categoriesCarousel
   .category-carousel-item
========================================================= */

.categories-home {
    width: 100%;
    margin: 26px 0 34px;
    padding: 0 14px;
    box-sizing: border-box;
}

.categories-carousel-wrapper {
    position: relative;
    width: min(1480px, 100%);
    margin: 0 auto;
    padding: 14px 58px 20px;
    box-sizing: border-box;
    overflow: visible;
    isolation: isolate;
}

#categoriesCarousel.ct-modern-carousel {
    position: relative;
    width: 100%;
    overflow: hidden !important;
    border-radius: 24px;
    padding: 10px 4px 16px;
    box-sizing: border-box;
    touch-action: pan-y pinch-zoom;
    cursor: grab;
}

#categoriesCarousel.ct-modern-carousel.is-dragging {
    cursor: grabbing;
}

#categoriesCarousel .ct-cat-track {
    display: flex;
    width: max-content;
    gap: 16px;
    direction: rtl;
    margin-left: auto;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    transition: transform .72s cubic-bezier(.16, .84, .24, 1);
}

#categoriesCarousel.is-dragging .ct-cat-track {
    transition: none !important;
}

#categoriesCarousel .category-carousel-item {
    position: relative;
    flex: 0 0 clamp(190px, 16vw, 235px);
    width: clamp(190px, 16vw, 235px);
    min-width: clamp(190px, 16vw, 235px);
    min-height: 188px;

    display: flex !important;
    flex-direction: column;
    justify-content: stretch;

    padding: 14px 14px 16px;
    box-sizing: border-box;
    text-decoration: none !important;
    color: #0f172a !important;

    border: 1px solid rgba(148,163,184,.24);
    border-radius: 22px;
    overflow: hidden;

    background:
        radial-gradient(circle at 85% 12%, rgba(96,165,250,.20), transparent 31%),
        radial-gradient(circle at 10% 95%, rgba(139,92,246,.13), transparent 36%),
        rgba(255,255,255,.94);

    box-shadow:
        0 10px 30px rgba(15,23,42,.08),
        inset 0 1px 0 rgba(255,255,255,.95);

    transition:
        transform .32s cubic-bezier(.2,.8,.2,1),
        box-shadow .32s ease,
        border-color .32s ease,
        filter .32s ease;
    transform: translateZ(0);
}

#categoriesCarousel .category-carousel-item::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    background:
        linear-gradient(115deg,
            transparent 15%,
            rgba(255,255,255,.70) 42%,
            transparent 67%);
    transform: translateX(-120%);
    transition:
        transform .75s cubic-bezier(.2,.7,.2,1),
        opacity .25s ease;
}

#categoriesCarousel .category-carousel-item:hover {
    transform: translateY(-7px) scale(1.018);
    border-color: rgba(59,130,246,.45);
    box-shadow:
        0 20px 48px rgba(37,99,235,.16),
        0 7px 18px rgba(15,23,42,.09),
        inset 0 1px 0 rgba(255,255,255,.98);
}

#categoriesCarousel .category-carousel-item:hover::before {
    opacity: 1;
    transform: translateX(120%);
}

#categoriesCarousel .category-carousel-item.is-center-card {
    border-color: rgba(37,99,235,.48);
    box-shadow:
        0 18px 42px rgba(37,99,235,.13),
        inset 0 1px 0 rgba(255,255,255,.98);
}

#categoriesCarousel .category-carousel-item.is-active-category {
    outline: 2px solid rgba(37,99,235,.62);
    outline-offset: -2px;
}

#categoriesCarousel .category-image {
    position: relative;
    width: 100%;
    height: 122px !important;
    min-height: 122px;
    margin: 0 0 10px !important;
    padding: 8px !important;
    box-sizing: border-box;

    display: flex !important;
    align-items: center;
    justify-content: center;

    border-radius: 17px;
    background:
        linear-gradient(180deg, rgba(248,250,252,.96), rgba(241,245,249,.78));
    overflow: hidden;
}

#categoriesCarousel .category-image img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain !important;
    transform: scale(1);
    filter: drop-shadow(0 9px 11px rgba(15,23,42,.11));
    transition:
        transform .38s cubic-bezier(.2,.8,.2,1),
        filter .38s ease;
}

#categoriesCarousel .category-carousel-item:hover .category-image img {
    transform: scale(1.075) rotate(-1deg);
    filter: drop-shadow(0 14px 16px rgba(37,99,235,.18));
}

#categoriesCarousel .category-info {
    position: relative;
    z-index: 2;
    text-align: center;
    direction: rtl;
}

#categoriesCarousel .category-info h3 {
    margin: 0 0 5px !important;
    color: #0f172a !important;
    font-size: .95rem !important;
    line-height: 1.35;
    font-weight: 800;
    letter-spacing: -.01em;
}

#categoriesCarousel .category-info p {
    margin: 0 !important;
    color: #64748b !important;
    font-size: .74rem !important;
    font-weight: 700;
}

/* Modern floating arrows */
.categories-carousel-wrapper > .carousel-arrow {
    position: absolute !important;
    top: 50% !important;
    z-index: 20 !important;

    width: 48px !important;
    height: 58px !important;
    padding: 0 !important;

    display: grid !important;
    place-items: center !important;

    transform: translateY(-58%) !important;

    border: 1px solid rgba(148,163,184,.28) !important;
    border-radius: 17px !important;

    background: rgba(255,255,255,.88) !important;
    color: #1d4ed8 !important;

    -webkit-backdrop-filter: blur(14px) saturate(145%);
    backdrop-filter: blur(14px) saturate(145%);

    box-shadow:
        0 12px 32px rgba(15,23,42,.12),
        inset 0 1px 0 rgba(255,255,255,.95) !important;

    cursor: pointer !important;
    opacity: 1 !important;
    visibility: visible !important;

    transition:
        transform .22s cubic-bezier(.2,.8,.2,1),
        box-shadow .22s ease,
        opacity .22s ease,
        background .22s ease !important;
}

.categories-carousel-wrapper > .carousel-arrow:hover:not(:disabled) {
    transform: translateY(-58%) scale(1.08) !important;
    background: #fff !important;
    box-shadow:
        0 16px 38px rgba(37,99,235,.18),
        inset 0 1px 0 rgba(255,255,255,1) !important;
}

.categories-carousel-wrapper > .carousel-arrow:active:not(:disabled) {
    transform: translateY(-58%) scale(.94) !important;
}

.categories-carousel-wrapper > .carousel-arrow:disabled {
    opacity: .28 !important;
    cursor: default !important;
    pointer-events: none !important;
}

.categories-carousel-wrapper > .carousel-arrow-left {
    left: 4px !important;
}

.categories-carousel-wrapper > .carousel-arrow-right {
    right: 4px !important;
}

/* Works with either SVG or simple ‹ › text */
.categories-carousel-wrapper > .carousel-arrow svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.categories-carousel-wrapper > .carousel-arrow {
    font-size: 29px !important;
    font-weight: 700;
    line-height: 1;
}

/* Progress rail */
.ct-cat-progress {
    position: absolute;
    left: 62px;
    right: 62px;
    bottom: 1px;
    height: 4px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(148,163,184,.17);
}

.ct-cat-progress > span {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    transition: width .55s cubic-bezier(.2,.8,.2,1);
}

/* Edge fade */
#categoriesCarousel.ct-modern-carousel::before,
#categoriesCarousel.ct-modern-carousel::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 10px;
    z-index: 5;
    width: 34px;
    pointer-events: none;
}

#categoriesCarousel.ct-modern-carousel::before {
    left: 0;
    background: linear-gradient(90deg, rgba(248,250,252,.95), transparent);
}

#categoriesCarousel.ct-modern-carousel::after {
    right: 0;
    background: linear-gradient(270deg, rgba(248,250,252,.95), transparent);
}

/* Tablet */
@media (max-width: 992px) {
    .categories-carousel-wrapper {
        padding-inline: 48px;
    }

    #categoriesCarousel .category-carousel-item {
        flex-basis: clamp(170px, 29vw, 210px);
        width: clamp(170px, 29vw, 210px);
        min-width: clamp(170px, 29vw, 210px);
    }

    .categories-carousel-wrapper > .carousel-arrow {
        width: 40px !important;
        height: 52px !important;
        border-radius: 15px !important;
    }

    .ct-cat-progress {
        left: 50px;
        right: 50px;
    }
}

/* Mobile: roughly 2 cards visible */
@media (max-width: 600px) {
    .categories-home {
        padding-inline: 7px;
        margin-top: 18px;
    }

    .categories-carousel-wrapper {
        padding: 10px 34px 18px;
    }

    #categoriesCarousel.ct-modern-carousel {
        border-radius: 18px;
        padding-top: 8px;
    }

    #categoriesCarousel .ct-cat-track {
        gap: 9px;
    }

    #categoriesCarousel .category-carousel-item {
        flex: 0 0 calc((100vw - 105px) / 2);
        width: calc((100vw - 105px) / 2);
        min-width: 132px;
        max-width: 172px;
        min-height: 154px;
        padding: 9px 8px 11px;
        border-radius: 17px;
    }

    #categoriesCarousel .category-image {
        height: 90px !important;
        min-height: 90px;
        padding: 5px !important;
        border-radius: 13px;
        margin-bottom: 7px !important;
    }

    #categoriesCarousel .category-info h3 {
        font-size: .78rem !important;
    }

    #categoriesCarousel .category-info p {
        font-size: .65rem !important;
    }

    .categories-carousel-wrapper > .carousel-arrow {
        width: 30px !important;
        height: 46px !important;
        border-radius: 12px !important;
        font-size: 22px !important;
    }

    .categories-carousel-wrapper > .carousel-arrow-left {
        left: 1px !important;
    }

    .categories-carousel-wrapper > .carousel-arrow-right {
        right: 1px !important;
    }

    .ct-cat-progress {
        left: 37px;
        right: 37px;
        height: 3px;
    }

    #categoriesCarousel.ct-modern-carousel::before,
    #categoriesCarousel.ct-modern-carousel::after {
        width: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #categoriesCarousel .ct-cat-track,
    #categoriesCarousel .category-carousel-item,
    #categoriesCarousel .category-image img,
    .ct-cat-progress > span {
        transition-duration: .01ms !important;
    }
}
