/*
 * Ganjeh Kala — reusable product card component.
 * Shared by shop/archive, wishlist and any loop using woocommerce/content-product.php.
 */

.gk-product-card {
    --gk-pc-primary: var(--gk-archive-primary, var(--gk-primary, #3b82f6));
    --gk-pc-primary-soft: var(--gk-archive-primary-2, color-mix(in srgb, var(--gk-pc-primary) 10%, #fff));
    --gk-pc-text: var(--gk-archive-text, var(--gk-text, #111827));
    --gk-pc-muted: var(--gk-archive-muted, var(--gk-text-muted, #6b7280));
    --gk-pc-border: var(--gk-archive-border, var(--gk-border-color, #e5e7eb));
    --gk-pc-card: var(--gk-archive-card, var(--gk-surface, #fff));
    --gk-pc-soft: var(--gk-archive-soft, #f7f8fa);
    --gk-pc-success: var(--gk-archive-success, #168447);
    --gk-pc-warning: var(--gk-archive-warning, #b76505);
    --gk-pc-danger: var(--gk-archive-danger, #d6364f);
    min-width: 0;
}

.gk-product-card__inner {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 12px;
    border: 1px solid var(--gk-pc-border);
    border-radius: 22px;
    background: var(--gk-pc-card);
    box-shadow: 0 8px 22px rgba(15, 23, 42, .04);
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.gk-product-card__inner:hover {
    transform: translateY(-3px);
    border-color: rgba(37, 99, 235, .22);
    box-shadow: 0 18px 40px rgba(15, 23, 42, .09);
}

.gk-product-card__badges {
    position: absolute;
    z-index: 4;
    top: 10px;
    right: 10px;
    left: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    pointer-events: none;
}

.gk-product-card__discount,
.gk-product-card__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(239, 64, 86, .22);
}

.gk-product-card__discount {
    background: var(--gk-pc-danger);
}

.gk-product-card__badge {
    margin-inline-start: auto;
}

.gk-product-card__badge--sale {
    background: var(--gk-pc-danger);
}

.gk-product-card__badge--dark {
    background: #1f2937;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .18);
}

.gk-product-card__thumb {
    position: relative;
    display: block;
    height: auto !important;
    aspect-ratio: 1 / 1;
    margin-bottom: 10px;
    border-radius: var(--gk-product-image-radius, var(--gk-image-radius, 18px));
    background: transparent !important;
    overflow: hidden;
    isolation: isolate;
}

.gk-product-card__thumb::before,
.gk-product-card__image-wrap::before,
.gk-product-card__image-wrap::after {
    content: none !important;
    display: none !important;
}

.gk-product-card__image-wrap {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    padding: 0 !important;
    border-radius: inherit;
    overflow: hidden;
    background: transparent !important;
}

.gk-product-card__image,
.gk-product-card__thumb img {
    position: absolute !important;
    inset: 0 !important;
    display: block;
    width: 100% !important;
    height: 100% !important;
    min-width: 100%;
    min-height: 100%;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center center !important;
    border-radius: inherit !important;
    background: transparent !important;
    transform-origin: center center;
    backface-visibility: hidden;
    transition: opacity .22s ease;
}

.gk-product-card__image--main {
    z-index: 1;
    opacity: 1 !important;
    transform: none !important;
}

.gk-product-card__image--hover {
    z-index: 2;
    opacity: 0 !important;
    transform: none !important;
    pointer-events: none;
}

.gk-product-card__inner:not(.gk-product-card__inner--has-hover):hover .gk-product-card__image--main,
.gk-product-card__inner:not(.gk-product-card__inner--has-hover):focus-within .gk-product-card__image--main {
    opacity: 1 !important;
    transform: none !important;
}

.gk-product-card__inner.gk-product-card__inner--has-hover:hover .gk-product-card__image--main,
.gk-product-card__inner.gk-product-card__inner--has-hover:focus-within .gk-product-card__image--main {
    opacity: 0 !important;
    transform: none !important;
}

.gk-product-card__inner.gk-product-card__inner--has-hover:hover .gk-product-card__image--hover,
.gk-product-card__inner.gk-product-card__inner--has-hover:focus-within .gk-product-card__image--hover {
    opacity: 1 !important;
    transform: none !important;
}

@media (hover: none), (pointer: coarse) {
    .gk-product-card__image--main {
        opacity: 1 !important;
        transform: none !important;
    }

    .gk-product-card__image--hover {
        display: none !important;
    }
}

.gk-product-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 24px;
    margin-bottom: 7px;
}

.gk-product-card__brand {
    display: inline-flex;
    align-items: center;
    max-width: 60%;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--gk-pc-soft);
    color: var(--gk-pc-muted);
    font-size: 11px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gk-product-card__colors {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-inline-start: auto;
}

.gk-product-card__color {
    display: inline-flex;
    width: 15px;
    height: 15px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--gk-color);
    box-shadow: 0 0 0 1px var(--gk-pc-border);
}

.gk-product-card__title {
    min-height: 48px;
    margin: 0 0 10px;
    color: var(--gk-pc-text);
    font-size: 13.5px;
    font-weight: 900;
    line-height: 1.8;
}

.gk-product-card__title a {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.gk-product-card__title a:hover {
    color: var(--gk-pc-primary);
}

.gk-product-card__info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 26px;
    margin-top: auto;
    margin-bottom: 10px;
}

.gk-product-card__delivery,
.gk-product-card__stock,
.gk-product-card__rating {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--gk-pc-muted);
    font-size: 11.5px;
    font-weight: 800;
}

.gk-product-card__delivery {
    color: var(--gk-pc-success);
}

.gk-product-card__stock.is-out {
    color: var(--gk-pc-danger);
}

.gk-product-card__rating {
    margin-inline-start: auto;
    color: var(--gk-pc-warning);
}

.gk-product-card__footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    min-height: 48px;
    padding-top: 10px;
    border-top: 1px solid var(--gk-pc-border);
}

.gk-product-card__price {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.gk-product-card__price-label {
    color: var(--gk-pc-muted);
    font-size: 11px;
    font-weight: 700;
}

.gk-product-card__price-value {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 5px;
    color: var(--gk-pc-text);
    font-size: 14px;
    font-weight: 900;
    line-height: 1.7;
}

.gk-product-card__price-value .amount {
    color: var(--gk-pc-text);
    font-size: 15px;
    font-weight: 950;
}

.gk-product-card__price-value del {
    color: #a3aab8;
    font-size: 11px;
    font-weight: 700;
    opacity: 1;
}

.gk-product-card__price-value ins {
    text-decoration: none;
}

.gk-product-card__unavailable {
    color: var(--gk-pc-danger);
    font-size: 12px;
    font-weight: 900;
}

.gk-product-card__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background: var(--gk-pc-primary-soft);
    color: var(--gk-pc-primary);
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

.gk-product-card__action:hover {
    background: var(--gk-pc-primary);
    color: #fff;
    transform: translateX(-2px);
}

/* Component-level responsive behavior shared by archive, wishlist and loops. */
@media (max-width: 991px) {
    .gk-product-card__inner {
        padding: 10px;
        border-radius: 18px;
    }

    .gk-product-card__thumb {
        border-radius: 15px;
    }

    .gk-product-card__title {
        min-height: 44px;
        font-size: 12.5px;
    }

    .gk-product-card__footer {
        min-height: 44px;
    }

    .gk-product-card__action {
        width: 34px;
        height: 34px;
        border-radius: 12px;
    }
}

@media (max-width: 640px) {
    .gk-product-card__thumb {
        margin-bottom: 8px;
    }

    .gk-product-card__meta {
        min-height: 22px;
        margin-bottom: 5px;
    }

    .gk-product-card__brand {
        max-width: 100%;
        font-size: 10px;
    }

    .gk-product-card__colors {
        display: none;
    }

    .gk-product-card__info {
        margin-bottom: 8px;
    }

    .gk-product-card__delivery,
    .gk-product-card__stock,
    .gk-product-card__rating {
        font-size: 10.5px;
    }

    .gk-product-card__price-label {
        font-size: 10px;
    }

    .gk-product-card__price-value,
    .gk-product-card__price-value .amount {
        font-size: 12.5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gk-product-card__inner,
    .gk-product-card__image,
    .gk-product-card__action {
        transition: none !important;
    }
}

