/* Default Grid Layout */
.ebay-game-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(120px, 40%, 250px), 1fr)); /* Adjusts to very small screens */
    gap: clamp(8px, 2vw, 15px); /* Flexible spacing for small to large devices */
    justify-content: center;
    align-items: stretch;
    padding: clamp(10px, 4vw, 20px); /* Dynamic padding */
}

/* Default Card Styles */
.game-card {
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(8px, 1.5vw, 15px); /* Adaptive padding */
    max-width: 100%;
    cursor: pointer;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Card Image */
.game-card-image {
    position: relative;
    overflow: hidden;
    height: clamp(100px, 20vw, 180px); /* Dynamic image height */
    width: 100%;
}

.game-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-bottom: 1px solid var(--light-gray);
}

/* Card Content */
.game-card-content {
    padding: clamp(8px, 2vw, 15px);
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: clamp(5px, 1vw, 10px);
}

/* Card Content Details */
.game-title {
    font-size: clamp(0.8rem, 2vw, 1rem); /* Scales title size dynamically */
    font-weight: bold;
    color: var(--text-color);
}

.game-price,
.game-price-mwk,
.game-condition,
.seller-info {
    font-size: clamp(0.7rem, 1.5vw, 0.9rem); /* Adaptive font size */
    color: var(--gray);
}

/* Buy Button */
.buy-button {
    display: inline-block;
    padding: clamp(5px, 1.5vw, 8px) clamp(10px, 2vw, 12px);
    background: var(--secondary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 5px;
    font-size: clamp(0.7rem, 1.5vw, 0.9rem);
    font-weight: bold;
    text-align: center;
    margin-top: clamp(5px, 2vw, 10px);
    transition: background 0.3s ease, transform 0.3s ease;
}

.buy-button:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.order-button {
    display: inline-block;
    padding: 10px 20px;
    margin-top: 10px;
    font-size: clamp(14px, 2vw, 16px); /* Responsive font size */
    font-weight: 600; /* Slightly lighter for a cleaner look */
    color: #ffffff;
    background-color: #0078d7; /* Calmer blue tone */
    border: none;
    border-radius: 8px; /* Softer rounded corners */
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.order-button:hover {
    background-color: #005ea5; /* Darker blue on hover */
    transform: translateY(-2px); /* Slight lift effect */
}

.order-button:active {
    background-color: #003d73; /* Darkest blue for active state */
    transform: translateY(0); /* Reset transform */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Adjustments for smaller screens */
@media (max-width: 480px) {
    .order-button {
        padding: 8px 16px; /* Reduce padding */
        font-size: clamp(12px, 3vw, 14px); /* Smaller font size */
        border-radius: 6px; /* Adjust corner rounding */
    }
}



/* Specific Layout for Ultra-Small Screens (below 320px) */
@media (max-width: 320px) {
    .ebay-game-cards-grid {
        display: block; /* Switch to a single-column list layout */
        padding: 5px; /* Minimal padding */
    }

    .game-card {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 10px; /* Reduced gap for smaller spacing */
        padding: 10px;
        margin-bottom: 10px;
    }

    .game-card-image {
        height: 80px; /* Compact image for small screens */
        width: 80px;
        border-radius: 6px;
        flex-shrink: 0;
    }

    .game-card-content {
        flex: 1;
        padding: 0;
        gap: 5px;
    }

    .game-title {
        font-size: 0.7rem; /* Adjust title size */
        margin: 0;
    }

    .game-price,
    .game-condition,
    .seller-info {
        font-size: 0.6rem; /* Compact text size */
    }

    .buy-button {
        font-size: 0.6rem;
        padding: 5px 8px;
        border-radius: 4px;
    }
}
