/**
 * Product cards — premium dark/blue storefront.
 * Scoped to .govee-product-card. Uses tokens from govee-tokens.css.
 */

.govee-product-card {
    background: var(--govee-card) !important;
    border: 1px solid var(--govee-border);
    border-radius: var(--govee-radius-lg);
    box-shadow: none;
    color: var(--govee-text);
    font-family: var(--govee-font-sans);
    isolation: isolate;
    overflow: hidden;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
    width: 100%;
}

.govee-product-card:hover {
    border-color: rgba(24, 200, 255, 0.35);
    box-shadow: var(--govee-shadow-elevated);
}

/* Neutralize Bagisto desktop “lift” panel that assumed a white info strip */
@media (min-width: 1180px) {
    .govee-product-card:not(.govee-product-card--list) {
        display: grid;
        grid-template-rows: auto 1fr;
    }
}

/* ---- Media / image ---- */
.govee-product-card__media {
    background: var(--govee-bg-deep) !important;
    border-radius: 0 !important;
    max-height: none !important;
    max-width: 100% !important;
    width: 100%;
}

.govee-product-card__media > a {
    display: block;
}

.govee-product-card__image,
.govee-product-card__image.bg-zinc-100 {
    background: var(--govee-bg-deep) !important;
    border-radius: 0 !important;
}

.govee-product-card__image img {
    object-fit: contain;
}

/* ---- Badges ---- */
.govee-product-card__badge {
    border: 1px solid rgba(24, 200, 255, 0.35) !important;
    border-radius: var(--govee-radius-pill) !important;
    font-size: var(--govee-text-badge) !important;
    font-weight: var(--govee-weight-semibold) !important;
    letter-spacing: var(--govee-tracking-label);
    padding: 0.35rem 0.85rem !important;
}

.govee-product-card__badge--sale {
    background: linear-gradient(90deg, rgba(24, 200, 255, 0.2), rgba(122, 92, 255, 0.28)) !important;
    color: var(--govee-text) !important;
}

.govee-product-card__badge--new {
    background: rgba(24, 200, 255, 0.12) !important;
    color: var(--govee-cyan) !important;
}

/* ---- Overlay icon buttons (mobile wishlist / compare) ---- */
.govee-product-card__media-actions {
    opacity: 1 !important;
}

.govee-product-card__icon-btn {
    background: var(--govee-card) !important;
    border: 1px solid rgba(24, 200, 255, 0.45) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    color: var(--govee-text) !important;
    z-index: 3;
}

.govee-product-card__icon-btn.icon-heart-fill,
.govee-product-card__icon-btn.text-red-500,
.govee-product-card__icon-btn.text-red-600 {
    color: #ff6b8a !important;
}

.govee-product-card__icon-btn::before {
    color: inherit;
}

/* Ratings chip on image */
.govee-product-card__media .bg-white\/80,
.govee-product-card__media [class*="bg-white"] {
    background: rgba(12, 23, 40, 0.88) !important;
    border-color: var(--govee-border) !important;
    color: var(--govee-muted) !important;
}

/* ---- Body / copy ---- */
.govee-product-card__body {
    background: var(--govee-card) !important;
    color: var(--govee-text);
    max-width: 100% !important;
    /* Kill Bagisto hover-slide that assumed white overlay */
    margin-top: 0 !important;
    padding: var(--govee-space-6) !important;
    transform: none !important;
    translate: none;
}

.govee-product-card:hover .govee-product-card__body,
.govee-product-card.group:hover .govee-product-card__body {
    border-radius: 0 !important;
    transform: none !important;
}

.govee-product-card__name {
    color: var(--govee-text) !important;
    font-size: var(--govee-text-meta);
    font-weight: var(--govee-weight-medium);
    line-height: var(--govee-leading-snug);
    margin: 0;
    max-width: 100% !important;
}

/* ---- Price (Bagisto price_html: .final-price + optional sale sibling) ---- */
.govee-product-card__price {
    color: var(--govee-text);
    font-size: var(--govee-text-base) !important;
}

.govee-product-card__price p {
    margin: 0;
}

.govee-product-card__price .final-price.line-through,
.govee-product-card__price p.line-through,
.govee-product-card__price .final-price.text-zinc-500 {
    color: var(--govee-muted) !important;
    font-weight: var(--govee-weight-regular) !important;
}

.govee-product-card__price p.font-semibold:not(.line-through) {
    background: linear-gradient(90deg, var(--govee-cyan), var(--govee-violet));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    font-weight: var(--govee-weight-bold) !important;
}

/* ---- Actions (cart / wishlist / compare) ---- */
.govee-product-card__actions {
    display: flex !important;
    gap: var(--govee-space-3);
    opacity: 1 !important; /* always visible on dark cards */
}

