/* UBICHEE Shop Page Styles - Product Grid, Category Sidebar, Cart Styles */
/* Loaded only on shop page via ubi-assets.php */

.ubi-coupon-banner{
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    padding: 14px 18px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #6737a5, #4e3575);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    box-shadow: 0 10px 28px rgba(103, 55, 165, .28);
}
.ubi-coupon-banner::before{
    content: '✓';
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #ffd65a;
    color: #35165f;
    font: 800 15px/1 'DM Sans', sans-serif;
}
.ubi-coupon-banner strong{
    color: #ffd65a;
    font-size: 15px;
    letter-spacing: .04em;
}
.ubi-coupon-banner__close{
    margin-left: auto;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font: 700 18px/1 'DM Sans', sans-serif;
    cursor: pointer;
    transition: background .2s ease;
}
.ubi-coupon-banner__close:hover{
    background: rgba(255, 255, 255, .18);
}
.ubi-coupon-banner__close:focus-visible{
    outline: 2px solid #ffd65a;
    outline-offset: 2px;
}
@media (max-width: 600px){
    .ubi-coupon-banner{
        padding: 12px 14px;
        font-size: 13px;
    }
}

/* ========== SHOP PAGE CARD ========== */
/* Same treatment as Tentang Kami: one cream card on the page background, a
   wide hero, then the category rail and product grid inside the card. */
.ubi-shop-main{
    margin-top: 0 !important;
    padding-top: clamp(24px, 3vw, 40px) !important;
    padding-bottom: clamp(30px, 6vw, 70px) !important;
}

.ubi-shop{
    --shop-ink: #35165f;
    --shop-body: #65586b;
    --shop-purple: #6737a5;
    --shop-line: #eadfce;
    box-sizing: border-box;
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: clamp(36px, 5vw, 68px) clamp(20px, 5vw, 64px) clamp(32px, 4vw, 56px);
    background: #fff7e8;
    border: 1px solid rgba(53,22,95,.08);
    border-radius: 28px;
    box-shadow: 0 18px 50px rgba(53,22,95,.05);
    color: var(--shop-ink);
}

.ubi-shop *,
.ubi-shop *::before,
.ubi-shop *::after{
    box-sizing: border-box;
}

/* Hero: title on the left, intro on the right, matching Tentang Kami. */
.ubi-shop__hero{
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,.92fr);
    grid-template-rows: auto auto;
    column-gap: clamp(28px, 5vw, 72px);
    row-gap: 10px;
    align-items: end;
    padding-bottom: clamp(28px, 4vw, 42px);
    border-bottom: 1px solid rgba(53,22,95,.12);
    background: transparent !important;
}

