/**
 * CSS styles for WooCommerce Product Cards (Global Loop Override)
 */

li.product.product-card {
    /* Common hover style variables */
    --btn-hover-bg: #1a1a1a;
    --btn-hover-border: #1a1a1a;
    --btn-hover-text: #ffffff;

    font-family: 'Roboto', sans-serif !important;
    background: #ffffff;
    border: 1px solid #D6DBE1;
    border-radius: 32px;
    overflow: hidden;
    display: flex !important;
    flex-direction: column !important;
    height: 100%;
    padding: 0 !important;
    /* Override standard WooCommerce padding */
    margin: 0 !important;
    box-sizing: border-box;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);

    /* Initial state for entrance reveal animation (Subtle & Premium) */
    opacity: 0;
    transform: translateY(15px) scale(0.98);
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1),
        transform 1.2s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.3s ease;
    will-change: transform, opacity;
}

/* Active state when scrolled into view */
li.product.product-card.reveal-active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Force Roboto font-family on all nested elements */
li.product.product-card,
li.product.product-card * {
    font-family: 'Roboto', sans-serif !important;
}

/* Snappy transition for hover effect once active */
li.product.product-card.reveal-active {
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.3s ease;
}

li.product.product-card.reveal-active:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.product-card-image-wrapper {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
}

.product-card-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    margin: 0 !important;
}

li.product.product-card:hover .product-card-image-wrapper img {
    transform: scale(1.05);
}

.product-card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 16px;
}

.product-card-body-wrapper {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: space-between;
}

.product-card-info-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-grow: 1;
    /* Stretch to fill card body height */
}


.product-card-title {
    font-size: 18px;
    font-weight: 700;
    padding: 0 !important;
    /* Allow title to expand naturally to show full text */
}

.product-card-title a {
    color: #1a202c;
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-card-attributes {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
    /* Push attributes, price, and actions to the bottom to align them */
}

.product-attr-item {
    font-size: 13px;
    line-height: 1.4;
    color: #4A5568;
    display: flex;
    gap: 4px;
}

.product-attr-item .attr-label,
.product-attr-item .attr-value {
    color: #0A0A0A;
    font-size: 16px;
}

.product-card-price {
    font-size: 20px;
    font-weight: 600;
    color: #853F13;
}

.product-card-price del {
    font-size: 0.95rem;
    color: #a0aec0;
    font-weight: 400;
    margin-right: 6px;
}

.product-card-price ins {
    text-decoration: none;
}

/* Actions */
.product-card-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
    /* Push actions to the bottom */
    align-items: center;
    margin-top: 20px;
}

.product-card-btn-buy {
    flex-grow: 1;
    background: #0A0A0A;
    color: #ffffff;
    border: none;
    padding-top: 9.5px;
    padding-bottom: 10.5px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    border-radius: 30px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease;
}

.product-card-btn-buy:hover {
    background: var(--btn-hover-bg);
    color: var(--btn-hover-text);
}

.product-card-btn-cart {
    width: 40px !important;
    height: 40px !important;
    margin: 0 !important;
    border-radius: 50%;
    border: 1px solid #E5E5E5 !important;
    background-color: #FFF !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 10px !important;
    flex-shrink: 0;
    line-height: 0;
    box-sizing: border-box !important;
}

a.button.product-card-btn-cart:hover,
.woocommerce a.button.product-card-btn-cart:hover {
    background: #0A0A0A !important;
    border-color: #0A0A0A !important;
    color: #ffffff !important;
}

.product-card-btn-cart:hover img {
    filter: invert(1) brightness(100) !important;
}

.product-card-btn-cart svg,
.product-card-btn-cart .product-card-cart-icon {
    width: 16px !important;
    height: 16px !important;
    object-fit: contain;
}

/* WooCommerce loading / added state styling overrides on the cart button */
.woocommerce a.button.product-card-btn-cart.loading {
    position: relative !important;
    color: transparent !important;
    opacity: 1 !important;
    /* Prevent default WooCommerce/Astra opacity fade */
}

.woocommerce a.button.product-card-btn-cart.loading::after {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    margin-left: -9px !important;
    margin-top: -9px !important;
    content: "" !important;
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    background-color: transparent !important;
    background-image: url('../../images/loading.svg') !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    border: none !important;
    border-radius: 0 !important;
    animation: none !important;
}



/* Hide default WooCommerce/Theme loaders and checkmarks on the cart button */
.woocommerce a.button.product-card-btn-cart.added::after,
.woocommerce a.button.product-card-btn-cart.added::before,
.woocommerce a.button.product-card-btn-cart.loading::before {
    display: none !important;
    content: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.woocommerce a.button.product-card-btn-cart.loading,
.woocommerce a.button.product-card-btn-cart.added {
    text-indent: 0 !important;
    font-size: 0 !important;
}

/* Force show the cart SVG image icon under all normal and added states */
.woocommerce a.button.product-card-btn-cart img.product-card-cart-icon,
.woocommerce a.button.product-card-btn-cart.added img.product-card-cart-icon {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 16px !important;
    height: 16px !important;
    transform: none !important;
}

/* Hide the cart SVG image icon ONLY when the loading class is active */
.woocommerce a.button.product-card-btn-cart.loading img.product-card-cart-icon {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

.no-products-found {
    grid-column: 1 / -1;
    text-align: center;
    color: #718096;
    padding: 40px 0;
    font-size: 1.1rem;
}

/* Hide WooCommerce default "View cart" link next to ajax add to cart buttons */
.added_to_cart.wc-forward {
    display: none !important;
}

/* Custom premium Add to Cart Toast notification */
.woo-added-to-cart-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #111111;
    color: #ffffff;
    padding: 14px 28px;
    border-radius: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 999999;
    display: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
}

.woo-added-to-cart-toast .toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.woo-added-to-cart-toast .toast-icon {
    background: #4caf50;
    color: #ffffff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    flex-shrink: 0;
}

.woo-added-to-cart-toast .toast-message {
    white-space: nowrap;
}