/* ==========================================================================
   PKMN Card — Composed HTML/CSS product card
   ========================================================================== */

.pkmn-card {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pkmn-card:hover {
    transform: translateY(-2px);
}

/* Single product context — square, no hover, pokemon at bottom */
.pkmn-card--single {
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    margin: 0 auto;
}

.pkmn-card--single:hover {
    transform: none;
}

.pkmn-card--single .pkmn-card__pokemon {
    align-items: flex-end;
    justify-content: center;
    padding: 4% 8% 0;
}

.pkmn-card--single .pkmn-card__pokemon-img {
    max-height: 85%;
}

/* ---------- Background layer ---------- */

.pkmn-card__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.pkmn-card__bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
}

/* When there's a custom background, keep a dark base behind the semi-transparent image */
.pkmn-card--has-bg {
    background: #1a1a2e;
}

/* ---------- Pokemon image layer ---------- */

.pkmn-card__pokemon {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8%;
}

.pkmn-card__pokemon-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

/* ---------- Overlay badges layer ---------- */

.pkmn-card__overlays {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

/* Type icons — top left */
.pkmn-card__types {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    gap: 4px;
}

.pkmn-card__type-icon {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

/* Shiny badge — top right */
.pkmn-card__shiny {
    position: absolute;
    top: 8px;
    right: 8px;
}

.pkmn-card__shiny img {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 1px 3px rgba(255, 215, 0, 0.6));
}

/* Form badge — bottom left */
.pkmn-card__form {
    position: absolute;
    bottom: 36px;
    left: 8px;
    display: flex;
    gap: 4px;
}

.pkmn-card__form-icon {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

/* Purified badge — bottom left, below form */
.pkmn-card__purified {
    position: absolute;
    bottom: 8px;
    left: 8px;
}

.pkmn-card__purified img {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

/* Meta (gender + size) — bottom right */
.pkmn-card__meta {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.pkmn-card__gender {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.pkmn-card__size {
    font-size: 11px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
    letter-spacing: 0.5px;
}

/* Size color variants */
.pkmn-card__size--xxs {
    background: rgba(54, 162, 235, 0.7);
}

.pkmn-card__size--xs {
    background: rgba(75, 192, 192, 0.7);
}

.pkmn-card__size--xl {
    background: rgba(255, 159, 64, 0.7);
}

.pkmn-card__size--xxl {
    background: rgba(255, 99, 132, 0.7);
}

/* ---------- Loop context: hide type/forme overlays (shown in info area) ---------- */

.pkmn-card--loop .pkmn-card__types,
.pkmn-card--loop .pkmn-card__form {
    display: none;
}

/* ---------- Responsive adjustments ---------- */

@media (max-width: 480px) {
    .pkmn-card__type-icon {
        width: 20px;
        height: 20px;
    }

    .pkmn-card__shiny img,
    .pkmn-card__purified img {
        width: 20px;
        height: 20px;
    }

    .pkmn-card__form-icon {
        width: 24px;
        height: 24px;
    }

    .pkmn-card__size {
        font-size: 10px;
    }
}