.govee-product-card__cart.secondary-button,
.govee-product-card__cart {
    align-items: center;
    background: linear-gradient(90deg, var(--govee-cyan), var(--govee-violet)) !important;
    border: none !important;
    border-radius: var(--govee-radius-pill) !important;
    color: var(--govee-bg) !important;
    display: inline-flex !important;
    font-weight: var(--govee-weight-bold) !important;
    justify-content: center;
    transition: opacity 0.15s ease, filter 0.15s ease;
}

.govee-product-card__cart-icon {
    color: var(--govee-bg) !important;
    display: none;
    font-size: 1.25rem;
    line-height: 1;
}

.govee-product-card__cart-label {
    display: inline;
}

.govee-product-card__cart:hover:not(:disabled),
.govee-product-card__cart:focus-visible:not(:disabled) {
    filter: brightness(1.06);
    opacity: 1;
}

.govee-product-card__cart:disabled {
    filter: grayscale(0.35);
    opacity: 0.55;
}

.govee-product-card__actions .icon-heart,
.govee-product-card__actions .icon-heart-fill,
.govee-product-card__actions .icon-compare {
    color: var(--govee-muted) !important;
    transition: color 0.15s ease;
}

.govee-product-card__actions .icon-heart:hover,
.govee-product-card__actions .icon-compare:hover {
    color: var(--govee-cyan) !important;
}

.govee-product-card__actions .icon-heart-fill,
.govee-product-card__actions .text-red-600 {
    color: #ff6b8a !important;
}

.govee-product-card [data-testid="product-card-out-of-stock"] {
    color: #ff8a9b !important;
}

/* ---- List mode ---- */
.govee-product-card--list {
    align-items: stretch;
    background: var(--govee-card) !important;
    max-width: 100% !important;
    padding: var(--govee-space-6);
}

.govee-product-card--list .govee-product-card__media {
    border-radius: var(--govee-radius-md) !important;
    max-height: 258px !important;
    max-width: 250px !important;
    overflow: hidden;
}

.govee-product-card--list .govee-product-card__body {
    background: transparent !important;
    gap: var(--govee-space-6) !important;
    padding: 0 !important;
}

.govee-product-card--list .govee-product-card__name {
    font-size: var(--govee-text-base);
}

.govee-product-card--list .text-zinc-500 {
    color: var(--govee-muted) !important;
}

.govee-product-card--list .govee-product-card__actions {
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-top: var(--govee-space-2);
    opacity: 1 !important;
}

/* List cart: same gradient language, larger pill for the wider layout */
.govee-product-card--list .govee-product-card__cart,
.govee-product-card--list .govee-product-card__cart--list {
    background: linear-gradient(90deg, var(--govee-cyan), var(--govee-violet)) !important;
    border: none !important;
    border-radius: var(--govee-radius-pill) !important;
    color: var(--govee-bg) !important;
    max-width: max-content;
    min-height: 2.75rem;
    padding-inline: 2rem !important;
    width: auto;
}

.govee-product-card--list .govee-product-card__cart-label {
    display: inline !important;
    position: static !important;
    clip: auto !important;
    height: auto !important;
    width: auto !important;
    margin: 0 !important;
    overflow: visible !important;
    white-space: nowrap !important;
}

.govee-product-card--list .govee-product-card__cart-icon {
    display: none !important;
}

.govee-product-card--list .govee-product-card__actions .icon-heart,
.govee-product-card--list .govee-product-card__actions .icon-heart-fill,
.govee-product-card--list .govee-product-card__actions .icon-compare {
    color: var(--govee-muted) !important;
}

.govee-product-card--list .govee-product-card__actions .icon-heart:hover,
.govee-product-card--list .govee-product-card__actions .icon-compare:hover {
    color: var(--govee-cyan) !important;
}

/* ---- Compact / mobile tweaks ---- */
@media (max-width: 767px) {
    .govee-product-card:not(.govee-product-card--list) .govee-product-card__body {
        padding: var(--govee-space-4) !important;
    }

    .govee-product-card__name {
        font-size: var(--govee-text-sm);
    }

    .govee-product-card__price {
        font-size: var(--govee-text-sm) !important;
    }

    /* Icon-only cart: fits 2-col grid without crowding */
    .govee-product-card__actions {
        margin-top: var(--govee-space-3);
    }

    .govee-product-card__cart {
        min-height: 2.5rem;
        padding: 0.5rem !important;
        width: 100%;
    }

    .govee-product-card__cart-icon {
        display: inline-block !important;
    }

    .govee-product-card__cart-label {
        border: 0 !important;
        clip: rect(0, 0, 0, 0) !important;
        height: 1px !important;
        margin: -1px !important;
        overflow: hidden !important;
        padding: 0 !important;
        position: absolute !important;
        white-space: nowrap !important;
        width: 1px !important;
    }

    .govee-product-card__icon-btn {
        height: 2rem !important;
        width: 2rem !important;
    }
}
