/* =========================================================
   VELOCITY STORE
   PRODUCTS / CATEGORIES / PRODUCT CARDS
   PREMIUM CINEMATIC EDITION
========================================================= */


/* =========================================================
   CATEGORIES
========================================================= */

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.category-card {
    position: relative;

    min-height: 280px;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;

    padding: 26px;

    overflow: hidden;

    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    background: linear-gradient(
        145deg,
        rgba(255,255,255,0.06),
        rgba(255,255,255,0.015)
    );

    color: var(--white);

    text-align: left;

    cursor: pointer;

    transition:
        transform var(--transition),
        border-color var(--transition),
        background var(--transition);
}

.category-card::before {
    content: "";

    position: absolute;

    width: 180px;
    height: 180px;

    top: -60px;
    right: -60px;

    border-radius: 50%;

    background: var(--accent);

    opacity: 0.08;

    filter: blur(20px);

    transition:
        transform 700ms ease;
}

.category-card:hover {
    transform: translateY(-10px);

    border-color:
        rgba(217,255,63,0.3);

    background: linear-gradient(
        145deg,
        rgba(217,255,63,0.09),
        rgba(255,255,255,0.02)
    );
}

.category-card:hover::before {
    transform: scale(2.2);
}

.category-number {
    position: absolute;

    top: 22px;
    right: 24px;

    color: var(--text-muted);

    font-size: 10px;
    font-weight: 800;
}

.category-icon {
    width: 54px;
    height: 54px;

    display: grid;
    place-items: center;

    margin-bottom: auto;

    border-radius: 16px;

    background:
        rgba(217,255,63,0.08);

    color: var(--accent);

    font-size: 22px;
}

.category-card strong {
    font-size: 23px;
    font-weight: 850;
}

.category-card small {
    margin-top: 4px;

    color: var(--text-muted);

    font-size: 11px;
}

.category-arrow {
    position: absolute;

    right: 24px;
    bottom: 26px;

    color: var(--accent);

    font-size: 20px;

    transition:
        transform var(--transition);
}

.category-card:hover .category-arrow {
    transform: translateX(7px);
}


/* =========================================================
   PRODUCTS CONTROLS
========================================================= */

.product-controls {
    display: flex;
    flex-wrap: wrap;

    gap: 7px;
}

.filter-button {
    padding: 10px 15px;

    border: 1px solid var(--border);

    border-radius: 100px;

    background:
        rgba(255,255,255,0.03);

    color: var(--text-muted);

    font-size: 11px;
    font-weight: 750;

    cursor: pointer;

    transition:
        background var(--transition),
        color var(--transition),
        border-color var(--transition);
}

.filter-button:hover,
.filter-button.active {
    border-color: var(--accent);

    background: var(--accent);

    color: var(--black);
}


/* =========================================================
   PRODUCTS GRID
========================================================= */

.products-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 16px;

    overflow: visible;
}


/* =========================================================
   PRODUCT CARD
========================================================= */

.product-card {
    position: relative;

    z-index: 1;

    min-width: 0;

    overflow: hidden;

    border: 1px solid var(--border);

    border-radius: var(--radius-md);

    background: var(--surface);

    transform-style: preserve-3d;

    transform-origin: center center;

    backface-visibility: visible;

    isolation: isolate;

    cursor: pointer;

    transition:
        transform var(--transition),
        border-color var(--transition),
        box-shadow var(--transition);

    will-change: auto;

    -webkit-tap-highlight-color: transparent;
}


/* =========================================================
   NORMAL HOVER
========================================================= */

.product-card:hover {
    transform: translateY(-9px);

    border-color:
        rgba(217,255,63,0.22);

    box-shadow:
        0 30px 70px rgba(0,0,0,0.35);
}


/* =========================================================
   CINEMATIC ANIMATION STATE
========================================================= */

.product-card.velocity-cart-spin,
.product-card.velocity-cart-spinning,
.product-card.velocity-cart-launch {

    position: relative;

    z-index: 1000;

    transform-style: preserve-3d;

    transform-origin: center center;

    will-change:
        transform,
        filter;

    backface-visibility: visible;

    box-shadow:
        0 35px 100px rgba(0,0,0,0.55),
        0 0 45px rgba(217,255,63,0.12);

    pointer-events: none;
}


/* =========================================================
   PREVENT HOVER FROM OVERRIDING ANIMATION
========================================================= */

.product-card.velocity-cart-spin:hover,
.product-card.velocity-cart-spinning:hover,
.product-card.velocity-cart-launch:hover {

    border-color:
        rgba(217,255,63,0.45);
}


/* =========================================================
   HIDE QUICK VIEW + ADD TO CART FROM CARD
========================================================= */

