/*
 Theme Name:   Woodmart Child
 Description:  Woodmart Child Theme
 Author:       XTemos
 Author URI:   http://xtemos.com
 Template:     woodmart
 Version:      1.0.0
 Text Domain:  woodmart
*/

/* Swatches Styling */
.wd-swatches-product .wd-swatch.wd-text {
    background-color: #0A0A0A !important;
    color:            #ffffff !important;
    border:           none !important;
    box-shadow:       none !important;
    transition:       background-color .25s ease, transform .2s ease !important;
    min-width:        55px !important;
    height:           36px !important;
    border-radius:    4px !important;
}

@media (hover: hover) {
    .wd-swatches-product .wd-swatch.wd-text:hover:not(.wd-disabled) {
        background-color: #FF0604 !important;
        transform:        translateY(-2px) !important;
    }
}

.wd-swatches-product .wd-swatch.wd-text.wd-active {
    background-color: #FF0604 !important;
}

/* Quantity Box (Plus/Minus) Size */
div.quantity input[type="button"].minus,
div.quantity input[type="button"].plus,
div.quantity button.minus,
div.quantity button.plus {
    width: 40px !important;
    font-size: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

div.quantity input[type="number"].qty {
    width: 50px !important;
    font-size: 16px !important;
    text-align: center !important;
}

/* Plus / Minus Hover */
div.quantity input[type="button"].minus:hover,
div.quantity input[type="button"].plus:hover,
div.quantity button.minus:hover,
div.quantity button.plus:hover {
    background-color: #FF6B00 !important;
    color: #fff !important;
    transform: scale(1.08);
}

/* Add to Cart Single Button Animation */
@keyframes aurionCartPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 6, 4, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 6, 4, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 6, 4, 0); }
}

form.cart .single_add_to_cart_button {
    animation: aurionCartPulse 2s infinite !important;
}

/* WhatsApp Floating Button & Animations */
button.wh-ap-btn {
    width: 50px;
    height: 50px;
    border: 0;
    padding: 0;
    border-radius: 50%;
    background: #2ecc71;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,.2);
}

button.wh-ap-btn::after {
    content: "";
    width: 100%;
    height: 100%;
    display: block;
    background: url("/wp-content/uploads/2026/08/whatsapp-icon.webp") center / 60% no-repeat;
}

.wh-api {
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 999999;
}

.wh-fixed {
    margin: 15px;
}

.wh-fixed > a {
    display: block;
    text-decoration: none;
}

.whatsapp-pulse {
    position: fixed;
    bottom: 35px;
    right: 15px;
    width: 50px;
    height: 50px;
    background: transparent;
    border-radius: 50%;
    z-index: 999999;
}

.whatsapp-pulse::before {
    content: "";
    position: absolute;
    inset: -12px;
    background: #10b418;
    border-radius: 50%;
    opacity: .4;
    animation: pulse 2.8s ease-out infinite;
}

@keyframes pulse {
    0% { transform: scale(.7); opacity: 0; }
    50% { transform: scale(1); opacity: .4; }
    100% { transform: scale(1.3); opacity: 0; }
}

.shake:hover {
    animation: shake .6s ease-in-out;
}

@keyframes shake {
    25% { transform: translateX(-2px); }
    50% { transform: translateX(2px); }
    75% { transform: translateX(-2px); }
}

/* ==========================================================================
   Add to Cart & Order Now Buttons (Common Reset & Base Styles)
   ========================================================================== */
.wd-add-btn {
    position: relative !important;
    overflow: visible !important;
    height: auto !important;
    width: 100% !important;
}

.wd-add-btn > a,
.wd-add-btn .button,
.order-now-btn,
form.cart .single_add_to_cart_button,
form.cart .wd-buy-now-btn {
    border-radius: 6px !important;
    font-weight: 700 !important;
    text-align: center !important;
    justify-content: center !important;
    align-items: center !important;
    display: inline-flex !important;
    border: none !important;
    box-shadow: none !important;
    text-transform: uppercase !important;
    margin: 0 !important;
    position: relative !important;
    top: 0 !important;
    transform: none !important;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease !important;
    letter-spacing: 0.3px !important;
    text-indent: 0 !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    text-decoration: none !important;
}

/* Disable Hover Animations & Pseudo Icon Elements Only */
.wd-add-btn-replace > a {
    --wd-btn-icon: none !important;
}

.wd-add-btn a:before,
.wd-add-btn a:after,
.wd-add-btn a:hover:before,
.wd-add-btn a:hover:after,
.wd-add-btn .wd-action-icon,
.wd-add-btn i,
.wd-add-btn svg,
form.cart .single_add_to_cart_button:before,
form.cart .single_add_to_cart_button:after,
form.cart .single_add_to_cart_button:hover:before,
form.cart .single_add_to_cart_button:hover:after {
    display: none !important;
    content: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
}

.wd-add-btn a span,
.wd-add-btn a .add-to-cart-loop,
.order-now-btn span {
    position: static !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: inherit !important;
    height: auto !important;
    width: auto !important;
    transition: none !important;
    white-space: nowrap !important;
}

/* Prevent Woodmart from truncating button text with ellipsis */
.wd-product.wd-hover-fw-button .add-to-cart-loop .wd-action-text {
    overflow: visible !important;
    text-overflow: unset !important;
    white-space: nowrap !important;
    display: inline !important;
    padding: 0 !important;
    line-height: inherit !important;
}

/* Hide WooCommerce default loop added_to_cart view-cart badge */
.wd-add-btn .added_to_cart {
    display: none !important;
}

/* ==========================================================================
   Desktop / Tablet Layout (> 768px): Side-by-side Buttons
   ========================================================================== */
