/* Original product screenshots retain their complete content and colours. */
.store-main .product-3d-card.hn-original-product-card .card-banner-wrap::before {
    content: none;
}
.store-main .product-3d-card.hn-original-product-card .card-banner-img {
    object-fit: contain;
    -webkit-mask-image: none;
    mask-image: none;
}

/* HUBNRO spatial glass. Keep the card's 3D context unclipped; only media clips. */
.hn-spatial-card:is(.product-3d-card, .hub-ai-card, .vps-plan-card, .hg-card) {
    --hn-glass-surface: rgba(249, 252, 255, .8);
    --hn-glass-edge: rgba(255, 255, 255, .95);
    --hn-glass-tint: rgba(77, 153, 244, .09);
    --hn-glass-sheen: rgba(255, 255, 255, .55);
    --hn-rotate-x: 0deg;
    --hn-rotate-y: 0deg;
    --hn-lift: 0px;
    --hn-content-z: 0px;
    --hn-detail-z: 0px;
    --hn-light-x: 30%;
    --hn-light-y: 0%;
    position: relative;
    overflow: visible;
    isolation: auto;
    transform-style: preserve-3d;
    transform: perspective(1100px) translateY(var(--hn-lift)) rotateX(var(--hn-rotate-x)) rotateY(var(--hn-rotate-y)) !important;
    background: linear-gradient(145deg, var(--hn-glass-surface), var(--card-bg));
    border-color: rgba(168, 190, 224, .5);
    box-shadow: 0 12px 28px rgba(35, 61, 112, .06), inset 0 1px 0 var(--hn-glass-edge), inset 0 -1px 0 rgba(117, 159, 215, .12);
    /* Filters on the parent flatten preserve-3d; glass blur lives on its own plane. */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transition: transform .4s cubic-bezier(.18, .72, .25, 1), box-shadow .3s ease, border-color .3s ease;
}

.hn-spatial-card::before,
.hn-spatial-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
}

.hn-spatial-card::before {
    background: linear-gradient(130deg, rgba(255, 255, 255, .06), var(--hn-glass-tint) 58%, rgba(157, 123, 255, .05));
    box-shadow: inset 1px 1px 0 var(--hn-glass-edge), inset -1px -1px 0 rgba(118, 170, 237, .2);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    transform: translateZ(-1px);
}

.hn-spatial-card::after {
    background: radial-gradient(ellipse at var(--hn-light-x) var(--hn-light-y), var(--hn-glass-sheen), transparent 62%);
    border: 1px solid var(--hn-glass-edge);
    opacity: .15;
    transform: translateZ(2px);
    transition: opacity .3s ease;
}

.hn-spatial-card.product-3d-card .card-banner-wrap {
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    transform: translateZ(var(--hn-content-z));
    transition: transform .35s ease;
}

.hn-spatial-card.product-3d-card .card-banner-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at var(--hn-light-x) var(--hn-light-y), rgba(255, 255, 255, .23), transparent 68%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}

.hn-spatial-card.product-3d-card .card-body-wrap {
    position: relative;
    border-radius: 0 0 16px 16px;
    transform-style: preserve-3d;
    transform: translateZ(var(--hn-content-z));
    transition: transform .35s ease;
}

.hn-spatial-card .card-title-text,
.hn-spatial-card .card-footer-row,
.hn-spatial-card.hub-ai-card > :not(.hub-ai-meta):not(.hub-ai-desc),
.hn-spatial-card.vps-plan-card > :not(.vps-card-specs):not(.vps-card-desc) {
    transform: translateZ(var(--hn-detail-z));
    transition: transform .35s ease;
}

.hn-spatial-card.hub-ai-card > *,
.hn-spatial-card.hg-card > *,
.hn-spatial-card.vps-plan-card > * {
    position: relative;
}

/* These two badges retain their absolute positions and never affect card height. */
.hn-spatial-card.vps-plan-card > .vps-card-ribbon,
.hn-spatial-card.vps-plan-card > .vps-card-badge-cheap {
    position: absolute;
}

/* Reserve a separate row for badges, including plans with both badges. */
.hn-spatial-card.vps-plan-card .vps-card-top {
    padding-top: 44px;
}

.hn-spatial-card .card-action-pill,
.hn-spatial-card .hub-ai-card-button {
    box-shadow: inset 0 1px 0 var(--hn-glass-edge), 0 4px 10px rgba(47, 100, 178, .05);
}

