/* Existing layouts, IranSans files and breakpoints remain the source of truth. */
body.tanzib-category-cards {
    --tzcc-orange: #ff4d00;
    --tzcc-navy: #003666;
}

body.tanzib-category-cards .jet-woo-products__item .jet-woo-products__inner-box {
    border: 1px solid #e2e7ee;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}

body.tanzib-category-cards .jet-woo-products__item .jet-woo-products__thumb-wrap,
body.tanzib-category-cards .jet-woo-products__item .jet-woo-product-thumbnail {
    padding: 0 !important;
    border: 0 !important;
    background: #fff !important;
}

body.tanzib-category-cards .jet-woo-products__item .jet-woo-product-thumbnail {
    margin: 0;
}

body.tanzib-category-cards .jet-woo-products__item .jet-woo-product-thumbnail > a {
    display: block;
    width: 100%;
}

body.tanzib-category-cards .jet-woo-products__item .jet-woo-product-thumbnail img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    object-fit: contain;
}

body.tanzib-category-cards .tzcc-ribbon {
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex: 0 0 30px;
    align-self: stretch;
    align-items: center;
    justify-content: center;
    order: -1;
    min-width: 0;
    height: 30px;
    min-height: 30px;
    margin: 0;
    padding: 0 6px;
    overflow: hidden;
    background: var(--tzcc-orange);
    color: var(--tzcc-navy);
    font-family: IranSans, sans-serif;
    font-weight: 800;
    font-size: 10.5px;
    line-height: 1.7;
    white-space: nowrap;
    text-align: center;
    isolation: isolate;
}

