/**
 * Styles for functionality that was completed or added during the theme
 * audit/fix pass. Kept in its own file (rather than merged into the
 * original CSS files) so a reviewer can see everything that's new in one
 * place.
 */

/* Out-of-stock product cards (woocommerce/content-product.php) */
.product-card.is-out-of-stock .product-image-wrap img {
    opacity: 0.55;
}
.product-card .sold-out-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    background: #6b7280;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.add-cart-btn.disabled {
    pointer-events: none;
    opacity: 0.6;
}

/* Native WooCommerce variation form (woocommerce_variable_add_to_cart) -
   this theme disables WooCommerce's own default stylesheet everywhere, so
   the variation form needs its own styling to match the rest of the site
   rather than rendering unstyled. */
.variations_form .variations {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
}
.variations_form .variations tr {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.75rem;
}
.variations_form .variations label {
    font-weight: 600;
    margin-bottom: 0.35rem;
}
.variations_form .variations select {
    width: 100%;
    padding: 0.6rem 0.9rem;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background: #fff;
    font-size: 0.95rem;
}
.variations_form .reset_variations {
    display: inline-block;
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: #6b7280;
    text-decoration: underline;
}
.variations_form .woocommerce-variation-price {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0.75rem 0;
}
.variations_form .woocommerce-variation-availability {
    margin-bottom: 0.75rem;
}
.variations_form .woocommerce-variation-add-to-cart {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.variations_form .quantity input.qty {
    width: 90px;
    padding: 0.6rem;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
}
.variations_form .single_add_to_cart_button {
    background: #111;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.85rem 2rem;
    font-weight: 600;
}
.variations_form .single_add_to_cart_button.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Cart page - row updating state */
.cart-product.is-updating {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

/* Cart-page / mini-cart free-shipping progress bar */
.free-shipping-bar {
    padding: 12px 16px;
}
.free-shipping-bar .bar {
    --progress: 0%;
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: #e9e9e9;
    overflow: hidden;
    margin-bottom: 8px;
}
.free-shipping-bar .bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--progress);
    background: #16a34a;
    border-radius: 999px;
    transition: width 0.3s ease;
}
.free-shipping-bar p {
    margin: 0;
    font-size: 0.85rem;
    text-align: center;
}

/* Mini-cart upsells */
.cart-upsells {
    padding: 12px 16px;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}
.cart-upsells h6 {
    margin-bottom: 10px;
    font-size: 0.9rem;
    font-weight: 600;
}
#upsellList {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.upsell-item {
    flex: 0 0 110px;
    text-align: center;
}
.upsell-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 6px;
}
.upsell-item-name {
    display: block;
    font-size: 0.75rem;
    color: #111;
    text-decoration: none;
    line-height: 1.2;
    margin-bottom: 2px;
}
.upsell-item-price {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 6px;
}
.upsell-add-btn {
    width: 100%;
    font-size: 0.75rem;
    padding: 4px 0;
    border-radius: 999px;
    border: 1px solid #111;
    background: #fff;
}
.upsell-add-btn:disabled {
    opacity: 0.5;
}

/* Checkout coupon: applied-coupon pills + inline error message */
.applied-coupon-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eef6ee;
    color: #16a34a;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0 6px 6px 0;
}
.applied-coupon-pill .remove-coupon {
    border: none;
    background: none;
    color: inherit;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}
.coupon-message {
    font-size: 0.8rem;
}

/* Footer social icons */
.footer-socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f3f3f3;
    color: #111;
    font-size: 1rem;
}

/* Reviews: error message + empty state already inherit surrounding
   typography, only the color needs setting. */
.review-error-message {
    font-size: 0.85rem;
}

/* Product gallery: subtle shimmer while a newly-clicked thumbnail's
   full-resolution image is still downloading, so swapping images never
   shows a blank flash (see assets/js/product-page.js). */
.main-image-wrap.media-loading {
    position: relative;
}
.main-image-wrap.media-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.35);
    animation: ebiz-media-pulse 1s ease-in-out infinite;
    pointer-events: none;
}
@keyframes ebiz-media-pulse {
    0%, 100% { opacity: 0.25; }
    50%      { opacity: 0.55; }
}