.ubi-shop__eyebrow{
    grid-column: 1;
    margin: 0;
    color: var(--shop-purple);
    font: 800 11px/1.2 'DM Sans', sans-serif;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.ubi-shop__title{
    grid-column: 1;
    margin: 0;
    color: var(--shop-ink);
    font: 700 clamp(38px, 4.6vw, 62px)/1.02 'Fredoka', sans-serif;
    letter-spacing: -.02em;
}

.ubi-shop__lead{
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: end;
    max-width: 46ch;
    margin: 0 0 4px;
    color: var(--shop-body);
    font-size: 16.5px;
    line-height: 1.75;
}

/* Category rail + product grid inside the card. */
.ubi-shop .wp-block-columns{
    display: grid !important;
    grid-template-columns: 200px minmax(0, 1fr) !important;
    gap: 36px !important;
    padding: clamp(30px, 4vw, 44px) 0 0 !important;
    max-width: none !important;
    margin: 0 !important;
    align-items: start !important;
}

/* Disable WP block columns flex behavior. */
.ubi-shop .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column{
    flex-basis: auto !important;
    flex-grow: 0 !important;
}

/* Sidebar */
.ubi-shop .wp-block-column:first-child{
    position: sticky !important;
    top: calc(var(--ubi-admin-h, 0px) + var(--ubi-header-h, 120px) + 16px) !important;
    align-self: flex-start !important;
    min-width: 0 !important;
    padding: 18px 18px 16px !important;
    background: #fff !important;
    border: 1px solid var(--shop-line) !important;
    border-radius: 16px !important;
}
.ubi-shop .wp-block-column:first-child .wp-block-heading{
    margin: 0 0 12px !important;
    padding-bottom: 10px !important;
    border-bottom: 1px solid var(--shop-line) !important;
    color: var(--shop-purple) !important;
    font: 800 10.5px/1.2 'DM Sans', sans-serif !important;
    letter-spacing: .16em !important;
    text-transform: uppercase !important;
}
.ubi-shop .ubi-cat-list{
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}
.ubi-shop .ubi-cat-list li{
    margin-bottom: 4px !important;
}
.ubi-shop .ubi-cat-list li:last-child{
    margin-bottom: 0 !important;
}
.ubi-shop .ubi-cat-link{
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 11px 14px !important;
    border-radius: 12px !important;
    color: #291d35 !important;
    font-family: 'DM Sans', sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all .2s ease;
    border: 1px solid transparent !important;
    white-space: nowrap !important;
}
.ubi-shop .ubi-cat-link:hover{
    background: #f3eef9 !important;
    color: var(--shop-purple) !important;
    border-color: #e8dff5 !important;
}
.ubi-shop .ubi-cat-link.active{
    background: linear-gradient(135deg, #6737a5, #4e3575) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 12px rgba(103,55,165,.25) !important;
}

/* Product grid - override WC block template styles */
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product-template{
    display: grid !important;
    gap: 28px !important;
    grid-template-columns: repeat(3, 1fr) !important;
    grid-auto-flow: dense !important;
}
/* WC still sets li{width:calc(33.33% - ...)} for its flex layout; as grid items
   that shrinks each card to a third of its track. Neutralise it. */
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product-template > li{
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
}

/* Product card - modern premium */
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product{
    background: #fff !important;
    border-radius: 24px !important;
    padding: 0 !important;
    overflow: hidden !important;
    box-shadow: 0 4px 24px rgba(68,36,91,.06) !important;
    transition: transform .4s cubic-bezier(.2,.8,.2,1), box-shadow .4s;
    border: 1px solid rgba(68,36,91,.06) !important;
    display: flex !important;
    flex-direction: column !important;
    min-width: 0 !important;
}
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product:hover{
    transform: translateY(-10px) !important;
    box-shadow: 0 24px 60px rgba(68,36,91,.14) !important;
}

/* Hidden state - display:none so grid packs left, but animated via JS */
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product.ubi-filtered-out{
    display: none !important;
}

/* Animation classes for filter */
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product{
    transition: opacity .3s ease, transform .3s ease;
}
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product.ubi-filter-hidden{
    display: none !important;
}
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product.ubi-filter-fade-in{
    animation: ubiFadeIn .35s cubic-bezier(.2,.8,.2,1) both !important;
}
/* Diagonal sold-out ribbon, clipped by the card's rounded corner. */
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product.ubi-soldout{
    position: relative !important;
    order: 1; /* sold-out cards sort after every available card */
}
/* Grey the card content but not the HABIS ribbon, which is a ::after on the
   card itself and therefore outside this selector. */
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product.ubi-soldout > *{
    filter: grayscale(1);
}
/* A discount badge on a sold-out card only invites a click that cannot buy. */
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product.ubi-soldout .wc-block-components-product-sale-badge{
    display: none !important;
}
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product.ubi-soldout .wc-block-components-product-button__button,
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product.ubi-soldout .wc-block-components-product-button__button:hover{
    background: #ede9f3 !important;
    color: #5b4a70 !important;
    box-shadow: none !important;
    transform: none !important;
}
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product.ubi-soldout::after{
    content: 'HABIS';
    position: absolute;
    top: 16px;
    right: -38px;
    width: 150px;
    padding: 5px 0;
    transform: rotate(45deg);
    background: #b42318;
    color: #fff;
    font: 800 10px/1.2 'DM Sans', sans-serif;
    letter-spacing: .12em;
    text-align: center;
    z-index: 5;
    pointer-events: none;
}
@keyframes ubiFadeIn{
    from { opacity: 0; transform: scale(.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Product title */
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product .wc-block-components-product-name,
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product .wp-block-post-title{
    padding: 0 20px !important;
    margin-top: 18px !important;
}
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product .wc-block-components-product-name a,
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product .wp-block-post-title a{
    font-family: 'Fredoka', sans-serif !important;
    color: #35165f !important;
    font-size: 17.5px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    line-height: 1.25 !important;
    transition: color .2s;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product:hover .wc-block-components-product-name a,
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product:hover .wp-block-post-title a{
    color: #6737a5 !important;
}

/* Price */
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product .wc-block-components-product-price{
    padding: 0 20px !important;
    margin-top: 8px !important;
    margin-bottom: 4px !important;
}
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product .wc-block-components-product-price .woocommerce-Price-amount{
    color: #6737a5 !important;
    font-weight: 800 !important;
    font-family: 'DM Sans', sans-serif !important;
    font-size: 17px !important;
}
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product .wc-block-components-product-price .ubi-from{
    display: block;
    color: #6B5F7A !important;
    font-size: 10px !important;
    font-weight: 600 !important;
}
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product .wc-block-components-product-price del{
    color: #6737a5 !important;
    font-size: 11px !important;
    margin-left: 4px !important;
    font-weight: 600 !important;
    opacity: .8;
}
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product .wc-block-components-product-price del .woocommerce-Price-amount{
    font-size: 11px !important;
}
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product .wc-block-components-product-price ins{
    text-decoration: none !important;
}

/* Add to cart button - premium */
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product .wc-block-components-product-button{
    padding: 0 20px 22px !important;
    margin-top: auto !important;
}
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product .wc-block-components-product-button__button{
    background: linear-gradient(135deg, #6737a5, #542a8a) !important;
    color: #fff !important;
    border-radius: 14px !important;
    font-family: 'Fredoka', sans-serif !important;
    font-weight: 700 !important;
    border: none !important;
    padding: 14px 24px !important;
    font-size: 14px !important;
    width: 100% !important;
    transition: all .25s cubic-bezier(.2,.8,.2,1);
    box-shadow: 0 6px 20px rgba(103,55,165,.3) !important;
    position: relative !important;
    overflow: hidden !important;
}
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product .wc-block-components-product-button__button::before{
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.2), transparent) !important;
    transition: left .5s;
}
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product .wc-block-components-product-button__button:hover{
    background: linear-gradient(135deg, #542a8a, #421f6e) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 28px rgba(103,55,165,.4) !important;
}
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product .wc-block-components-product-button__button:hover::before{
    left: 100% !important;
}
/* Drop the UA ring for pointer clicks, keep it for keyboard focus. */
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product .wc-block-components-product-button__button:focus{
    outline: none !important;
}
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product .wc-block-components-product-button__button:focus-visible{
    outline: 2px solid #35165f !important;
    outline-offset: 3px !important;
}

/* Add to cart button text */
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product .wc-block-components-product-button__button .wc-block-slide-in,
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product .wc-block-components-product-button__button .wc-block-slide-out{
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}

/* Sale badge - brand pill */
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-components-product-sale-badge{
    position: absolute !important;
    top: 14px !important;
    left: 14px !important;
    background: var(--purple) !important;
    color: #fff !important;
    border-radius: 999px !important;
    font-weight: 800 !important;
    font-size: 10px !important;
    line-height: 1.1 !important;
    padding: 6px 12px !important;
    letter-spacing: .06em !important;
    text-transform: uppercase !important;
    box-shadow: 0 3px 10px rgba(53,22,95,.28) !important;
    z-index: 2 !important;
    font-family: 'DM Sans', sans-serif !important;
    white-space: nowrap !important;
}
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-components-product-sale-badge .wc-block-components-product-sale-badge__text{
    display: inline-block !important;
}
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-components-product-sale-badge .screen-reader-text{
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Sorting dropdown */
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-catalog-sorting select.orderby{
    border-radius: 12px !important;
    border: 1px solid #eadfce !important;
    padding: 10px 16px !important;
    font-family: 'DM Sans', sans-serif !important;
    background: #fff !important;
    color: #35165f !important;
    cursor: pointer !important;
}

/* Results count */
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product-results-count{
    font-family: 'DM Sans', sans-serif !important;
    color: #65586b !important;
    font-size: 13px !important;
    margin-bottom: 20px !important;
}

/* Tablet: the card is narrower, so two product columns read better than three. */
@media (max-width: 1100px){
    .ubi-shop .wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product-template{
        grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    }
}

@media (max-width: 1024px){
    .ubi-shop__hero{
        grid-template-columns: minmax(0,1fr);
    }
    .ubi-shop__lead{
        grid-column: 1;
        grid-row: auto;
        max-width: 62ch;
        margin-top: 14px;
    }
}

/* Mobile: category pills wrap onto as many rows as they need.
   A horizontal scroller hid the last pill behind an invisible scrollbar, so
   every category has to stay on screen without swiping. */
@media (max-width: 900px){
    .ubi-shop .wp-block-columns{
        grid-template-columns: minmax(0,1fr) !important;
        gap: 24px !important;
        padding-top: clamp(24px, 4vw, 34px) !important;
    }
    .ubi-shop .wp-block-column:first-child{
        position: static !important;
        top: auto !important;
        padding: 16px 16px 12px !important;
    }
    .ubi-shop .ubi-cat-list{
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        flex-wrap: nowrap !important;
        justify-content: stretch !important;
        gap: 8px !important;
        overflow: visible !important;
    }
    .ubi-shop .ubi-cat-list li{
        margin-bottom: 0 !important;
    }
    .ubi-shop .ubi-cat-link{
        width: 100% !important;
        min-height: 44px !important;
        padding: 8px 10px !important;
        justify-content: center !important;
        text-align: center !important;
        font-size: 12px !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
        background: #fff !important;
        border: 1px solid var(--shop-line) !important;
        flex-shrink: 1 !important;
    }
    .ubi-shop .ubi-cat-link:hover{
        background: #f3eef9 !important;
        border-color: #e8dff5 !important;
    }
    .ubi-shop .ubi-cat-link.active,
    .ubi-shop .ubi-cat-link.active:hover{
        background: linear-gradient(135deg, #6737a5, #4e3575) !important;
        color: #fff !important;
        border-color: transparent !important;
        transition: none !important;
    }
}

@media (max-width: 600px){
    .ubi-shop{
        padding: 32px 20px 28px;
        border-radius: 22px;
    }
    .ubi-shop .ubi-shop__title{
        font-size: clamp(34px, 10vw, 44px) !important;
        line-height: 1.05;
    }
}

@media (max-width: 520px){
    .ubi-shop .wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product-template{
        grid-template-columns: minmax(0,1fr) !important;
    }
    .ubi-shop .wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product .wc-block-components-product-name{
        padding: 0 16px !important;
    }
    .ubi-shop .wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product .wc-block-components-product-price{
        padding: 0 16px !important;
    }
    .ubi-shop .wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product .wc-block-components-product-button{
        padding: 0 16px 18px !important;
    }
}

/* Hide "Lihat keranjang" link after add to cart */
.wp-block-column:last-child .wc-block-components-product-button .added_to_cart,
.wp-block-column:last-child .wc-block-components-product-button .wc_forward{
    display: none !important;
}

/* Disable WooCommerce button slide animations (causes button to shift) */
.wp-block-column:last-child .wc-block-components-product-button__button span.wc-block-slide-in,
.wp-block-column:last-child .wc-block-components-product-button__button span.wc-block-slide-out,
.wp-block-column:last-child .wc-block-components-product-button__button .wc-block-slide-in,
.wp-block-column:last-child .wc-block-components-product-button__button .wc-block-slide-out{
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
}
/* Fix flex gap causing button shift */
.wp-block-column:last-child .wc-block-components-product-button{
    gap: 0 !important;
}

/* Shop add-to-cart button animation */
@keyframes ubiShopBtnBounce{
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.05); }
    60% { transform: scale(0.97); }
    80% { transform: scale(1.02); }
}
@keyframes ubiShopBtnSuccess{
    0% { background: linear-gradient(135deg, #6737a5, #542a8a); }
    30% { background: #4caf50; }
    100% { background: linear-gradient(135deg, #6737a5, #542a8a); }
}
@keyframes ubiShopBtnLoading{
    to { transform: rotate(360deg); }
}
.wc-block-components-product-button__button.ubi-adding{
    animation: ubiShopBtnBounce .4s cubic-bezier(.2,.8,.2,1) !important;
    pointer-events: none;
}
.wc-block-components-product-button__button.ubi-added{
    animation: ubiShopBtnSuccess .5s ease !important;
}
.wc-block-components-product-button__button.ubi-added::after{
    content:'✓';
    position:absolute;
    inset:0;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:18px;
    color:#fff;
    font-weight:700;
}
/* Enhanced hover effect */
.wc-block-components-product-button__button:hover{
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 28px rgba(103,55,165,.45) !important;
}
.wc-block-components-product-button__button:active{
    transform: translateY(0) scale(.98) !important;
}
/* Shimmer effect on hover */
.wc-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product .wc-block-components-product-button__button:hover::before{
    left:100% !important;
}

/* Cart button animation when item added */
@keyframes ubiCartBounce{
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.2); }
    60% { transform: scale(0.95); }
    80% { transform: scale(1.05); }
}
#ubiCartBtn.ubi-cart-bounce{
    animation: ubiCartBounce .5s cubic-bezier(.2,.8,.2,1) !important;
    background: var(--yellow) !important;
    box-shadow: 0 0 0 4px rgba(255,214,90,.4), 0 6px 20px rgba(103,55,165,.3) !important;
}

/* ===== Product image: fill the card image area =====
   Markup: .wc-block-components-product-image > a > (sale badge, img[data-testid=product-image],
           .wc-block-components-product-image__inner-container)
   WooCommerce ships inline style="object-fit:cover;aspect-ratio:1" on the img; the rules
   below use !important so they win over that inline style.
*/
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-components-product-image{
    position: relative !important;
    width: 100% !important;
    aspect-ratio: 1 / 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: linear-gradient(135deg, #f8f5fb 0%, #f0eaf5 100%) !important;
    overflow: hidden !important;
}
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-components-product-image > a{
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-components-product-image img{
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: cover !important;
    aspect-ratio: auto !important;
    transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-product:hover .wc-block-components-product-image img{
    transform: scale(1.06) !important;
}
/* Empty placeholder WooCommerce renders after the img */
.wp-block-column:last-child .wp-block-woocommerce-product-collection .wc-block-components-product-image__inner-container{
    display: none !important;
}

/* Variable products open the variant modal from the grid; the anchor href stays
   as the no-JS fallback to the product page. */

/* ===== Variant picker modal ("Pilih opsi") ===== */
html.ubi-modal-open{
    overflow: hidden !important;
}
html.ubi-modal-open body{
    padding-right: var(--ubi-scrollbar-w, 0px);
}

dialog.ubi-options{
    width: min(520px, calc(100vw - 32px));
    max-height: min(760px, calc(100vh - 32px));
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 24px;
    background: var(--white);
    color: var(--ink);
    box-shadow: 0 30px 90px rgba(53, 22, 95, .35);
    overflow: hidden;
}
dialog.ubi-options::backdrop{
    background: rgba(53, 22, 95, .48);
}
.ubi-options__panel{
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: inherit;
}
.ubi-options__close{
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--cream);
    color: var(--deep);
    display: grid;
    place-items: center;
    transition: background .2s ease, transform .2s ease;
}
.ubi-options__close:hover{
    background: #f0e4ce;
    transform: rotate(6deg);
}
.ubi-options__close:focus-visible{
    outline: 2px solid var(--deep);
    outline-offset: 2px;
}
.ubi-options__head{
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 24px 24px 0;
}
.ubi-options__img{
    flex: none;
    width: 84px;
    height: 84px;
    border-radius: 16px;
    object-fit: cover;
    background: var(--cream);
}
.ubi-options__headtext{
    min-width: 0;
    padding-right: 36px;
}
.ubi-options__title{
    margin: 0 0 6px;
    font-size: 20px;
    line-height: 1.25;
    color: var(--deep);
}
.ubi-options__detail{
    font-size: 13px;
    font-weight: 600;
    color: var(--purple);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.ubi-options__body{
    padding: 20px 24px 0;
    overflow-y: auto;
    min-height: 0;
}
.ubi-options__group{
    margin-bottom: 18px;
}
.ubi-options__label{
    display: block;
    margin-bottom: 10px;
    font-family: 'Fredoka', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--deep);
}
.ubi-options__swatches{
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.ubi-options__swatch{
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    min-height: 44px;
    padding: 8px 16px;
    border: 1.5px solid rgba(103, 55, 165, .28);
    border-radius: 12px;
    background: var(--white);
    color: var(--deep);
    font-family: 'Fredoka', sans-serif;
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}
.ubi-options__swatch-size{
    font-family: 'DM Sans', sans-serif;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.3;
    opacity: .8;
}
.ubi-options__swatch:hover{
    border-color: var(--purple);
    background: #f7f0ff;
}
.ubi-options__swatch:active{
    transform: scale(.97);
}
.ubi-options__swatch:focus-visible{
    outline: 2px solid var(--deep);
    outline-offset: 2px;
}
.ubi-options__swatch.is-soldout{
    opacity: .6;
    cursor: not-allowed;
    background: #f4f2f6;
    border-color: #ded8e6;
    color: #8b7d9b;
}
.ubi-options__swatch.is-soldout:hover{
    background: #f4f2f6;
    border-color: #ded8e6;
    transform: none;
}
.ubi-options__swatch-out{
    font-size: 10px;
    font-weight: 800;
    color: #b42318;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.ubi-options__swatch[aria-pressed="true"]{
    border-color: var(--purple);
    background: var(--purple);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(103, 55, 165, .3);
}
.ubi-options__note{
    margin: 14px 0 0;
    font-size: 13.5px;
    line-height: 1.55;
    color: #6a587e;
    min-height: 21px;
}
.ubi-options__note.is-error{
    color: #a1243f;
}
.ubi-options__qty{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
}
.ubi-options__qty-label{
    font-family: 'Fredoka', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--deep);
}
.ubi-options__stepper{
    display: flex;
    align-items: center;
    border: 1.5px solid rgba(103, 55, 165, .28);
    border-radius: 12px;
    background: var(--white);
    overflow: hidden;
}
.ubi-options__qty-btn{
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    background: transparent;
    color: var(--deep);
    font-size: 20px;
    font-weight: 600;
    line-height: 1;
    transition: background .2s ease;
}
.ubi-options__qty-btn:hover:not(:disabled){
    background: #f7f0ff;
}
.ubi-options__qty-btn:disabled{
    color: #c4b8d4;
    cursor: not-allowed;
}
.ubi-options__qty-btn:focus-visible{
    outline: 2px solid var(--deep);
    outline-offset: -2px;
}
.ubi-options__qty-input{
    width: 48px;
    height: 44px;
    padding: 0;
    border: 0;
    border-left: 1px solid rgba(53, 22, 95, .1);
    border-right: 1px solid rgba(53, 22, 95, .1);
    background: transparent;
    color: var(--deep);
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}
.ubi-options__qty-input::-webkit-outer-spin-button,
.ubi-options__qty-input::-webkit-inner-spin-button{
    -webkit-appearance: none;
    margin: 0;
}
.ubi-options__qty-input:focus-visible{
    outline: 2px solid var(--deep);
    outline-offset: -2px;
}
.ubi-options__qty-input:disabled{
    color: #a99cb9;
}
.ubi-options__foot{
    margin-top: 18px;
    padding: 16px 24px 22px;
    border-top: 1px solid rgba(53, 22, 95, .1);
    background: linear-gradient(180deg, #fffdf8, var(--cream));
}
.ubi-options__price{
    min-height: 30px;
    margin-bottom: 4px;
    font-family: 'Fredoka', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--deep);
}
.ubi-options__price .woocommerce-Price-currencySymbol{
    margin-right: 1px;
}
.ubi-options__price del{
    font-size: 15px;
    font-weight: 500;
    color: #8a7b9c;
}
.ubi-options__add{
    width: 100%;
    min-height: 50px;
    margin-top: 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, #6737a5, #542a8a);
    color: var(--white);
    font-family: 'Fredoka', sans-serif;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(103, 55, 165, .3);
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.ubi-options__add:not(:disabled):hover{
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(103, 55, 165, .4);
}
.ubi-options__add:not(:disabled):active{
    transform: translateY(0) scale(.99);
}
.ubi-options__add:disabled{
    background: #e7dff2;
    color: #7a6a8f;
    box-shadow: none;
    cursor: not-allowed;
}
.ubi-options__add:focus-visible{
    outline: 2px solid var(--deep);
    outline-offset: 2px;
}
.ubi-options__loading,
.ubi-options__error{
    margin: 4px 0 18px;
    font-size: 14px;
    line-height: 1.55;
    color: #6a587e;
}
.ubi-options__retry{
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 12px;
    border: 1.5px solid var(--purple);
    background: transparent;
    color: var(--purple);
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
}
.ubi-options__retry:focus-visible{
    outline: 2px solid var(--deep);
    outline-offset: 2px;
}

@media (max-width: 480px){
    dialog.ubi-options{
        width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
        border-radius: 20px;
    }
    .ubi-options__head{
        padding: 20px 18px 0;
        gap: 12px;
    }
    .ubi-options__img{
        width: 64px;
        height: 64px;
        border-radius: 14px;
    }
    .ubi-options__title{
        font-size: 17px;
    }
    .ubi-options__body{
        padding: 16px 18px 0;
    }
    .ubi-options__foot{
        padding: 14px 18px 18px;
    }
    .ubi-options__price{
        font-size: 20px;
    }
}

/* Respect the OS motion preference: keep the state change, drop the travel. */
@media (prefers-reduced-motion: reduce){
    .ubi-shop *,
    .ubi-shop *::before,
    .ubi-shop *::after,
    #ubiCartBtn.ubi-cart-bounce{
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
