/* Define animations */
@keyframes ctaPulse {
    0% { transform: scale(1); box-shadow: 0 4px 15px rgba(98, 216, 177, 0.3); }
    50% { transform: scale(1.02); box-shadow: 0 8px 25px rgba(98, 216, 177, 0.5); }
    100% { transform: scale(1); box-shadow: 0 4px 15px rgba(98, 216, 177, 0.3); }
}

@keyframes ctaShine {
    0% {
        left: -100%;
    }
    25% {
        left: 150%;
    }
    100% {
        left: 150%;
    }
}

/* 1. Flexbox layout to align cart and buy-now side-by-side */
.single-product form.cart {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* 2. Hide quantity input */
.single-product form.cart .quantity {
    display: none !important;
}

/* 3. Icon-Only "Add to Cart" Button (Blue, Square) */
.single-product .single_add_to_cart_button {
    float: none !important; /* Overrides Themify float: left */
    width: 54px !important;
    min-width: 54px !important;
    max-width: 54px !important;
    height: 54px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%) !important;
    border: none !important;
    border-radius: 8px !important;
    
    /* Perfect Center Alignment */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
}

/* Cart Icon inside square button */
.single-product .single_add_to_cart_button::before {
    content: '' !important;
    display: block !important;
    width: 32px !important; /* Slightly wider container for both icons */
    height: 20px !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: #ffffff !important;
    /* Two separate icons side-by-side: (+) then (Cart) */
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 20' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3C!-- Plus Icon --%3E%3Cline x1='2' y1='10' x2='8' y2='10'%3E%3C/line%3E%3Cline x1='5' y1='7' x2='5' y2='13'%3E%3C/line%3E%3C!-- Cart Icon --%3E%3Ccircle cx='18' cy='18' r='1.2'%3E%3C/circle%3E%3Ccircle cx='27' cy='18' r='1.2'%3E%3C/circle%3E%3Cpath d='M12 4h3l2.2 8.5a1.5 1.5 0 0 0 1.5 1.1h6.8a1.5 1.5 0 0 0 1.5-1.1L29 7H15'%3E%3C/path%3E%3C/svg%3E") no-repeat center / contain !important;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 20' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3C!-- Plus Icon --%3E%3Cline x1='2' y1='10' x2='8' y2='10'%3E%3C/line%3E%3Cline x1='5' y1='7' x2='5' y2='13'%3E%3C/line%3E%3C!-- Cart Icon --%3E%3Ccircle cx='18' cy='18' r='1.2'%3E%3C/circle%3E%3Ccircle cx='27' cy='18' r='1.2'%3E%3C/circle%3E%3Cpath d='M12 4h3l2.2 8.5a1.5 1.5 0 0 0 1.5 1.1h6.8a1.5 1.5 0 0 0 1.5-1.1L29 7H15'%3E%3C/path%3E%3C/svg%3E") no-repeat center / contain !important;
}

.single-product .single_add_to_cart_button::after {
    display: none !important; /* Hide shine effect on cart button */
}

.single-product .single_add_to_cart_button:hover {
    transform: scale(1.05) !important;
}

/* 4. Main "Beli Sekarang" Button (Fills remaining space + Flashing/Shine Effect) */
/* Fix keyframes to translate pixel-based distances rather than raw left values */
@keyframes ctaShine {
    0% {
        transform: translateX(-150%) skewX(-25deg);
    }
    30%, 100% {
        transform: translateX(300%) skewX(-25deg);
    }
}

@keyframes ctaPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(98, 216, 177, 0.3);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 8px 25px rgba(98, 216, 177, 0.6);
    }
}

/* Base button wrapper */
.single-product .custom-buy-now-button {
    flex: 1 !important;
    height: 54px !important;
    background: #62d8b1 !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    overflow: hidden !important; /* Clips the shine sweep inside border-radius */
    text-decoration: none !important;
    margin: 0 !important;
    animation: ctaPulse 3s infinite ease-in-out !important;
}

/* Text & Icon wrapper sitting above shine */
.single-product .custom-buy-now-button span {
    position: relative !important;
    z-index: 5 !important; /* Forces text to stay on top */
    color: #ffffff !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
    display: flex !important;
    align-items: center !important;
}

/* Instant/Lightning Icon */
.single-product .custom-buy-now-button span::before {
    content: '' !important;
    display: inline-block !important;
    width: 20px !important;
    height: 20px !important;
    margin-right: 8px !important;
    background-color: #ffffff !important;
    /* Clean Shopping Bag SVG Icon */
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z'%3E%3C/path%3E%3Cline x1='3' y1='6' x2='21' y2='6'%3E%3C/line%3E%3Cpath d='M16 10a4 4 0 0 1-8 0'%3E%3C/path%3E%3C/svg%3E") no-repeat center / contain !important;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2L3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4z'%3E%3C/path%3E%3Cline x1='3' y1='6' x2='21' y2='6'%3E%3C/line%3E%3Cpath d='M16 10a4 4 0 0 1-8 0'%3E%3C/path%3E%3C/svg%3E") no-repeat center / contain !important;
}

/* Moving Shine Bar */
.single-product .custom-buy-now-button::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 50% !important;
    height: 100% !important;
    background: linear-gradient(
        90deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.75) 50%, 
        rgba(255, 255, 255, 0) 100%
    ) !important;
    z-index: 2 !important;
    animation: ctaShine 3s infinite ease-in-out !important;
    pointer-events: none !important;
}

.single-product .custom-buy-now-button:hover {
    animation-play-state: paused !important;
    transform: scale(1.02) !important;
    background: #4ec29c !important;
}

.single-product .custom-buy-now-button:active {
    transform: scale(0.98) !important;
}


/* 1. Collapse theme ::before and ::after inside form.cart so Flexbox ignores them */
.single-product form.cart::before,
.single-product form.cart::after {
    content: none !important;
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* 2. Remove default margins on buttons */
.single-product .single_add_to_cart_button,
.single-product .custom-buy-now-button {
    margin: 0 !important;
}

/* 3. Form flexbox container */
.single-product form.cart {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important; /* Space WILL NOW ONLY appear between the 2 buttons */
    width: 100% !important;
    padding: 0 !important;
    margin-top: 0 !important;
}