.product-card .product-add,
.product-card .add-cart-button,
.product-card [data-cart-id],
.product-card [data-quick-add],
.product-card .quick-view,
.product-card .quick-view-button,
.product-card .product-quick-view,
.product-card [data-quick-view] {

    display: none !important;
}

.product-card button[data-action="add-cart"],
.product-card button[data-action="quick-view"],
.product-card button[data-action="quick-add"],
.product-card button.add-to-cart,
.product-card button.quick-view {

    display: none !important;
}


/* =========================================================
   PRODUCT IMAGE
========================================================= */

.product-image {
    position: relative;

    width: 100%;

    aspect-ratio: 1 / 1;

    display: flex;

    align-items: center;
    justify-content: center;

    overflow: hidden;

    isolation: isolate;

    background:
        radial-gradient(
            circle at 50% 35%,
            rgba(217,255,63,0.08),
            transparent 38%
        ),
        linear-gradient(
            135deg,
            #1d1d23,
            #0e0e12
        );
}

.product-image::after {
    content: "";

    position: absolute;

    inset: 0;

    z-index: 1;

    pointer-events: none;

    background:
        linear-gradient(
            135deg,
            rgba(255,255,255,0.045),
            transparent 38%,
            rgba(0,0,0,0.08)
        );

    opacity: 0.7;
}

.product-image img {
    position: relative;

    z-index: 0;

    display: block;

    width: 88%;
    height: 88%;

    object-fit: contain;

    object-position: center;

    border-radius: 12px;

    filter:
        drop-shadow(
            0 18px 28px rgba(0,0,0,0.32)
        );

    transform:
        translateZ(0)
        scale(1);

    transition:
        transform 700ms cubic-bezier(.2,.8,.2,1),
        filter 700ms cubic-bezier(.2,.8,.2,1);
}


/* =========================================================
   NORMAL HOVER IMAGE
========================================================= */

.product-card:hover
:not(.velocity-cart-spin)
.product-image img {

    transform:
        translateY(-4px)
        scale(1.045);

    filter:
        drop-shadow(
            0 25px 38px rgba(0,0,0,0.42)
        );
}


/* =========================================================
   CINEMATIC IMAGE
   NO SECONDARY ROTATION
========================================================= */

.product-card.velocity-cart-spin .product-image img,
.product-card.velocity-cart-spinning .product-image img,
.product-card.velocity-cart-launch .product-image img {

    animation: none !important;

    transform:
        translateZ(0)
        scale(1);

    filter:
        drop-shadow(
            0 25px 40px rgba(0,0,0,0.45)
        );
}

.product-image img[src*="data:image"] {
    object-fit: contain;
}


/* =========================================================
   PRODUCT IMAGE PLACEHOLDER
========================================================= */

.product-image-placeholder {
    position: relative;

    z-index: 2;

    width: 140px;
    height: 140px;

    display: grid;

    place-items: center;

    border-radius: 50%;

    background:
        rgba(217,255,63,0.07);

    color: var(--accent);

    font-weight: 900;

    letter-spacing: 0.08em;

    box-shadow:
        0 0 70px rgba(217,255,63,0.12);
}


/* =========================================================
   PRODUCT BADGE
========================================================= */

.product-badge {
    position: absolute;

    top: 13px;
    left: 13px;

    z-index: 4;

    padding: 7px 9px;

    border-radius: 8px;

    background: var(--accent);

    color: var(--black);

    font-size: 8px;
    font-weight: 950;

    letter-spacing: 0.08em;
}


/* =========================================================
   PRODUCT WISHLIST
========================================================= */

.product-wishlist {
    position: absolute;

    top: 12px;
    right: 12px;

    z-index: 5;

    width: 38px;
    height: 38px;

    display: grid;

    place-items: center;

    border: 0;

    border-radius: 50%;

    background:
        rgba(8,8,11,0.7);

    color: var(--white);

    cursor: pointer;

    backdrop-filter: blur(10px);

    transition:
        background var(--transition),
        color var(--transition),
        transform var(--transition);
}

.product-wishlist:hover,
.product-wishlist.active {

    background: var(--accent);

    color: var(--black);

    transform: scale(1.08);
}


/* =========================================================
   WISHLIST DURING CINEMATIC ANIMATION
========================================================= */

.product-card.velocity-cart-spin .product-wishlist,
.product-card.velocity-cart-spinning .product-wishlist,
.product-card.velocity-cart-launch .product-wishlist {

    pointer-events: none;
}


/* =========================================================
   PRODUCT INFO
========================================================= */

.product-info {
    padding: 18px;
}

.product-category {
    color: var(--text-muted);

    font-size: 9px;
    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: 0.12em;
}

.product-name {
    margin: 7px 0 8px;

    font-size: 15px;
    font-weight: 800;
}

.product-rating {
    color: var(--accent);

    font-size: 10px;
}

