/* =====================================================
   Shared GameCard (ProductFilter, NewHome, ProductDetails Upsell)
   Single source of truth: dimensions only here. No width/height on .gamecard in page CSS.
   ===================================================== */

.gamecard {
    width: 100%;
    height: 100%;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    background: rgba(19, 46, 85, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1.25rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
}

.gamecard:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

/* Image area: fixed-height wrapper; full image visible with blurred fill behind. */
.card-image-link {
    display: block;
    overflow: hidden;
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    height: 16rem;
    overflow: hidden;
    border-radius: 1.25rem 1.25rem 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0b1320;
}

/* BLURRED BACKGROUND FILL */
.card-image-wrapper::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--card-bg);
    background-size: cover;
    background-position: center;
    filter: blur(30px);
    transform: scale(1.3);
    opacity: 0.65;
    z-index: 1;
}

/* MAIN IMAGE */
.card-image-wrapper img {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.35s ease;
}

/* Subtle overlay for readability */
.card-image-wrapper::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.1),
        rgba(0, 0, 0, 0.5)
    );
    z-index: 1;
}

.cardimg {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}

/* Professional hover animation (Steam-style) */
.gamecard:hover img {
    transform: scale(1.06);
}

.cardcontent {
    background: linear-gradient(0deg, rgba(10, 25, 47, 0.95) 0%, rgba(10, 25, 47, 0.8) 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    flex-grow: 1;
    position: relative;
    z-index: 2;
    padding: 1rem;
    gap: 8px;
    overflow: visible;
}

.cardcontent-disabled {
    background: linear-gradient(0deg, rgba(80, 80, 80, 0.95) 0%, rgba(50, 50, 50, 0.8) 100%);
    filter: grayscale(100%);
}

.cardcontent > a,
.cardcontent > button {
    margin-top: 0;
    text-align: center;
    padding: 0;
    text-decoration: none;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-width: 0;
}

.cardcontent > a {
    text-decoration: none;
}

.cardcontent > button {
    border: 0;
    background: transparent;
}

/* Unified title styling for both button and anchor variants (identical layout across sections) */
.cardcontent > a > p,
.cardcontent > button > p {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    min-height: 2.6em;
    margin-top: 8px;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ffffff !important;
}

.card-title,
.card-title-text {
    min-height: 2.6em;
}

/* صف المنصة: مسافة بين النص والأيقونة + هامش تحت العنوان */
.cardcontent > a > div,
.cardcontent > button > div {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 6px;
    flex-wrap: nowrap;
}

.cardcontent > a > div > p,
.cardcontent > button > div > p {
    font-size: 0.85rem;
    color: #adb5bd !important;
    margin: 0;
    font-weight: 500;
    width: auto !important;
    padding: 0 !important;
    flex-shrink: 1;
}

.cardcontent > a > div > img,
.cardcontent > button > div > img {
    width: 20px;
    height: 20px;
    min-width: 20px;
    object-fit: contain;
    margin: 0;
    flex-shrink: 0;
    padding: 0 !important;
    box-sizing: content-box;
}

/* Price bar: full-width to card edges, anchored to bottom */
.card-price-bar {
    margin-top: auto;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Width + negative margins: bar content box extends to card edges so background fills both sides */
    width: calc(100% + 2rem);
    margin-left: -1rem;
    margin-right: -1rem;
    margin-bottom: -1rem;
    min-width: 0;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(
        to bottom,
        rgba(5, 20, 40, 0.85),
        rgba(5, 20, 40, 1)
    );
    backdrop-filter: blur(6px);
    border-radius: 0 0 18px 18px;
}

.card-price-bar > * {
    flex-shrink: 0;
}

.card-price-bar .cardprice {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 0.4rem;
}

.cardprice {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
}

.cardprice > p {
    font-size: 1.2rem;
    color: #fb8e31;
    font-weight: 800;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1;
    white-space: nowrap;
}

.cardprice > del {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 4px;
}

.card-Cart-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fb8e31 0%, #f59e0b 100%);
    border: none;
    border-radius: 0.75rem;
    color: #fff;
    padding: 0.75rem;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(251, 142, 49, 0.3);
}

.card-Cart-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(251, 142, 49, 0.5);
    background: linear-gradient(135deg, #f59e0b 0%, #fb8e31 100%);
}

.card-Cart-button:disabled {
    background: #656565;
    box-shadow: none;
    cursor: not-allowed;
}

.card-Cart-button > i {
    font-size: 1.5rem;
}

/* Mobile: single breakpoint for image area height. No overrides in page CSS. */
@media (max-width: 576px) {
    .card-image-wrapper {
        height: 13rem;
    }
}

/* Variant: card with ScarcityAssistant (ProductDetails Upsell). Must not clip the badge. */
.gamecard-with-assistant {
    position: relative;
    overflow: visible;
}