@media (min-width: 769px) {
    .wd-add-btn {
        display: flex !important;
        flex-direction: row !important;
        gap: 6px !important;
        margin-top: 10px !important;
        width: 100% !important;
    }

    .wd-add-btn > a,
    .wd-add-btn .button,
    .order-now-btn {
        flex: 1 1 0% !important;
        width: 50% !important;
        min-width: 0 !important;
        height: 38px !important;
        line-height: 38px !important;
        background-color: #FF6B00 !important;
        color: #FFFFFF !important;
        font-size: 12px !important;
        padding: 0 4px !important;
    }

    .wd-add-btn > a:hover,
    .wd-add-btn .button:hover,
    .order-now-btn:hover {
        background-color: #d95f07 !important;
        color: #ffffff !important;
    }
}

/* ==========================================================================
   Mobile Layout (<= 768px): Vertical Stacked Buttons (Full Visibility)
   ========================================================================== */
@media (max-width: 768.98px) {
    .wd-add-btn {
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
        margin-top: 8px !important;
        width: 100% !important;
    }

    /* 1. ORDER NOW (Primary CTA Button - Placed on Top) */
    .wd-add-btn .order-now-btn {
        order: 1 !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        height: 38px !important;
        line-height: 38px !important;
        background-color: #FF6B00 !important;
        color: #FFFFFF !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        letter-spacing: 0.5px !important;
        border-radius: 6px !important;
        padding: 0 8px !important;
        white-space: nowrap !important;
    }

    .wd-add-btn .order-now-btn:hover {
        background-color: #d95f07 !important;
        color: #FFFFFF !important;
    }

    /* 2. ADD TO CART (Secondary Button - Placed Below ORDER NOW) */
    .wd-add-btn > a.add_to_cart_button,
    .wd-add-btn > a.add-to-cart-loop,
    .wd-add-btn > a:not(.order-now-btn) {
        order: 2 !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        height: 36px !important;
        line-height: 33px !important;
        background-color: transparent !important;
        color: #FF6B00 !important;
        border: 1.5px solid #FF6B00 !important;
        font-size: 12px !important;
        font-weight: 700 !important;
        letter-spacing: 0.5px !important;
        border-radius: 6px !important;
        padding: 0 8px !important;
        white-space: nowrap !important;
    }

    .wd-add-btn > a.add_to_cart_button:hover,
    .wd-add-btn > a.add-to-cart-loop:hover,
    .wd-add-btn > a:not(.order-now-btn):hover {
        background-color: #FFF3EB !important;
        color: #FF6B00 !important;
    }

    /* Mobile: Hide right-floating cart widget to avoid overlapping product cards */
    a.custom-floating-cart-widget {
        display: none !important;
    }

    /* WhatsApp floating button positioning safely above bottom mobile navbar */
    .whatsapp-pulse {
        bottom: 65px !important;
        right: 12px !important;
    }
}

/* ==========================================================================
   Single Product Page (form.cart)
   ========================================================================== */
form.cart {
    display: flex !important;
    gap: 8px !important;
    width: 100% !important;
    margin-top: 10px !important;
    position: relative !important;
    overflow: visible !important;
    height: auto !important;
    flex-wrap: wrap !important;
}

form.cart .single_add_to_cart_button,
form.cart .wd-buy-now-btn {
    flex: 1 1 0% !important;
    min-width: 130px !important;
    height: 42px !important;
    line-height: 42px !important;
    border-radius: 6px !important;
    background-color: #FF6B00 !important;
    color: #FFFFFF !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    padding: 0 10px !important;
}

form.cart .single_add_to_cart_button:hover,
form.cart .wd-buy-now-btn:hover {
    background-color: #d95f07 !important;
    color: #ffffff !important;
}

/* ==========================================================================
   Floating Side Cart Widget (Desktop Right Edge)
   ========================================================================== */
@media (min-width: 769px) {
    a.custom-floating-cart-widget {
        position: fixed !important;
        right: 0 !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 999999 !important;
        background-color: #1C3B53 !important;
        color: #ffffff !important;
        padding: 10px 8px !important;
        border-radius: 12px 0 0 12px !important;
        box-shadow: -4px 2px 15px rgba(0, 0, 0, 0.25) !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-decoration: none !important;
        text-align: center !important;
        min-width: 65px !important;
        cursor: pointer !important;
        transition: background-color 0.25s ease, transform 0.2s ease !important;
    }

    a.custom-floating-cart-widget:hover {
        background-color: #122838 !important;
        color: #ffffff !important;
        transform: translateY(-50%) translateX(-3px) !important;
    }
}

.floating-cart-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 4px !important;
    color: #ffffff !important;
}

.floating-cart-icon svg {
    stroke: #ffffff !important;
}

.floating-cart-count {
    font-size: 11px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
    color: #ffffff !important;
    margin-bottom: 4px !important;
    white-space: nowrap !important;
}

.floating-cart-total {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    white-space: nowrap !important;
    background: rgba(0, 0, 0, 0.25) !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
}

.floating-cart-total bdi,
.floating-cart-total span {
    color: #ffffff !important;
}

/* ==========================================================================
   Cart Page Specific Enhancements
   ========================================================================== */
.cart-content-wrapper .checkout-button,
.wc-proceed-to-checkout .checkout-button {
    background-color: #FF6B00 !important;
    color: #FFFFFF !important;
    border-radius: 6px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    height: 44px !important;
    line-height: 44px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    text-align: center !important;
    display: block !important;
    width: 100% !important;
    transition: background-color 0.2s ease !important;
}

.cart-content-wrapper .checkout-button:hover,
.wc-proceed-to-checkout .checkout-button:hover {
    background-color: #d95f07 !important;
    color: #ffffff !important;
}