.hn-spatial-card:is(.product-3d-card, .hub-ai-card, .vps-plan-card, .hg-card):focus-visible,
.hn-spatial-card:is(.product-3d-card, .hub-ai-card, .vps-plan-card, .hg-card):focus-within {
    border-color: #6f9af2;
    box-shadow: 0 0 0 3px rgba(70, 121, 227, .16), 0 18px 34px rgba(35, 61, 112, .11);
}

[data-theme="dark"] .hn-spatial-card {
    --hn-glass-surface: rgba(29, 45, 70, .83);
    --hn-glass-edge: rgba(175, 210, 255, .19);
    --hn-glass-tint: rgba(78, 151, 232, .12);
    --hn-glass-sheen: rgba(117, 190, 255, .25);
    border-color: rgba(123, 168, 227, .27);
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .hn-spatial-card:is(.product-3d-card, .hub-ai-card, .vps-plan-card, .hg-card).is-spatial-active {
        --hn-lift: -9px;
        --hn-content-z: 15px;
        --hn-detail-z: 24px;
        z-index: 3;
        border-color: rgba(119, 173, 246, .75);
        box-shadow: 0 27px 42px -15px rgba(29, 67, 139, .3), 0 8px 20px rgba(99, 156, 225, .12), -8px 0 26px -15px rgba(63, 209, 226, .35), 8px 0 26px -15px rgba(148, 112, 244, .3), inset 0 1px 0 var(--hn-glass-edge);
        transition: transform .13s ease-out, box-shadow .3s ease, border-color .3s ease;
        will-change: transform;
    }

    .hn-spatial-card.is-spatial-active::after { opacity: .7; }
    .hn-spatial-card.product-3d-card.is-spatial-active .card-banner-wrap::after { opacity: 1; }

    .hn-spatial-card.is-spatial-active .card-action-pill {
        background: linear-gradient(125deg, #eaf4ff, #e7eaff);
        box-shadow: inset 0 1px 0 #fff, 0 5px 14px rgba(53, 105, 192, .12);
    }

    [data-theme="dark"] .hn-spatial-card.is-spatial-active {
        box-shadow: 0 27px 45px -15px rgba(0, 0, 0, .55), 0 0 30px rgba(74, 139, 237, .1), inset 0 1px 0 rgba(185, 219, 255, .3);
    }

    [data-theme="dark"] .hn-spatial-card.is-spatial-active .card-action-pill {
        background: linear-gradient(125deg, #274775, #35416c);
        box-shadow: inset 0 1px 0 rgba(197, 224, 255, .2), 0 5px 14px rgba(0, 0, 0, .14);
    }
}

@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
    .hn-spatial-card:is(.product-3d-card, .hub-ai-card, .vps-plan-card, .hg-card),
    .hn-spatial-card.is-spatial-active {
        --hn-content-z: 0px;
        --hn-detail-z: 0px;
        transform: none !important;
        transition: none;
        will-change: auto;
    }

    .hn-spatial-card::after { opacity: .15; transition: none; }
    .hn-spatial-card .card-body-wrap,
    .hn-spatial-card .card-banner-wrap,
    .hn-spatial-card .card-title-text,
    .hn-spatial-card .card-footer-row,
    .hn-spatial-card.hub-ai-card > *,
.hn-spatial-card.hg-card > *,
    .hn-spatial-card.vps-plan-card > * { transform: none; transition: none; }
}

/* Game service illustrations share the storefront spatial interaction. */
.hn-spatial-card.hg-card .hg-card-art {
    overflow: hidden;
    border-radius: 19px 19px 0 0;
    transform: translateZ(var(--hn-content-z));
    transition: transform .35s ease;
}
.hn-spatial-card.hg-card .hg-card-body {
    border-radius: 0 0 19px 19px;
    transform: translateZ(var(--hn-detail-z));
    transition: transform .35s ease;
}
@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
    .hn-spatial-card.hg-card > * { transform: none; transition: none; }
}

