/* Shared product-card presentation for shop, home, and single-product modules. */
.gnis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
    gap: 18px;
}

.gnis-card-shortcode .gnis-grid {
    grid-template-columns: repeat(var(--gnis-card-columns, auto-fill), minmax(235px, 1fr));
}

.gnis-card,
.gnis-card *,
.gnis-card *::before,
.gnis-card *::after {
    box-sizing: border-box;
}

.gnis-card {
    display: grid;
    grid-template-rows: 210px minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 405px;
    overflow: hidden;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 10px;
    background: #fff;
    color: var(--ink, #111827);
    box-shadow: 0 12px 26px rgba(15, 23, 42, .045);
}

.gnis-card-media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 18px;
    overflow: hidden;
    background: #fff;
    color: inherit;
    text-decoration: none;
}

.gnis-card-media img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.gnis-quick-button {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    transform: translateY(8px);
    opacity: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(17, 24, 39, .88);
    color: #fff;
    cursor: pointer;
    transition: opacity .18s ease, transform .18s ease, background .18s ease, color .18s ease;
}

.gnis-quick-button svg,
.gnis-heart svg,
.gnis-quick-mobile svg,
.gnis-add svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gnis-card:hover .gnis-quick-button,
.gnis-quick-button:focus-visible {
    opacity: 1;
    transform: translateY(0);
}

.gnis-sale,
.gnis-sale-percent {
    position: absolute;
    left: 14px;
    z-index: 2;
    font-weight: 700;
    line-height: 1;
}

.gnis-sale {
    top: 14px;
    padding: 7px 10px;
    border-radius: 6px;
    background: var(--red, #ffd200);
    color: var(--ink, #111827);
    font-size: 12px;
    text-transform: uppercase;
}

.gnis-sale-percent {
    top: 48px;
    padding: 6px 9px;
    border-radius: 999px;
    background: var(--gnis-sale-percent, #dc2626);
    color: #fff;
    font-size: 11px;
}

.gnis-card-info {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 0 16px 14px;
}

.gnis-stock {
    align-self: flex-start;
    max-width: 100%;
    margin-bottom: 10px;
    padding: 4px 9px;
    overflow: hidden;
    border: 1px solid #b8ebca;
    border-radius: 999px;
    background: #f0fff5;
    color: var(--green, #15803d);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gnis-stock--pickup {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #15803d;
}

.gnis-stock--incoming {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #c2410c;
}

.gnis-stock--preorder {
    border-color: #fde68a;
    background: #fffbeb;
    color: #a16207;
}

.gnis-stock--out {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.gnis-card h2 {
    display: -webkit-box;
    min-height: 54px;
    margin: 0 0 10px;
    overflow: hidden;
    color: var(--ink, #111827);
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
    letter-spacing: 0 !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.gnis-card h2 a {
    color: inherit;
    text-decoration: none;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.gnis-card h2 a:hover {
    text-decoration: underline;
}

.gnis-stars {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: auto;
    color: #fb923c;
    font-size: 16px;
    letter-spacing: 0;
    text-decoration: none;
    white-space: nowrap;
}

.gnis-stars small {
    color: #475569;
    font-size: 12px;
}

.gnis-card-buy {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 9px;
    align-items: center;
    min-width: 0;
    padding: 13px 14px;
    border-top: 1px solid #eef0f2;
}

.gnis-price {
    grid-column: 1 / -1;
    min-width: 0;
    color: #020617;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
}

.gnis-price-prefix {
    font-size: .62em;
    font-weight: 600;
}

.gnis-price del {
    display: block;
    color: var(--gnis-old-price, #dc2626);
    font-size: 13px;
    font-weight: 500;
}

.gnis-price ins {
    text-decoration: none;
}

.gnis-add,
.gnis-heart,
.gnis-quick-mobile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border-radius: 8px;
    text-decoration: none;
}

.gnis-add {
    width: 100%;
    min-width: 0;
    gap: 7px;
    padding: 0 10px;
    overflow: hidden;
    border: 0;
    background: var(--cta, #1f1915);
    color: #fff !important;
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
    transition: background .16s ease, color .16s ease;
}

.gnis-add span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gnis-add:hover {
    background: var(--red, #ffd200);
    color: var(--ink, #111827) !important;
}

.gnis-heart,
.gnis-quick-mobile {
    width: 42px;
    padding: 0;
    border: 1px solid var(--line, #e2e8f0);
    background: #fff;
    color: #111827;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}

.gnis-quick-mobile {
    display: none;
}

.gnis-heart:hover,
.gnis-quick-mobile:hover {
    transform: translateY(-1px);
    border-color: var(--red, #ffd200);
    background: #fff9d9;
    color: var(--ink, #111827);
}

.gnis-heart.is-active,
.gnis-heart[aria-pressed="true"] {
    border-color: var(--red, #ffd200);
    background: #fff9d9;
    color: #dc2626;
}

.gnis-heart.is-active svg,
.gnis-heart[aria-pressed="true"] svg {
    fill: currentColor;
}

@media (max-width: 1200px) {
    .gnis-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 900px) {
    .gnis-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .gnis-card {
        grid-template-columns: 104px minmax(0, 1fr);
        grid-template-rows: auto auto;
        min-height: 138px;
    }

    .gnis-card-media {
        grid-row: 1 / 3;
        height: 138px;
        padding: 10px;
    }

    .gnis-quick-button {
        display: none;
    }

    .gnis-sale {
        left: 8px;
        top: 8px;
        padding: 5px 7px;
        font-size: 10px;
    }

    .gnis-sale-percent {
        left: 8px;
        top: 34px;
        padding: 4px 6px;
        font-size: 9px;
    }

    .gnis-card-info {
        padding: 10px 10px 6px;
    }

    .gnis-stock {
        margin-bottom: 6px;
        padding: 3px 7px;
        font-size: 10px;
    }

    .gnis-card h2 {
        min-height: 0;
        margin-bottom: 6px;
        font-size: 13px !important;
        line-height: 1.24 !important;
        -webkit-line-clamp: 2;
    }

    .gnis-stars {
        gap: 5px;
        font-size: 13px;
    }

    .gnis-stars small {
        font-size: 11px;
    }

    .gnis-card-buy {
        grid-column: 2;
        grid-template-columns: minmax(0, 1fr) 36px 36px;
        gap: 7px;
        padding: 0 10px 10px;
        border-top: 0;
    }

    .gnis-price {
        font-size: 17px;
    }

    .gnis-price del {
        font-size: 11px;
    }

    .gnis-add {
        min-height: 34px;
        padding: 0 8px;
        border-radius: 7px;
        font-size: 12px;
    }

    .gnis-heart,
    .gnis-quick-mobile {
        width: 36px;
        min-height: 34px;
        border-radius: 7px;
    }

    .gnis-quick-mobile {
        display: inline-flex;
    }
}