.product-price {
    display: flex;

    align-items: center;

    gap: 8px;

    margin-top: 12px;
}

.product-price strong {
    font-size: 16px;
}

.product-price del {
    color: var(--text-muted);

    font-size: 11px;
}


/* =========================================================
   LEGACY PRODUCT ADD BUTTON
   HIDDEN FROM PRODUCT CARD
========================================================= */

.product-add {
    width: 100%;

    min-height: 42px;

    margin-top: 14px;

    border: 0;

    border-radius: 11px;

    background:
        rgba(255,255,255,0.06);

    color: var(--white);

    font-size: 11px;
    font-weight: 800;

    cursor: pointer;

    transition:
        background var(--transition),
        color var(--transition),
        transform var(--transition);

    display: none !important;
}


/* =========================================================
   EMPTY PRODUCTS
========================================================= */

.products-empty {
    padding: 70px 20px;

    border:
        1px dashed var(--border-light);

    border-radius:
        var(--radius-lg);

    text-align: center;
}

.products-empty h3 {
    margin: 0 0 8px;
}

.products-empty p {
    margin: 0;

    color: var(--text-muted);
}


/* =========================================================
   CINEMATIC CARD ANIMATION
   EXACTLY ONE FULL ROTATION
   360deg
========================================================= */

.product-card.velocity-cart-spin,
.product-card.velocity-cart-spinning {

    animation:
        velocityPremiumCardSpin
        1800ms
        cubic-bezier(.22,.61,.36,1)
        both;
}


/* =========================================================
   PREMIUM 3D CARD SPIN
   EXACTLY 360 DEGREES
========================================================= */

@keyframes velocityPremiumCardSpin {

    0% {

        transform:
            perspective(1600px)
            translateZ(0)
            rotateY(0deg)
            rotateZ(0deg)
            scale(1);
    }

    25% {

        transform:
            perspective(1600px)
            translateZ(55px)
            rotateY(90deg)
            rotateZ(0deg)
            scale(1.08);
    }

    50% {

        transform:
            perspective(1600px)
            translateZ(85px)
            rotateY(180deg)
            rotateZ(0deg)
            scale(1.12);
    }

    75% {

        transform:
            perspective(1600px)
            translateZ(55px)
            rotateY(270deg)
            rotateZ(0deg)
            scale(1.08);
    }

    100% {

        transform:
            perspective(1600px)
            translateZ(0)
            rotateY(360deg)
            rotateZ(0deg)
            scale(1);
    }
}


/* =========================================================
   CARD CINEMATIC LIGHT
========================================================= */

.product-card.velocity-cart-spin::before,
.product-card.velocity-cart-spinning::before {

    content: "";

    position: absolute;

    inset: 0;

    z-index: 2;

    border-radius: inherit;

    background:
        linear-gradient(
            135deg,
            transparent 20%,
            rgba(217,255,63,0.28),
            transparent 70%
        );

    opacity: 0;

    pointer-events: none;

    animation:
        velocityCardGlow
        1800ms
        ease
        both;
}


/* =========================================================
   CARD GLOW
========================================================= */

@keyframes velocityCardGlow {

    0% {

        opacity: 0;

        transform:
            scale(0.8);
    }

    30% {

        opacity: 0.85;

        transform:
            scale(1.02);
    }

    65% {

        opacity: 0.5;

        transform:
            scale(1.06);
    }

    100% {

        opacity: 0;

        transform:
            scale(1.12);
    }
}


/* =========================================================
   EXTERNAL VELOCITY GLOW
   Used by velocity-cart-ui.js
========================================================= */

.velocity-cart-glow {

    position: absolute;

    inset: -12px;

    z-index: -1;

    border-radius: inherit;

    background:
        radial-gradient(
            ellipse at center,
            rgba(217,255,63,0.45),
            rgba(217,255,63,0.12) 45%,
            transparent 75%
        );

    opacity: 0;

    filter: blur(22px);

    pointer-events: none;
}

.velocity-cart-glow.active {

    animation:
        velocityExternalGlow
        1800ms
        ease
        both;
}


@keyframes velocityExternalGlow {

    0% {

        opacity: 0;

        transform:
            scale(0.75);
    }

    35% {

        opacity: 0.8;

        transform:
            scale(1.12);
    }

    70% {

        opacity: 0.5;

        transform:
            scale(1.22);
    }

    100% {

        opacity: 0;

        transform:
            scale(1.35);
    }
}


/* =========================================================
   NO SECONDARY PRODUCT IMAGE ROTATION
========================================================= */

@keyframes velocityProductImageSpin {

    from {

        transform:
            translateZ(0)
            scale(1)
            rotate(0deg);
    }

    to {

        transform:
            translateZ(0)
            scale(1)
            rotate(0deg);
    }
}


