/* Ganjeh Kala — central product labels system. */
.gk-product-labels {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.gk-product-label {
    --gk-label-bg: var(--gk-primary, #ed1944);
    --gk-label-color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    min-height: 25px;
    padding: 4px 9px;
    border-radius: 7px;
    background: var(--gk-label-bg);
    color: var(--gk-label-color);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    box-sizing: border-box;
}

/* Single product heading meta: brand + labels should read as one inline row. */
.gk-product-heading-meta,
.gk-product-meta-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
}

.gk-product-labels--single {
    margin: 0;
}

.gk-product-labels--single .gk-product-label {
    min-height: 27px;
    padding: 5px 10px;
    font-size: 12px;
}


.gk-product-heading-meta .gk-product-labels--single,
.gk-product-meta-inline .gk-product-labels--single {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.gk-product-heading-meta .gk-native-brand,
.gk-product-meta-inline .gk-product-brand {
    margin: 0;
    flex: 0 0 auto;
}

.gk-product-meta-inline .gk-product-brand + .gk-product-labels--single {
    flex: 1 1 auto;
    min-width: 0;
}

/* Custom theme/Elementor product-image wrappers also participate in the
 * central label system. Keeping the positioning context here avoids each
 * widget having to reinvent label placement. */
.gk-product-grid__image-wrapper,
.gk-grid-thumb,
.gk-pro-thumb,
.gk-yoga-img-wrapper,
.gk-deal-image,
.gk-amazing-thumb {
    position: relative;
}

/* Product cards: labels sit on the image in a compact vertical stack. */
.gk-product-card__thumb > .gk-product-labels--card,
.product-card__image-container > .gk-product-labels--card,
.gk-product-grid__image-wrapper > .gk-product-labels--card,
.gk-grid-thumb > .gk-product-labels--card,
.gk-pro-thumb > .gk-product-labels--card,
.gk-yoga-img-wrapper > .gk-product-labels--card,
.gk-deal-image > .gk-product-labels--card,
.gk-amazing-thumb > .gk-product-labels--card {
    position: absolute;
    z-index: 6;
    top: 10px;
    left: 10px;
    right: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 5px;
    max-width: calc(100% - 20px);
    margin: 0;
    pointer-events: none;
}

.gk-product-labels--card .gk-product-label {
    min-height: 22px;
    max-width: 150px;
    padding: 3px 7px;
    border-radius: 6px;
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
}

/* Generic output for shortcode/custom template usage. */
.gk-product-labels--inline {
    margin-block: 6px;
}


/* Archive product cards: labels replace the old "fast delivery" line.
 * Keep every label on one row; horizontal motion is owned by GKSwiperSystem. */
.gk-product-card__labels-viewport {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.gk-product-labels--archive-strip {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    gap: 5px;
    margin: 0;
    padding: 1px 0 3px;
    overflow-y: hidden;
    scrollbar-width: none;
}

.gk-product-labels--archive-strip::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.gk-product-labels--archive-strip .gk-product-label {
    flex: 0 0 auto;
    max-width: none;
    min-height: 22px;
    padding: 3px 7px;
    border-radius: 6px;
    font-size: 10px;
    line-height: 1.2;
    white-space: nowrap;
}

@media (max-width: 767px) {
    .gk-product-heading-meta,
    .gk-product-meta-inline {
        gap: 6px;
        margin-bottom: 8px;
    }
    .gk-product-labels--single {
        gap: 5px;
        margin-bottom: 0;
    }
    .gk-product-labels--single .gk-product-label {
        min-height: 24px;
        padding: 4px 8px;
        font-size: 11px;
    }
    .gk-product-card__thumb > .gk-product-labels--card,
    .product-card__image-container > .gk-product-labels--card,
    .gk-product-grid__image-wrapper > .gk-product-labels--card,
    .gk-grid-thumb > .gk-product-labels--card,
    .gk-pro-thumb > .gk-product-labels--card,
    .gk-yoga-img-wrapper > .gk-product-labels--card,
    .gk-deal-image > .gk-product-labels--card,
    .gk-amazing-thumb > .gk-product-labels--card {
        top: 8px;
        left: 8px;
        max-width: calc(100% - 16px);
        gap: 4px;
    }
    .gk-product-labels--card .gk-product-label {
        max-width: 120px;
        min-height: 20px;
        padding: 3px 6px;
        font-size: 9px;
    }
}


@media (max-width: 767px) {
    .gk-product-labels--archive-strip {
        gap: 4px;
        padding-bottom: 2px;
    }

    .gk-product-labels--archive-strip .gk-product-label {
        min-height: 20px;
        padding: 3px 6px;
        font-size: 9px;
    }
}


/* GK 1.9.341 — mobile card-label rotator.
 * Before JS boots we deliberately expose only the first label, so cards never
 * flash an oversized stack. Runtime then rotates one label at a time. */
@media (max-width: 767px) {
    .gk-product-card .gk-product-labels--archive-strip,
    .gk-product-card .gk-product-labels--card,
    .product-card .gk-product-labels--card,
    .product-card .gk-product-labels--carousel {
        max-width: 100%;
        overflow: hidden !important;
        pointer-events: none !important;
        touch-action: pan-y;
        transition: opacity .24s ease, transform .32s cubic-bezier(.22,.61,.36,1);
        will-change: opacity, transform;
    }

    .gk-product-card .gk-product-labels--archive-strip > .gk-product-label:not(:first-child),
    .gk-product-card .gk-product-labels--card > .gk-product-label:not(:first-child),
    .product-card .gk-product-labels--card > .gk-product-label:not(:first-child),
    .product-card .gk-product-labels--carousel > .gk-product-label:not(:first-child) {
        display: none;
    }

    .gk-mobile-label-rotator > .gk-product-label {
        display: none !important;
        max-width: 100% !important;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .gk-mobile-label-rotator > .gk-product-label.is-gk-label-active {
        display: inline-flex !important;
    }

    .gk-mobile-label-rotator.is-gk-label-switching {
        opacity: 0;
        transform: translateY(-4px);
    }

    .gk-product-card__labels-viewport {
        overflow: hidden;
    }

    .gk-product-card__labels-viewport .gk-mobile-label-rotator {
        width: 100%;
    }

    .gk-product-card__labels-viewport .gk-product-label {
        max-width: 100% !important;
    }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
    .gk-mobile-label-rotator {
        transition: none !important;
    }
}

/* GK 1.9.342 — unified product-label rotator.
 * Grid-slider: always one label on every breakpoint.
 * Product cards: one label on mobile; up to two static labels on desktop and
 * rotating pairs only when a card has more than two labels. */
.gk-label-rotator {
    max-width: 100%;
    overflow: hidden !important;
    pointer-events: none !important;
    -webkit-user-select: none;
    user-select: none;
    transition: opacity .22s ease, transform .30s cubic-bezier(.22,.61,.36,1);
    will-change: opacity, transform;
}

.gk-label-rotator > .gk-product-label {
    display: none !important;
}

.gk-label-rotator > .gk-product-label.is-gk-label-active {
    display: inline-flex !important;
}

.gk-label-rotator--single > .gk-product-label {
    max-width: 100% !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gk-label-rotator--pairs {
    gap: 5px;
}

.gk-label-rotator--pairs > .gk-product-label {
    flex: 0 1 calc(50% - 3px) !important;
    max-width: calc(50% - 3px) !important;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gk-label-rotator.is-gk-label-switching {
    opacity: 0;
    transform: translateY(-4px);
}

/* Stable no-JS fallbacks: mobile shows one; desktop cards show at most two;
 * grid-slider shows one on every breakpoint. */
.gk-product-labels--grid-slider > .gk-product-label:not(:first-child) {
    display: none;
}

@media (min-width: 768px) {
    .gk-product-card .gk-product-labels--archive-strip > .gk-product-label:nth-child(n+3),
    .gk-product-card .gk-product-labels--card > .gk-product-label:nth-child(n+3),
    .product-card .gk-product-labels--card > .gk-product-label:nth-child(n+3),
    .product-card .gk-product-labels--carousel > .gk-product-label:nth-child(n+3) {
        display: none;
    }
}

@media (max-width: 767px) {
    .gk-product-card .gk-product-labels--archive-strip > .gk-product-label:not(:first-child),
    .gk-product-card .gk-product-labels--card > .gk-product-label:not(:first-child),
    .product-card .gk-product-labels--card > .gk-product-label:not(:first-child),
    .product-card .gk-product-labels--carousel > .gk-product-label:not(:first-child) {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gk-label-rotator {
        transition: none !important;
    }
}
