/* ZHIYAR — glassmorphism frames for product & category images.
   Rounded glass card, soft studio-light sheen, depth shadow, copper/gold rim, subtle reflection. */

/* Faint radial glow behind the grid so the glass has something to diffuse. */
body.woocommerce-shop .ast-container,
body.tax-product_cat .ast-container,
body.post-type-archive-product .ast-container,
body.woocommerce-page .ast-container {
    position: relative;
    background:
        radial-gradient(560px 280px at 12% 0%, rgba(201, 160, 84, 0.10), transparent 60%),
        radial-gradient(480px 260px at 88% 8%, rgba(26, 61, 46, 0.08), transparent 60%);
}

/* Shop / category archive grid: Astra already injects its own responsive
   grid-template-columns (tablet-columns-N / mobile-columns-N body classes,
   switching at ~545px/921px, at higher selector specificity than a plain
   "body.woocommerce-shop ul.products" rule) — that's a DIFFERENT breakpoint
   pair than the rest of the site, so every grid-template-columns here needs
   !important to force the site's one true 991/599 breakpoint set to win. */
body.woocommerce-shop ul.products,
body.tax-product_cat ul.products,
body.post-type-archive-product ul.products {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 24px;
}

body.woocommerce-shop ul.products > li.product,
body.tax-product_cat ul.products > li.product,
body.post-type-archive-product ul.products > li.product {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    float: none !important;
}

@media (max-width: 991px) {
    body.woocommerce-shop ul.products,
    body.tax-product_cat ul.products,
    body.post-type-archive-product ul.products {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 18px;
    }

    body.woocommerce-shop .zhiyar-glass-frame,
    body.tax-product_cat .zhiyar-glass-frame,
    body.post-type-archive-product .zhiyar-glass-frame {
        padding: 9px;
        border-radius: 16px;
    }
}

@media (max-width: 599px) {
    body.woocommerce-shop ul.products,
    body.tax-product_cat ul.products,
    body.post-type-archive-product ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }

    body.woocommerce-shop .zhiyar-glass-frame,
    body.tax-product_cat .zhiyar-glass-frame,
    body.post-type-archive-product .zhiyar-glass-frame {
        padding: 7px;
        border-radius: 14px;
    }

    body.woocommerce-shop .woocommerce-loop-product__title,
    body.tax-product_cat .woocommerce-loop-product__title,
    body.post-type-archive-product .woocommerce-loop-product__title {
        font-size: 13px;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    body.woocommerce-shop .ast-woo-product-category,
    body.tax-product_cat .ast-woo-product-category,
    body.post-type-archive-product .ast-woo-product-category {
        font-size: 10px;
    }
}

.zhiyar-glass-frame,
.woocommerce-product-gallery__image {
    position: relative;
    display: block;
    border-radius: 20px;
    padding: 12px;
    margin: 0 0 12px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.14) 55%, rgba(201, 160, 84, 0.10) 100%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow:
        0 18px 40px -14px rgba(13, 31, 23, 0.28),
        0 2px 8px rgba(13, 31, 23, 0.10),
        inset 0 1px 1px rgba(255, 255, 255, 0.75),
        inset 0 -12px 20px -14px rgba(201, 160, 84, 0.35);
    overflow: hidden;
    isolation: isolate;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease;
}

/* Soft studio-light sheen, upper-left. */
.zhiyar-glass-frame::before,
.woocommerce-product-gallery__image::before {
    content: "";
    position: absolute;
    inset: -60% -20% auto -20%;
    height: 70%;
    background: radial-gradient(ellipse at 30% 0%, rgba(255, 255, 255, 0.65), transparent 65%);
    pointer-events: none;
    z-index: 1;
}

/* Copper/gold rim light. */
.zhiyar-glass-frame::after,
.woocommerce-product-gallery__image::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 0 1px rgba(201, 160, 84, 0.35) inset, 0 0 24px rgba(201, 160, 84, 0.12) inset;
    pointer-events: none;
    z-index: 2;
}

.zhiyar-glass-frame img,
.woocommerce-product-gallery__image img {
    position: relative;
    z-index: 0;
    display: block;
    width: 100%;
    height: auto;
    border-radius: 13px;
    filter: drop-shadow(0 14px 22px rgba(13, 31, 23, 0.30));
    -webkit-box-reflect: below 6px linear-gradient(transparent, transparent 65%, rgba(255, 255, 255, 0.22));
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.zhiyar-glass-frame--category img {
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.zhiyar-glass-frame--product img {
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.35);
}

a:hover .zhiyar-glass-frame,
.woocommerce-product-gallery__image:hover {
    transform: translateY(-4px);
    box-shadow:
        0 26px 50px -14px rgba(13, 31, 23, 0.35),
        0 4px 10px rgba(13, 31, 23, 0.12),
        inset 0 1px 1px rgba(255, 255, 255, 0.8),
        inset 0 -12px 20px -14px rgba(201, 160, 84, 0.45),
        0 0 0 1px rgba(201, 160, 84, 0.4);
}

a:hover .zhiyar-glass-frame img,
.woocommerce-product-gallery__image:hover img {
    transform: scale(1.045);
}

/* Sale badge / count badge should float above the glass, not get clipped by it. */
.zhiyar-glass-frame .onsale {
    z-index: 3;
}

/* "(N) products in this category" count — small glass chip, echoing the image-frame style. */
.woocommerce-loop-category__title mark.count,
mark.count {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin-inline-start: 5px;
    padding: 2px 9px;
    border-radius: 12px;
    background: transparent !important;
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    backdrop-filter: blur(10px) saturate(140%);
    border: 1px solid rgba(201, 160, 84, 0.3);
    box-shadow: 0 2px 6px rgba(13, 31, 23, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    color: var(--ast-global-color-2, #1a3d2e);
    font-size: 0.72em;
    font-weight: 700;
}
