/* -------------------------
   Product Card - FULLY STANDARDIZED INNER CONTENT
   Title & Price: identical look, spacing, no underline, same everything
------------------------- */
.wc-block-product {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.45);
    display: flex;
    flex-direction: column;
    transition: transform .3s ease, box-shadow .3s ease;
}

/* Classic Woo / Astra product card */
li.product {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.45);
    display: flex;
    flex-direction: column;
    transition: transform .3s ease, box-shadow .3s ease;
}

li.product .review-rating, 
li.product .ast-woo-product-category {
    display: none !important;
}

li.product:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.6);
}

li.product .woocommerce-loop-product__link {
    position: relative;
    display: block;
    overflow: hidden;
}

/* ── Classic wrapper: reset and prepare for exact spacing ── */
li.product .astra-shop-summary-wrap {
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 0 !important;
    height: 100%;
}

/* ── TITLE - EXACT SAME IN BOTH TYPES ── */
li.product .woocommerce-loop-product__title,
li.product .woocommerce-loop-product__title a,
.wc-block-product .wp-block-post-title,
.wc-block-product .wp-block-post-title a,
.wc-block-components-product-title,
.wc-block-components-product-title a {
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1.3 !important;
    text-align: center !important;
    color: #000 !important;
    margin-top: 4px !important;        /* distance from image */
    margin-bottom: 2px !important;      /* distance to price */
    padding: 0 12px !important;
    text-decoration: none !important;   /* NO UNDERLINE EVER */
    border: none !important;
    box-shadow: none !important;
}

/* Kill any possible underline from theme or links */
li.product .woocommerce-loop-product__title a,
.wc-block-product .wp-block-post-title a {
    text-decoration: none !important;
    border-bottom: none !important;
}

/* ── PRICE - EXACT SAME IN BOTH TYPES ── */
li.product .price,
li.product .price .woocommerce-Price-amount,
.wc-block-components-product-price,
.wc-block-components-product-price .woocommerce-Price-amount {
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.3 !important;
    text-align: center !important;
    color: #000 !important;
    margin-top: 0 !important;
    margin-bottom: 4px !important;     /* distance before button */
    padding: 0 12px !important;
}

/* ── Button stays at bottom (your original logic preserved) ── */
li.product .button {
    margin-top: auto !important;
    margin-bottom: 0 !important;
    width: 100% !important;
    display: block !important;
    align-self: stretch !important;
    box-sizing: border-box !important;
    text-align: center;
    border-radius: 0 0 16px 16px;
    background: #000 !important;
    color: #fff !important;
    font-weight: bold !important;
    padding: 16px !important;
}

li.product .button:hover {
    background: #111 !important;
}

.wc-block-product:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.6);
}

.wc-block-components-product-image {
    margin-bottom: 0 !important;
    position: relative;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    text-align: center;
}

.wc-block-components-product-image img {
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
}

/* General size badge */
.pearfect-size-badge {
    position: absolute;
    top: 0px;
    right: 0px;
    background: #000;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    padding: 0px 8px;
    border-radius: 0;
    border-top-right-radius: 16px;
    border-bottom-left-radius: 16px;
    border: 2px solid #fff;
    z-index: 10;
    text-transform: uppercase;
}

/* Block button */
.wp-block-woocommerce-product-button .wp-block-button__link {
    width: 100% !important;
    margin: 0 !important;
    border-radius: 0 0 16px 16px !important;
    display: block;
    text-align: center;
    background: #000 !important;
    color: #fff !important;
    font-weight: bold !important;
    padding: 16px !important;
    transition: background .3s !important;
}

.wp-block-woocommerce-product-price, .attachment-woocommerce_thumbnail {
    margin-bottom: 0 !important;
}

.wp-block-woocommerce-product-button .wp-block-button__link:hover {
    background: #111 !important;
}

.wp-block-woocommerce-product-button {
    margin-top: auto !important;
}

.woocommerce-product-gallery__image img {
    max-width: 300px;
    max-height: 300px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    background-color: #c6cdd4; /* light gray */
}

.enclose, .entry-summary, .woocommerce-tabs {
    background-color: white;
    border-radius: 16px;
    padding: 30px;
    display: flow-root;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.45) !important;
}

.enclose-glide {
    background-color: white;
    border-radius: 16px;
    padding: 10px 30px;
    display: flow-root;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.45) ;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
    transition:
        max-height 600ms ease,
        opacity 400ms ease,
        transform 400ms ease;
}

.enclose-glide.is-visible {
    opacity: 1;
    transform: translateY(0);
    max-height: 1000px; /* large enough to fit content */
}

.woocommerce-ordering {
    margin-bottom: 0px !important;
}

.woocommerce-products-header__title {
    font-size: 25px;
    margin-bottom: 5px;
}

.entry-content ul {
    padding:0 !important;
}

/* Fade-in animation for newly created badges */
.pearfect-size-badge--fade-in {
    opacity: 0;
    transform: scale(0.85);
    animation: badgeFadeIn 0.7s ease-out forwards;
}

@keyframes badgeFadeIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Optional: visual feedback during scan mode */
body.scan-mode-active .pearfect-size-badge {
    /* You can make them pulse / glow / bigger etc. */
    box-shadow: 0 0 0 3px rgba(0,0,0,0.3);
    /* or even a subtle pulse animation */
}

/* Optional pulse during scan mode */
@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.08); }
}

body.scan-mode-active .pearfect-size-badge {
    animation: badgePulse 1.8s infinite ease-in-out;
}