/* 3D Spatial Video Cards & Grid */
.videos-3d-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 22px;
}
.video-3d-card {
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--hn-shadow);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, border-color 0.3s ease;
    text-decoration: none !important;
    position: relative;
}
.video-3d-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
    border-color: rgba(239, 68, 68, 0.35);
}
.video-banner-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #08070b;
}
.video-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.video-3d-card:hover .video-banner-img {
    transform: scale(1.05);
}
.video-overlay-glass {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.65) 100%);
    pointer-events: none;
}
.video-play-orb {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6);
    transition: transform 0.25s ease, background 0.25s ease;
    z-index: 3;
}
.video-3d-card:hover .video-play-orb {
    transform: translate(-50%, -50%) scale(1.1);
    background: #ff2222;
}
.video-hd-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 9.5px;
    font-weight: 700;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.7);
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 2;
}
.video-body-wrap {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.video-tag-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.video-cat-pill {
    font-size: 10.5px;
    font-weight: 700;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    padding: 3px 9px;
    border-radius: 6px;
}
.video-channel-tag {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}
.video-channel-tag i {
    color: #ef4444;
    margin-right: 3px;
}
.video-title-text {
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.video-title-text a {
    color: var(--text-primary);
    text-decoration: none !important;
}
.video-title-text a:hover {
    color: #ef4444;
}
.video-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
}
.video-stats-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}
.video-cta-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 700;
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.1);
    padding: 4px 10px;
    border-radius: 8px;
    text-decoration: none !important;
    transition: background 0.2s ease, color 0.2s ease;
}
.video-cta-pill:hover {
    background: #ef4444;
    color: #ffffff !important;
}
@media (max-width: 768px) {
    .videos-3d-grid {
        grid-template-columns: 1fr;
    }
}

