/* GHome Product Grid - per-product three-device hover animation.
   Uses Swix-compatible product meta keys but scopes frontend styles to the GHome product grid card. */

.ghm-product-card.swix-hpc-enabled-product {
    --swix-hpc-card-shadow: 0 16px 38px rgba(0, 0, 0, 0.14);
    --swix-hpc-min-host-height: 180px;
    --swix-hpc-device-height: 86%;
    overflow: visible;
}

.ghm-product-card.swix-hpc-enabled-product .ghm-product-card__image-wrap,
.ghm-product-card.swix-hpc-enabled-product .ghm-product-card__image-link {
    overflow: visible;
    isolation: isolate;
}

.ghm-product-card.swix-hpc-enabled-product .ghm-product-card__image-link {
    min-height: var(--swix-hpc-min-host-height);
}

.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product {
    transition:
        box-shadow 0.35s ease,
        border-color 0.35s ease,
        transform 0.35s ease;
}

.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product:hover,
.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product.is-swix-touch-hover,
.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product:focus-within {
    border-color: rgba(225, 29, 72, 0.34);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.14);
    transform: none !important;
}

.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product .ghm-product-card__image-link > img:not(.swix-hpc-loop-image__item) {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: none !important;
    filter: none !important;
}

.ghm-product-card.swix-hpc-enabled-product .swix-hpc-loop-image {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: block;
    width: 100%;
    height: 100%;
    min-height: var(--swix-hpc-min-host-height);
    overflow: visible;
    isolation: isolate;
    pointer-events: none;
}

.ghm-product-card.swix-hpc-enabled-product .swix-hpc-loop-image__item {
    position: absolute !important;
    left: 50% !important;
    bottom: 5% !important;
    z-index: 2;
    display: block !important;
    width: auto !important;
    max-width: none !important;
    height: var(--swix-hpc-device-height) !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center bottom !important;
    transform-origin: 50% 78%;
    transition:
        transform 0.44s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.32s ease,
        filter 0.32s ease;
    will-change: transform;
    pointer-events: none !important;
    backface-visibility: hidden;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
}

.ghm-product-card.swix-hpc-enabled-product .swix-hpc-loop-image__item--center {
    z-index: 4;
    opacity: 1;
    transform: translateX(-50%) scale(1.02);
}

.ghm-product-card.swix-hpc-enabled-product .swix-hpc-loop-image__item--left {
    z-index: 3;
    opacity: 0.98;
    transform: translateX(-78%) rotate(-8deg) scale(0.96);
}

.ghm-product-card.swix-hpc-enabled-product .swix-hpc-loop-image__item--right {
    z-index: 3;
    opacity: 0.98;
    transform: translateX(-22%) rotate(8deg) scale(0.96);
}

.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product:hover .swix-hpc-loop-image__item--center,
.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product.is-swix-touch-hover .swix-hpc-loop-image__item--center,
.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product:focus-within .swix-hpc-loop-image__item--center {
    transform: translateX(-50%) translateY(-7px) scale(1.09);
}

.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product:hover .swix-hpc-loop-image__item--left,
.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product.is-swix-touch-hover .swix-hpc-loop-image__item--left,
.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product:hover .swix-hpc-loop-image__item--right,
.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product.is-swix-touch-hover .swix-hpc-loop-image__item--right,
.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product:focus-within .swix-hpc-loop-image__item--left,
.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product:focus-within .swix-hpc-loop-image__item--right {
    opacity: 1;
}

.ghm-product-card.swix-hpc-enabled-product .swix-hpc-intensity-soft .swix-hpc-loop-image__item--center {
    transform: translateX(-50%) scale(1);
}

.ghm-product-card.swix-hpc-enabled-product .swix-hpc-intensity-soft .swix-hpc-loop-image__item--left {
    transform: translateX(-70%) rotate(-5deg) scale(0.96);
}

.ghm-product-card.swix-hpc-enabled-product .swix-hpc-intensity-soft .swix-hpc-loop-image__item--right {
    transform: translateX(-30%) rotate(5deg) scale(0.96);
}

.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product:hover .swix-hpc-intensity-soft .swix-hpc-loop-image__item--left,
.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product.is-swix-touch-hover .swix-hpc-intensity-soft .swix-hpc-loop-image__item--left,
.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product:focus-within .swix-hpc-intensity-soft .swix-hpc-loop-image__item--left {
    transform: translateX(-88%) translateY(-4px) rotate(-10deg) scale(1.03);
}

.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product:hover .swix-hpc-intensity-soft .swix-hpc-loop-image__item--right,
.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product.is-swix-touch-hover .swix-hpc-intensity-soft .swix-hpc-loop-image__item--right,
.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product:focus-within .swix-hpc-intensity-soft .swix-hpc-loop-image__item--right {
    transform: translateX(-12%) translateY(-4px) rotate(10deg) scale(1.03);
}