/* =========================================================
   IMAGE PULSE
========================================================= */

@keyframes velocityImagePulse {

    0% {

        box-shadow:
            inset 0 0 0
            rgba(217,255,63,0);
    }

    50% {

        box-shadow:
            inset 0 0 70px
            rgba(217,255,63,0.12);
    }

    100% {

        box-shadow:
            inset 0 0 0
            rgba(217,255,63,0);
    }
}


/* =========================================================
   CARD LAUNCH EFFECT
========================================================= */

.product-card.velocity-cart-launch {

    filter:
        brightness(1.08)
        saturate(1.1);
}


/* =========================================================
   ACCESSIBILITY
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .product-card.velocity-cart-spin,
    .product-card.velocity-cart-spinning,
    .product-card.velocity-cart-launch,
    .product-card.velocity-cart-spin::before,
    .product-card.velocity-cart-spinning::before,
    .velocity-cart-glow.active {

        animation-duration:
            1ms !important;

        animation-iteration-count:
            1 !important;
    }

    .product-card.velocity-cart-spin .product-image img,
    .product-card.velocity-cart-spinning .product-image img {

        animation: none !important;
    }
}


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

@media (max-width: 1100px) {

    .products-grid {

        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

    .category-grid {

        grid-template-columns:
            repeat(2, 1fr);
    }
}


@media (max-width: 800px) {

    .products-grid {

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 12px;
    }

    .product-info {

        padding: 14px;
    }
}


@media (max-width: 520px) {

    .category-grid {

        grid-template-columns: 1fr;
    }

    .products-grid {

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 10px;
    }

    .product-image img {

        width: 84%;
        height: 84%;

        border-radius: 10px;
    }

    .product-badge {

        top: 8px;
        left: 8px;

        padding: 6px 7px;

        font-size: 7px;
    }

    .product-wishlist {

        top: 8px;
        right: 8px;

        width: 34px;
        height: 34px;
    }

    .product-name {

        font-size: 13px;
    }

    .product-price {

        gap: 5px;
    }

    .product-price strong {

        font-size: 14px;
    }

    .product-add {

        min-height: 38px;

        margin-top: 10px;

        font-size: 10px;
    }
}


/* =========================================================
   SMALL SCREEN CINEMATIC ANIMATION
========================================================= */

@media (max-width: 520px) {

    .product-card.velocity-cart-spin,
    .product-card.velocity-cart-spinning {

        animation-duration:
            1800ms;

        animation-timing-function:
            cubic-bezier(.22,.61,.36,1);

        z-index: 1000;
    }
}


/* =========================================================
   FINAL CARD CLICK BEHAVIOR
========================================================= */

.product-card .product-image,
.product-card .product-info {

    cursor: pointer;
}


/* =========================================================
   WISHLIST CONTROL
========================================================= */

.product-card .product-wishlist {

    cursor: pointer;
}


/* =========================================================
   FINAL MOBILE PRODUCT GRID FIX
   ---------------------------------------------------------
   FORCE 2 PRODUCT CARDS PER ROW
========================================================= */

@media (max-width: 768px) {

    .products-grid,
    #productsGrid,
    .product-grid {

        display: grid !important;

        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;

        grid-template-rows: auto !important;

        grid-auto-flow: row !important;

        grid-auto-columns: auto !important;

        column-gap: 10px !important;

        row-gap: 10px !important;

        width: 100% !important;

        max-width: 100% !important;

        min-width: 0 !important;

        overflow: visible !important;
    }


    .products-grid > .product-card,
    #productsGrid > .product-card,
    .product-grid > .product-card {

        grid-column: auto !important;

        grid-row: auto !important;

        width: 100% !important;

        max-width: 100% !important;

        min-width: 0 !important;

        margin: 0 !important;
    }

}


/* =========================================================
   FINAL SMALL PHONE FIX
========================================================= */

@media (max-width: 520px) {

    .products-grid,
    #productsGrid,
    .product-grid {

        display: grid !important;

        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;

        column-gap: 8px !important;

        row-gap: 10px !important;

    }


    .products-grid > .product-card,
    #productsGrid > .product-card,
    .product-grid > .product-card {

        grid-column: auto !important;

        grid-row: auto !important;

        width: 100% !important;

        max-width: 100% !important;

        min-width: 0 !important;

    }

}


/* =========================================================
   FINAL VERY SMALL PHONE FIX
========================================================= */

@media (max-width: 360px) {

    .products-grid,
    #productsGrid,
    .product-grid {

        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;

        column-gap: 7px !important;

        row-gap: 8px !important;

    }


    .products-grid > .product-card,
    #productsGrid > .product-card,
    .product-grid > .product-card {

        grid-column: auto !important;

        width: 100% !important;

        min-width: 0 !important;

    }

       }