/* Source product showcase: a calm 3D stack that keeps the title and price easy to scan. */
.hn-spatial-card.hn-source-card-3d {
    --hn-source-blue: #4d7cf3;
    --hn-source-violet: #8469e8;
    --hn-content-z: 5px;
    border-radius: 24px;
    overflow: visible;
    min-height: 100%;
    background:
        radial-gradient(circle at 88% 8%, rgba(132, 105, 232, .14), transparent 35%),
        linear-gradient(145deg, rgba(255, 255, 255, .96), var(--card-bg));
    border-color: rgba(157, 182, 228, .65);
    box-shadow: 0 14px 30px rgba(38, 71, 132, .08), 0 3px 0 rgba(255, 255, 255, .8) inset;
}
.hn-spatial-card.hn-source-card-3d::before {
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(255, 255, 255, .24), rgba(81, 137, 244, .08) 58%, rgba(132, 105, 232, .12));
}
.hn-spatial-card.hn-source-card-3d::after {
    border-radius: 24px;
    background:
        radial-gradient(circle at var(--hn-light-x) var(--hn-light-y), rgba(255, 255, 255, .72), transparent 40%),
        linear-gradient(135deg, transparent 50%, rgba(76, 125, 236, .08));
    opacity: .3;
}
.store-main .hn-spatial-card.hn-source-card-3d .card-banner-wrap {
    position: relative;
    margin: 12px 12px 0;
    width: calc(100% - 24px);
    aspect-ratio: 1.48;
    border-radius: 19px;
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(145deg, #eef5ff, #e4e9ff);
    border: 1px solid rgba(255, 255, 255, .86);
    box-shadow: 0 12px 22px rgba(46, 82, 151, .14), inset 0 1px 0 rgba(255, 255, 255, .95);
    transform: translateZ(calc(var(--hn-content-z) + 6px));
}
.store-main .hn-spatial-card.hn-source-card-3d .card-banner-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .38), transparent 34%),
        linear-gradient(180deg, transparent 52%, rgba(12, 29, 72, .18));
    opacity: .72;
}
.store-main .hn-spatial-card.hn-source-card-3d .card-banner-img {
    position: relative;
    z-index: 0;
    transform: translateZ(8px) scale(1.025) !important;
    filter: saturate(1.05) contrast(1.02);
    transition: transform .45s cubic-bezier(.18, .72, .25, 1), filter .35s ease;
}
.store-main .hn-spatial-card.hn-source-card-3d.is-spatial-active .card-banner-img {
    transform: translate3d(0, -4px, 22px) scale(1.07) !important;
    filter: saturate(1.12) contrast(1.04);
}
.hn-source-card-3d .hn-card-badge {
    z-index: 3;
    top: 12px;
    left: 12px;
    border-radius: 999px;
    padding: 6px 10px;
    background: rgba(16, 36, 79, .72);
    border-color: rgba(255, 255, 255, .36);
    box-shadow: 0 5px 14px rgba(15, 37, 90, .18);
}
.hn-source-card-3d .hn-card-sale {
    left: auto;
    right: 12px;
    background: linear-gradient(135deg, #4c7bf2, #8067df);
}
.hn-source-card-index {
    position: absolute;
    right: 13px;
    bottom: 11px;
    z-index: 3;
    color: rgba(255, 255, 255, .9);
    font: 700 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .12em;
    text-shadow: 0 2px 8px rgba(7, 25, 65, .55);
}
.hn-source-card-3d .card-body-wrap {
    padding: 19px 20px 21px;
    transform: translateZ(calc(var(--hn-content-z) + 2px));
}
.hn-source-card-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 17px;
}
.hn-source-card-type {
    color: var(--text-muted);
    font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
    letter-spacing: .13em;
    opacity: .78;
}
.hn-source-card-3d .card-title-text {
    margin-top: 9px;
    letter-spacing: -.02em;
    transform: translateZ(calc(var(--hn-detail-z) + 2px));
}
.hn-source-card-3d .card-subtitle-text {
    color: var(--text-secondary);
}
.hn-source-card-3d .card-footer-row {
    transform: translateZ(calc(var(--hn-detail-z) + 3px));
}
.hn-source-card-3d .card-action-pill {
    border: 1px solid rgba(87, 128, 224, .14);
    background: linear-gradient(135deg, rgba(232, 242, 255, .95), rgba(237, 233, 255, .92));
}
.hn-source-card-3d:hover,
.hn-source-card-3d:focus-visible {
    border-color: rgba(100, 139, 234, .75);
}
[data-theme="dark"] .hn-spatial-card.hn-source-card-3d {
    background:
        radial-gradient(circle at 88% 8%, rgba(132, 105, 232, .17), transparent 35%),
        linear-gradient(145deg, rgba(29, 48, 78, .96), var(--card-bg));
    border-color: rgba(119, 159, 226, .4);
}
[data-theme="dark"] .store-main .hn-spatial-card.hn-source-card-3d .card-banner-wrap {
    background: linear-gradient(145deg, #1e365c, #29305b);
    border-color: rgba(188, 216, 255, .16);
}
[data-theme="dark"] .hn-source-card-type {
    color: #a5b8d7;
}
[data-theme="dark"] .hn-source-card-3d .card-action-pill {
    color: #bcd3ff;
    background: linear-gradient(135deg, rgba(39, 71, 117, .96), rgba(60, 55, 107, .94));
    border-color: rgba(180, 210, 255, .14);
}

/* The detail page uses the same perspective language with a smaller tilt so the CTA stays stable. */
.hn-product-detail-tilt {
    --hn-rotate-x: 0deg;
    --hn-rotate-y: 0deg;
    position: relative;
    transform-style: preserve-3d;
    transform: perspective(1250px) rotateX(var(--hn-rotate-x)) rotateY(var(--hn-rotate-y)) !important;
    transition: transform .35s cubic-bezier(.18, .72, .25, 1), box-shadow .3s ease, border-color .3s ease;
}
.main-preview-glass.hn-product-detail-tilt {
    box-shadow: 0 18px 38px rgba(35, 69, 128, .12), inset 0 1px 0 rgba(255, 255, 255, .8);
}
.showcase-info-col.hn-product-detail-tilt {
    box-shadow: 0 15px 34px rgba(35, 69, 128, .09), inset 0 1px 0 rgba(255, 255, 255, .78);
}
.hn-product-detail-tilt.is-spatial-active {
    border-color: rgba(105, 145, 236, .65);
    box-shadow: 0 25px 48px rgba(35, 69, 128, .16), 0 0 0 3px rgba(91, 132, 232, .08), inset 0 1px 0 rgba(255, 255, 255, .84);
}
.main-preview-glass.hn-product-detail-tilt .main-preview-img {
    transform: translateZ(9px) scale(1.015);
    transition: transform .4s cubic-bezier(.18, .72, .25, 1);
}
.main-preview-glass.hn-product-detail-tilt.is-spatial-active .main-preview-img {
    transform: translate3d(0, -3px, 18px) scale(1.035);
}

/* Touch devices keep a static depth stack while pointer devices receive live tilt. */
@media (hover: none), (pointer: coarse), (prefers-reduced-motion: reduce) {
    .hn-spatial-card.hn-source-card-3d {
        transform: perspective(1200px) rotateX(.45deg) !important;
        transition: box-shadow .25s ease, border-color .25s ease;
    }
    .store-main .hn-spatial-card.hn-source-card-3d .card-banner-wrap {
        transform: translateZ(9px) !important;
    }
    .store-main .hn-spatial-card.hn-source-card-3d .card-banner-img {
        transform: translateZ(12px) scale(1.025) !important;
        transition: none;
    }
    .hn-source-card-3d .card-body-wrap,
    .hn-source-card-3d .card-title-text,
    .hn-source-card-3d .card-footer-row {
        transform: translateZ(3px) !important;
        transition: none;
    }
    .hn-product-detail-tilt {
        transform: perspective(1250px) rotateX(.3deg) !important;
        transition: box-shadow .25s ease, border-color .25s ease;
    }
    .main-preview-glass.hn-product-detail-tilt .main-preview-img {
        transform: translateZ(7px) scale(1.01);
        transition: none;
    }
}

