/* ==========================================================================
   Product Card Component — 4 Tier Variants
   Normal (default) · VIP · VIP+ · Super VIP
   ========================================================================== */

/* ---------- Base Card ---------- */
.gm-product-card {
    background: var(--gm-bg);
    border-radius: var(--gm-radius);
    overflow: hidden;
    border: 1px solid var(--gm-border);
    transition: border-color var(--gm-transition), box-shadow var(--gm-transition-slow), transform var(--gm-transition);
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
}

/* Ensure Swiper slides stretch to equal heights */
.swiper-slide {
    height: auto;
}

.gm-product-card:hover {
    border-color: var(--gm-border-hover);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.03);
    transform: translateY(-2px);
}

/* ---------- Image ---------- */
.gm-product-card-image {
    display: block;
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--gm-bg-light);
}

.gm-product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.gm-product-card:hover .gm-product-card-image img {
    transform: scale(1.04);
}

/* ---------- Favorite Button ---------- */
.gm-product-card-fav {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gm-text-muted);
    z-index: 2;
    cursor: pointer;
    transition: color var(--gm-transition), background var(--gm-transition), transform var(--gm-transition), opacity var(--gm-transition);
    opacity: 0;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.gm-product-card:hover .gm-product-card-fav,
.gm-product-card-fav.is-active {
    opacity: 1;
}

.gm-product-card-fav:hover {
    color: var(--gm-danger);
    background: #fff;
    transform: scale(1.1);
}

.gm-product-card-fav:active {
    transform: scale(0.92);
}

.gm-product-card-fav.is-active {
    color: var(--gm-danger);
}

/* ---------- Badge (base) ---------- */
.gm-product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    z-index: 1;
    line-height: 1;
    white-space: nowrap;
}

/* ---------- Info ---------- */
.gm-product-card-info {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.gm-product-card-title {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: 0.005em;
    color: var(--gm-text);
    min-height: calc(2 * 1.4 * 0.8125rem);
}

.gm-product-card-title a {
    color: inherit;
    transition: color var(--gm-transition);
}

.gm-product-card-title a:hover {
    color: var(--gm-primary);
}

/* ---------- Price ---------- */
.gm-product-card-price {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--gm-text);
    line-height: 1.3;
    letter-spacing: -0.02em;
    margin-top: 2px;
}

.gm-product-card-currency {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--gm-text-light);
}

.gm-product-card-price--na {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gm-text-muted);
}

/* ---------- Vendor ---------- */
.gm-product-card-vendor {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--gm-text-muted);
    transition: color var(--gm-transition);
    margin-top: auto;
}

.gm-product-card-vendor svg {
    opacity: 0.5;
}

.gm-product-card-vendor:hover {
    color: var(--gm-primary);
}

.gm-product-card-vendor-spacer {
    display: block;
    height: calc(0.75rem * 1.4);
    margin-top: auto;
}


/* ==========================================================================
   TIER 1: Super VIP — Warm gold
   ========================================================================== */
.gm-card--super_vip {
    border-color: rgba(217, 119, 6, 0.2);
    box-shadow: inset 0 1px 0 0 rgba(245, 158, 11, 0.15);
}

.gm-card--super_vip:hover {
    border-color: rgba(217, 119, 6, 0.35);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.1), 0 2px 6px rgba(0, 0, 0, 0.03);
}

.gm-product-badge--super_vip {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
}


/* ==========================================================================
   TIER 2: VIP+ — Cool blue
   ========================================================================== */
.gm-card--vip_plus {
    border-color: rgba(59, 130, 246, 0.18);
    box-shadow: inset 0 1px 0 0 rgba(59, 130, 246, 0.1);
}

.gm-card--vip_plus:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.08), 0 2px 6px rgba(0, 0, 0, 0.03);
}

.gm-product-badge--vip_plus {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
}


/* ==========================================================================
   TIER 3: VIP — Soft teal
   ========================================================================== */
.gm-card--vip {
    border-color: rgba(13, 148, 136, 0.15);
}

.gm-card--vip:hover {
    border-color: rgba(13, 148, 136, 0.25);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.06), 0 2px 6px rgba(0, 0, 0, 0.03);
}

.gm-product-badge--vip {
    background: rgba(13, 148, 136, 0.08);
    color: #0d9488;
    border: 1px solid rgba(13, 148, 136, 0.15);
}


/* ==========================================================================
   TIER 4: Normal — Clean default (no modifier class)
   ========================================================================== */
/* Uses base styles — neutral border, no accent, no badge. */


/* ---------- Mobile ---------- */
@media (max-width: 767px) {
    .gm-product-card-info {
        padding: 12px;
        gap: 4px;
    }

    .gm-product-card-title {
        font-size: 0.8125rem;
        min-height: calc(2 * 1.4 * 0.8125rem);
    }

    .gm-product-card-price {
        font-size: 1rem;
    }

    .gm-product-card-vendor {
        font-size: 0.6875rem;
    }

    .gm-product-badge {
        padding: 5px 11px;
        font-size: 0.6875rem;
        border-radius: 7px;
    }

    /* Make favorite button always visible on touch devices */
    .gm-product-card-fav {
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .gm-product-card-info {
        padding: 10px;
    }

    .gm-product-card-title {
        font-size: 0.75rem;
        min-height: calc(2 * 1.4 * 0.75rem);
    }

    .gm-product-card-price {
        font-size: 0.9375rem;
    }

    .gm-product-badge {
        padding: 4px 9px;
        font-size: 0.625rem;
        border-radius: 6px;
    }

    .gm-product-card-fav {
        width: 28px;
        height: 28px;
        top: 8px;
        right: 8px;
    }

    .gm-product-card-fav svg {
        width: 14px;
        height: 14px;
    }
}
