/* Cart WhatsApp Plugin Styles */

/* Container utama untuk positioning */
.cartwhatsapp-container {
    display: inline-block;
    margin: 10px 0;
    width: auto;
}

/* Layout horizontal - sejajar dengan tombol add to cart */
.cartwhatsapp-container.cartwhatsapp-horizontal {
    display: inline-flex;
    align-items: stretch;
    gap: 12px;
    flex-wrap: nowrap;
}

/* Layout vertical - di bawah tombol add to cart */
.cartwhatsapp-container.cartwhatsapp-vertical {
    display: block;
    margin-top: 15px;
}

/* Tombol WhatsApp */
.cartwhatsapp-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #25D366;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    font-size: 16px;
    padding: 12px 24px !important;
    transition: all 0.3s ease;
    border: 0;
    box-shadow: none;
    min-height: 46px !important;
    line-height: 1.2;
    height: 100%;
    box-sizing: border-box;
}

/* Hover effect */
.cartwhatsapp-button:hover {
    background-color: #128C7E;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    text-decoration: none;
}

/* Active/focus state */
.cartwhatsapp-button:active,
.cartwhatsapp-button:focus {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(37, 211, 102, 0.3);
}

/* Icon WhatsApp */
.cartwhatsapp-button i {
    margin-right: 8px;
    font-size: 1.3em;
    line-height: 1;
}

/* Size variations */
.cartwhatsapp-button.cartwhatsapp-small {
    padding: 8px 16px;
    font-size: 14px;
    min-height: 38px;
}

.cartwhatsapp-button.cartwhatsapp-medium {
    padding: 12px 24px !important;
    font-size: 16px;
    min-height: 46px !important;
}

.cartwhatsapp-button.cartwhatsapp-large {
    padding: 16px 32px;
    font-size: 18px;
    min-height: 54px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .cartwhatsapp-container.cartwhatsapp-horizontal {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .cartwhatsapp-button {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

/* Integration dengan WooCommerce */
.woocommerce div.product form.cart {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 16px;
}

.woocommerce div.product form.cart .quantity {
    margin-bottom: 0;
    margin-right: 10px;
    align-self: center;
}

.woocommerce div.product form.cart .button.single_add_to_cart_button {
    margin-bottom: 0;
    flex-shrink: 0;
}
/* Pastikan kontainer WhatsApp mengikuti tinggi baris */
.woocommerce div.product form.cart .cartwhatsapp-container {
    align-self: stretch;
}

/* Force equal height for WhatsApp button in product form row */
.woocommerce div.product form.cart .cartwhatsapp-container.cartwhatsapp-horizontal .cartwhatsapp-button {
    height: auto !important;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
}

/* Positioning WhatsApp button */
.cartwhatsapp-container {
    order: 3;
    flex-shrink: 0;
}

/* Styling untuk tema Consulting */
.consulting-theme .cartwhatsapp-button {
    border-radius: 4px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Animasi pulse untuk menarik perhatian */
@keyframes whatsapp-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

.cartwhatsapp-button.whatsapp-pulse {
    animation: whatsapp-pulse 2s infinite;
}

/* Loading state */
.cartwhatsapp-button.loading {
    opacity: 0.7;
    pointer-events: none;
}

.cartwhatsapp-button.loading::after {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Accessibility improvements */
.cartwhatsapp-button:focus {
    outline: 2px solid #128C7E;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cartwhatsapp-button {
        border: 2px solid #ffffff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .cartwhatsapp-button {
        transition: none;
    }
    
    .cartwhatsapp-button.whatsapp-pulse {
        animation: none;
    }
}

/* PROTECT DESCRIPTION CONTENT - CartWhatsApp */

/* Hide SKU only in product meta at the top */
.single-product .product .summary .product_meta .sku_wrapper {
    display: none !important;
}

/* Hide Categories only in product meta at the top */
.single-product .product .summary .product_meta .posted_in {
    display: none !important;
}

/* ENSURE: Don't hide any content in description area */
.woocommerce-product-details__short-description,
.woocommerce-product-details__short-description *,
.woocommerce-Tabs-panel--description,
.woocommerce-Tabs-panel--description *,
#tab-description,
#tab-description * {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ENSURE: Don't hide SKU in description content */
.woocommerce-product-details__short-description .sku,
.woocommerce-Tabs-panel--description .sku,
#tab-description .sku {
    display: inline !important;
}

/* ENSURE: Don't hide categories in description content */
.woocommerce-product-details__short-description .posted_in,
.woocommerce-Tabs-panel--description .posted_in,
#tab-description .posted_in,
.woocommerce-product-details__short-description a[rel="tag"],
.woocommerce-Tabs-panel--description a[rel="tag"],
#tab-description a[rel="tag"] {
    display: inline !important;
}