.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product:hover .swix-hpc-intensity-medium .swix-hpc-loop-image__item--left,
.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product.is-swix-touch-hover .swix-hpc-intensity-medium .swix-hpc-loop-image__item--left,
.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product:focus-within .swix-hpc-intensity-medium .swix-hpc-loop-image__item--left {
    transform: translateX(-103%) translateY(-5px) rotate(-14deg) scale(1.06);
}

.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product:hover .swix-hpc-intensity-medium .swix-hpc-loop-image__item--right,
.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product.is-swix-touch-hover .swix-hpc-intensity-medium .swix-hpc-loop-image__item--right,
.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product:focus-within .swix-hpc-intensity-medium .swix-hpc-loop-image__item--right {
    transform: translateX(3%) translateY(-5px) rotate(14deg) scale(1.06);
}

.ghm-product-card.swix-hpc-enabled-product .swix-hpc-intensity-strong .swix-hpc-loop-image__item--center {
    transform: translateX(-50%) scale(1.04);
}

.ghm-product-card.swix-hpc-enabled-product .swix-hpc-intensity-strong .swix-hpc-loop-image__item--left {
    transform: translateX(-88%) rotate(-11deg) scale(0.98);
}

.ghm-product-card.swix-hpc-enabled-product .swix-hpc-intensity-strong .swix-hpc-loop-image__item--right {
    transform: translateX(-12%) rotate(11deg) scale(0.98);
}

.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product:hover .swix-hpc-intensity-strong .swix-hpc-loop-image__item--left,
.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product.is-swix-touch-hover .swix-hpc-intensity-strong .swix-hpc-loop-image__item--left,
.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product:focus-within .swix-hpc-intensity-strong .swix-hpc-loop-image__item--left {
    transform: translateX(-118%) translateY(-7px) rotate(-17deg) scale(1.08);
}

.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product:hover .swix-hpc-intensity-strong .swix-hpc-loop-image__item--right,
.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product.is-swix-touch-hover .swix-hpc-intensity-strong .swix-hpc-loop-image__item--right,
.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product:focus-within .swix-hpc-intensity-strong .swix-hpc-loop-image__item--right {
    transform: translateX(18%) translateY(-7px) rotate(17deg) scale(1.08);
}

.ghm-product-card.swix-hpc-enabled-product .ghm-product-card__cart {
    left: 50%;
    right: auto;
    bottom: 12px;
    z-index: 80;
    width: auto;
    min-width: 0;
    max-width: calc(100% - 28px);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(8px);
    transition:
        opacity 0.24s ease,
        visibility 0.24s ease,
        transform 0.24s ease;
    pointer-events: none;
}

.ghm-product-card.swix-hpc-enabled-product:hover .ghm-product-card__cart,
.ghm-product-card.swix-hpc-enabled-product.is-swix-touch-hover .ghm-product-card__cart,
.ghm-product-card.swix-hpc-enabled-product:focus-within .ghm-product-card__cart {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart,
.ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 112px;
    max-width: 100%;
    min-height: 34px;
    height: auto;
    padding: 9px 18px;
    margin: 0;
    border: 0;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.88);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.02em;
    text-align: center;
    text-transform: none;
    white-space: nowrap;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: auto;
    transform: none;
    transition:
        background-color 0.22s ease,
        color 0.22s ease,
        box-shadow 0.22s ease,
        transform 0.22s ease;
}

.ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart:hover,
.ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart.button:hover,
.ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart:focus,
.ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart.button:focus {
    background: #111111;
    color: #ffffff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
    transform: translateY(-1px);
    text-decoration: none;
    outline: none;
}

.ghm-product-card.swix-hpc-enabled-product .ghm-product-card__cart-icon {
    display: none;
}

.ghm-product-card.swix-hpc-enabled-product .ghm-product-card__cart-text,
.ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart:hover .ghm-product-card__cart-text,
.ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart:focus .ghm-product-card__cart-text {
    display: inline-block;
    max-width: 160px;
    margin-left: 0;
    opacity: 1;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    text-transform: none;
}

@media (max-width: 768px) {
    .ghm-product-card.swix-hpc-enabled-product {
        --swix-hpc-device-height: 80%;
    }

    .ghm-product-card.swix-hpc-enabled-product .ghm-product-card__cart {
        bottom: 8px;
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%);
        pointer-events: auto;
    }

    .ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart,
    .ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart.button,
    .ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart:hover,
    .ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart.button:hover,
    .ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart:focus,
    .ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart.button:focus {
        width: auto;
        min-width: 96px;
        max-width: 100%;
        min-height: 32px;
        height: auto;
        padding: 8px 14px;
        font-size: 11px;
        transform: none;
    }

    .ghm-product-card.swix-hpc-enabled-product .ghm-product-card__cart-text,
    .ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart:hover .ghm-product-card__cart-text,
    .ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart:focus .ghm-product-card__cart-text {
        max-width: 126px;
        margin-left: 0;
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ghm-product-card.swix-hpc-enabled-product,
    .ghm-product-card.swix-hpc-enabled-product .swix-hpc-loop-image__item,
    .ghm-product-card.swix-hpc-enabled-product .ghm-product-card__cart,
    .ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart {
        animation: none !important;
        transition: none !important;
    }
}

