/* === ULTRA AGGRESSIVE: PayPal darf NIE unseren Button verstecken === */

/* Bei PayPal Auswahl MUSS der Button IMMER sichtbar sein */
body.woocommerce-checkout #payment .payment_method_ppcp-gateway:checked ~ * .wcc-place-order-section,
body.woocommerce-checkout #payment .payment_method_paypal:checked ~ * .wcc-place-order-section,
body.woocommerce-checkout .payment_method_ppcp-gateway:checked ~ * .wcc-smart-button-container,
body.woocommerce-checkout .payment_method_paypal:checked ~ * .wcc-smart-button-container {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    width: auto !important;
    position: relative !important;
    z-index: 9999 !important;
    pointer-events: auto !important;
}

/* Der Place Order Button selbst - aber OHNE display:flex damit Preis-Layout funktioniert */
body.woocommerce-checkout #place_order {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 9999 !important;
}

/* Wenn PayPal ausgewählt ist */
body.woocommerce-checkout li.payment_method_ppcp-gateway.checked .wcc-place-order-section,
body.woocommerce-checkout li.payment_method_paypal.checked .wcc-place-order-section,
body.woocommerce-checkout li.payment_method_ppcp-gateway.checked .wcc-smart-button-container,
body.woocommerce-checkout li.payment_method_paypal.checked .wcc-smart-button-container {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Verhindere dass irgendwas unseren Button überlappt */
body.woocommerce-checkout .payment_box.payment_method_ppcp-gateway,
body.woocommerce-checkout .payment_box.payment_method_paypal {
    position: relative !important;
    z-index: 1 !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Data-Attribute Protection */
[data-paypal-protect="true"],
[data-paypal-no-hide="true"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Smart Button Container spezifisch */
body.woocommerce-checkout .wcc-smart-button-container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin-top: 20px !important;
}

/* WICHTIG: Preis-Elemente dürfen NICHT mit !important überschrieben werden */
/* Entferne die Regeln für Preis-Elemente, damit sie normal funktionieren */

/* Stelle sicher dass Button-Layout korrekt ist */
body.woocommerce-checkout #place_order {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
}

/* Überschreibe ALLE möglichen hide Klassen */
body.woocommerce-checkout .wcc-place-order-section.hidden,
body.woocommerce-checkout .wcc-place-order-section.hide,
body.woocommerce-checkout .wcc-place-order-section.paypal-hidden {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

body.woocommerce-checkout .wcc-smart-button-container.hidden,
body.woocommerce-checkout .wcc-smart-button-container.hide,
body.woocommerce-checkout .wcc-smart-button-container.paypal-hidden {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

body.woocommerce-checkout #place_order.hidden,
body.woocommerce-checkout #place_order.hide,
body.woocommerce-checkout #place_order.paypal-hidden {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Verhindere inline styles */
body.woocommerce-checkout .wcc-place-order-section[style*="display: none"],
body.woocommerce-checkout .wcc-place-order-section[style*="display:none"],
body.woocommerce-checkout .wcc-place-order-section[style*="visibility: hidden"],
body.woocommerce-checkout .wcc-place-order-section[style*="visibility:hidden"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

body.woocommerce-checkout .wcc-smart-button-container[style*="display: none"],
body.woocommerce-checkout .wcc-smart-button-container[style*="display:none"],
body.woocommerce-checkout .wcc-smart-button-container[style*="visibility: hidden"],
body.woocommerce-checkout .wcc-smart-button-container[style*="visibility:hidden"] {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

body.woocommerce-checkout #place_order[style*="display: none"],
body.woocommerce-checkout #place_order[style*="display:none"],
body.woocommerce-checkout #place_order[style*="visibility: hidden"],
body.woocommerce-checkout #place_order[style*="visibility:hidden"] {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}