body.tanzib-category-cards .tzcc-ribbon::after {
    content: "";
    position: absolute;
    inset: -20px auto -20px 0;
    width: 38%;
    background: linear-gradient(110deg, transparent, #fff8, transparent);
    transform: translateX(-250%) skewX(-20deg);
    pointer-events: none;
    animation: tzcc-ribbon-shine 6s ease-in-out infinite;
    animation-play-state: paused;
}

body.tanzib-category-cards .tzcc-ribbon.tzcc-ribbon-visible::after {
    animation-play-state: running;
}

/* A static, lightweight link to the product; it never loads the viewer. */
body.tanzib-category-cards .tzcc-3d-badge {
    box-sizing: border-box;
    display: flex;
    flex: 0 0 27px;
    align-self: stretch;
    align-items: center;
    justify-content: center;
    gap: 6px;
    order: -2;
    min-width: 0;
    height: 27px;
    min-height: 27px;
    margin: 0;
    padding: 0 7px;
    background: var(--tzcc-navy);
    color: #fff;
    font-family: IranSans, sans-serif;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.7;
    white-space: nowrap;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

body.tanzib-category-cards .tzcc-3d-badge:visited,
body.tanzib-category-cards .tzcc-3d-badge:hover,
body.tanzib-category-cards .tzcc-3d-badge:focus {
    color: #fff;
    text-decoration: none;
}

body.tanzib-category-cards .tzcc-3d-badge:focus-visible {
    outline: 2px solid var(--tzcc-orange);
    outline-offset: -3px;
}

body.tanzib-category-cards .tzcc-3d-badge > svg {
    display: block;
    flex: 0 0 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linejoin: round;
    stroke-linecap: round;
}

@keyframes tzcc-ribbon-shine {
    0%, 72% { transform: translateX(-250%) skewX(-20deg); }
    90%, 100% { transform: translateX(420%) skewX(-20deg); }
}

/* Child v0.3.0 has an intentional mobile horizontal card. Clear only its
   nested image insets and add one full-width row before that existing grid. */
body.tanzib-category-cards.tanzib-child-card-public-v3 .elementor-element-ba5cede .jet-woo-products__item.tanzib-child-card-v3 .jet-woo-products__thumb-wrap,
body.tanzib-category-cards.tanzib-child-card-public-v3 .elementor-element-ba5cede .jet-woo-products__item.tanzib-child-card-v3 .jet-woo-product-thumbnail {
    padding: 0 !important;
    border: 0 !important;
    background: #fff !important;
}

body.tanzib-category-cards.tanzib-child-card-public-v3 .elementor-element-ba5cede .jet-woo-products__item.tanzib-child-card-v3 .tzcc-ribbon {
    margin: -11px -11px 10px;
}

body.tanzib-category-cards.tanzib-child-card-public-v3 .elementor-element-ba5cede .jet-woo-products__item.tanzib-child-card-v3 .tzcc-3d-badge {
    margin: -11px -11px 10px;
}

body.tanzib-category-cards.tanzib-child-card-public-v3 .elementor-element-ba5cede .jet-woo-products__item.tanzib-child-card-v3 .tzcc-has-3d.tzcc-has-ribbon > .tzcc-3d-badge {
    margin-bottom: 0;
}

body.tanzib-category-cards.tanzib-child-card-public-v3 .elementor-element-ba5cede .jet-woo-products__item.tanzib-child-card-v3 .tzcc-has-3d > .tzcc-ribbon {
    margin-top: 0;
}

/* Verified Elementor archive loop template 176228. The media/text flex
   structure and its responsive direction stay intact. */
body.tanzib-category-cards .tzcc-loop-card > .elementor-element-70c3179.tzcc-shell {
    padding-inline: 0;
    row-gap: 0;
    border-color: #e2e7ee;
    border-radius: 14px;
    overflow: hidden;
}

body.tanzib-category-cards .tzcc-loop-card > .elementor-element-70c3179.tzcc-shell > .e-con-inner {
    box-sizing: border-box;
    padding-inline: 16px;
}

body.tanzib-category-cards .tzcc-loop-card .elementor-element-8c716ab img {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* Wrap complete price groups in the narrow horizontal loop, never letters
   within the currency or the existing "from" label. */
body.tanzib-category-cards .tzcc-loop-card .price .tanzib-variable-from-price {
    flex-wrap: wrap;
    column-gap: 8px;
    row-gap: 4px;
}

body.tanzib-category-cards .tzcc-loop-card .price .tanzib-variable-from-price > .tanzib-from-text,
body.tanzib-category-cards .tzcc-loop-card .price .tanzib-variable-from-price > del,
body.tanzib-category-cards .tzcc-loop-card .price .tanzib-variable-from-price > ins,
body.tanzib-category-cards .tzcc-loop-card .price bdi {
    flex: 0 0 auto;
    white-space: nowrap;
    word-break: normal;
}

@media (max-width: 767px) {
    body.tanzib-category-cards.tanzib-child-card-public-v3 .elementor-element-ba5cede .jet-woo-products__item.tanzib-child-card-v3 .jet-woo-products__inner-box.tzcc-has-ribbon {
        grid-template-areas:
            "badge badge"
            "title media"
            "features media"
            "price media"
            "cta media";
    }

    body.tanzib-category-cards.tanzib-child-card-public-v3 .elementor-element-ba5cede .jet-woo-products__item.tanzib-child-card-v3 .tzcc-ribbon {
        grid-area: badge;
        margin: -10px -10px 6px;
        font-size: 12px;
    }

    body.tanzib-category-cards.tanzib-child-card-public-v3 .elementor-element-ba5cede .jet-woo-products__item.tanzib-child-card-v3 .jet-woo-products__inner-box.tzcc-has-3d {
        grid-template-areas:
            "model model"
            "title media"
            "features media"
            "price media"
            "cta media";
    }

    body.tanzib-category-cards.tanzib-child-card-public-v3 .elementor-element-ba5cede .jet-woo-products__item.tanzib-child-card-v3 .jet-woo-products__inner-box.tzcc-has-3d.tzcc-has-ribbon {
        grid-template-areas:
            "model model"
            "badge badge"
            "title media"
            "features media"
            "price media"
            "cta media";
    }

    body.tanzib-category-cards.tanzib-child-card-public-v3 .elementor-element-ba5cede .jet-woo-products__item.tanzib-child-card-v3 .tzcc-3d-badge {
        grid-area: model;
        margin: -10px -10px 6px;
        font-size: 12px;
    }

    body.tanzib-category-cards.tanzib-child-card-public-v3 .elementor-element-ba5cede .jet-woo-products__item.tanzib-child-card-v3 .tzcc-has-3d.tzcc-has-ribbon > .tzcc-3d-badge {
        margin-bottom: -4px;
    }

    body.tanzib-category-cards.tanzib-child-card-public-v3 .elementor-element-ba5cede .jet-woo-products__item.tanzib-child-card-v3 .tzcc-has-3d > .tzcc-ribbon {
        margin-top: 0;
    }
}

@media (max-width: 374px) {
    body.tanzib-category-cards.tanzib-child-card-public-v3 .elementor-element-ba5cede .jet-woo-products__item.tanzib-child-card-v3 .tzcc-ribbon {
        margin: -8px -8px 6px;
    }

    body.tanzib-category-cards.tanzib-child-card-public-v3 .elementor-element-ba5cede .jet-woo-products__item.tanzib-child-card-v3 .tzcc-3d-badge {
        margin: -8px -8px 6px;
    }

    body.tanzib-category-cards.tanzib-child-card-public-v3 .elementor-element-ba5cede .jet-woo-products__item.tanzib-child-card-v3 .tzcc-has-3d > .tzcc-ribbon {
        margin-top: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.tanzib-category-cards .tzcc-ribbon::after {
        display: none;
        animation: none;
    }
}

/* Stock is a separate line beside the price, never an overlay on top badges. */
body.tanzib-category-cards .tzcc-stock-data {
    display: none !important;
}

body.tanzib-category-cards .tzcc-card.tzcc-stock-known .jet-woo-product-stock-status__out-of-stock {
    display: none !important;
}

body.tanzib-category-cards .tzcc-stock-status {
    box-sizing: border-box;
    position: static;
    display: block;
    flex: none;
    width: fit-content;
    max-width: 100%;
    margin: 6px 0 0;
    padding: 3px 8px;
    border: 1px solid #b7c8d8;
    border-radius: 6px;
    background: #f5f8fb;
    color: var(--tzcc-navy);
    font-family: IranSans, sans-serif;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.8;
    text-align: center;
    white-space: normal;
    overflow-wrap: normal;
}

body.tanzib-category-cards .tzcc-stock-status.tzcc-stock-partial {
    border-color: #dbe3eb;
    background: #fafbfd;
    font-weight: 400;
}

/* This existing host is a wrapping row; a full basis puts stock below both prices. */
body.tanzib-category-cards .tanzib-child-card-price-v3 > .tzcc-stock-status {
    flex-basis: 100%;
}