/* Keep server-rendered fallback clean before the small frontend script marks cards ready. */
.ghm-product-card.swix-hpc-enabled-product .swix-hpc-loop-image {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product .swix-hpc-loop-image {
    opacity: 1;
}

.ghm-product-card.swix-hpc-enabled-product .ghm-product-card__sale-badge {
    z-index: 90;
}

@media (prefers-reduced-motion: reduce) {
    .ghm-product-card.swix-hpc-enabled-product .swix-hpc-loop-image {
        transition: none !important;
    }
}

/* v2.5.45: Product Grid Hover - make the Swix three-device card blend with the refined card UI. */
.ghm-product-card.swix-hpc-enabled-product {
    --swix-hpc-card-shadow: 0 22px 54px rgba(15, 23, 42, 0.12);
    --swix-hpc-min-host-height: clamp(178px, 18vw, 260px);
    --swix-hpc-device-height: 82%;
}

.ghm-product-card.swix-hpc-enabled-product .ghm-product-card__image-wrap {
    overflow: visible;
    background:
        radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.96) 46%, rgba(241, 245, 249, 0.88) 100%);
}

.ghm-product-card.swix-hpc-enabled-product .ghm-product-card__image-link {
    border-radius: inherit;
    background: transparent;
}

.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product:hover,
.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product.is-swix-touch-hover,
.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product:focus-within {
    border-color: rgba(225, 29, 72, 0.3);
    box-shadow: var(--swix-hpc-card-shadow);
    filter: saturate(1.02);
}

.ghm-product-card.swix-hpc-enabled-product .swix-hpc-loop-image::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 10%;
    z-index: 1;
    width: 58%;
    height: 12%;
    border-radius: 999px;
    background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.14), rgba(15, 23, 42, 0.05) 46%, rgba(15, 23, 42, 0) 72%);
    transform: translateX(-50%);
    opacity: 0.78;
    filter: blur(6px);
    transition: opacity 0.32s ease, width 0.42s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product:hover .swix-hpc-loop-image::before,
.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product.is-swix-touch-hover .swix-hpc-loop-image::before,
.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product:focus-within .swix-hpc-loop-image::before {
    width: 74%;
    opacity: 0.92;
}

.ghm-product-card.swix-hpc-enabled-product .swix-hpc-loop-image__item {
    filter: drop-shadow(0 16px 22px rgba(15, 23, 42, 0.1));
    transition:
        transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.34s ease,
        filter 0.34s ease;
}

.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product:hover .swix-hpc-loop-image__item,
.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product.is-swix-touch-hover .swix-hpc-loop-image__item,
.ghm-product-card.swix-hpc-ready.swix-hpc-enabled-product:focus-within .swix-hpc-loop-image__item {
    filter: drop-shadow(0 21px 28px rgba(15, 23, 42, 0.14));
}

.ghm-product-card.swix-hpc-enabled-product .ghm-product-card__cart {
    bottom: 16px;
    max-width: calc(100% - 32px);
    transform: translateX(-50%) translateY(8px) scale(0.98);
}

.ghm-product-card.swix-hpc-enabled-product:hover .ghm-product-card__cart,
.ghm-product-card.swix-hpc-enabled-product.is-swix-touch-hover .ghm-product-card__cart,
.ghm-product-card.swix-hpc-enabled-product:focus-within .ghm-product-card__cart {
    transform: translateX(-50%) translateY(0) scale(1);
}

.ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart,
.ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart.button {
    min-width: 124px;
    min-height: 36px;
    padding: 9px 18px;
    border-radius: 999px;
    background: rgba(7, 11, 18, 0.92);
    box-shadow: 0 12px 24px rgba(7, 11, 18, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart:hover,
.ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart.button:hover,
.ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart:focus,
.ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart.button:focus {
    background: #e11d48;
    box-shadow: 0 16px 30px rgba(225, 29, 72, 0.28);
    transform: translateY(-1px);
}

.ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart:active,
.ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart.button:active {
    transform: translateY(0) scale(0.985);
}

@media (max-width: 768px) {
    .ghm-product-card.swix-hpc-enabled-product {
        --swix-hpc-min-host-height: clamp(150px, 42vw, 230px);
        --swix-hpc-device-height: 78%;
    }

    .ghm-product-card.swix-hpc-enabled-product .ghm-product-card__cart {
        bottom: 10px;
    }

    .ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart,
    .ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart.button,
    .ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart:hover,
    .ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart.button:hover,
    .ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart:focus,
    .ghm-product-card.swix-hpc-enabled-product .ghm-product-card__add-to-cart.button:focus {
        min-width: 92px;
        min-height: 32px;
        padding: 8px 13px;
        font-size: 10px;
    }
}
