/*
Theme Name: My Child Theme
Theme URI: http://example.com/my-child-theme
Description: A child theme for WooCommerce with custom functionalities and styles.
Author: Your Name
Author URI: http://example.com
Template: parent-theme-folder-name
Version: 1.0
*/

/* Add your custom styles below */

/* Ensure mini-cart / sidebar "Change Profile Address" button text is centered */
.bb-profile-address-btn,
.empty-cart-address-action .bb-profile-address-btn {
    display: flex !important;           /* use flex so alignment is deterministic */
    justify-content: center !important; /* horizontal center */
    align-items: center !important;     /* vertical center */
    width: 100% !important;             /* fill available width in sidebar */
    box-sizing: border-box !important;

    /* enforce equal horizontal padding so the text truly sits centered */
    padding: 0.9em 1.6em !important;
    margin: 0 0 24px !important;

    /* text centering protections */
    text-align: center !important;
    text-indent: 0 !important;
    line-height: 1 !important;
    white-space: normal !important;
}

/* remove any theme pseudo content that can shift the text */
.bb-profile-address-btn::before,
.bb-profile-address-btn::after,
.empty-cart-address-action .bb-profile-address-btn::before,
.empty-cart-address-action .bb-profile-address-btn::after {
    content: none !important;
    display: none !important;
    width: 0 !important;
    margin: 0 !important;
}

/* fallback: if theme forces extra left padding on .button, neutralize it for this button */
.bb-profile-address-btn.button,
.empty-cart-address-action .bb-profile-address-btn.button {
    padding-left: 1.6em !important;
    padding-right: 1.6em !important;
}

/* stronger, targeted mini-cart button centering */
.widget_shopping_cart_content .bb-profile-address-btn,
.woocommerce-mini-cart .bb-profile-address-btn {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    text-align: center !important;
    box-sizing: border-box !important;
    padding: 0.9em 1.6em !important;
}

/* remove pseudo insertions that shift layout */
.widget_shopping_cart_content .bb-profile-address-btn::before,
.widget_shopping_cart_content .bb-profile-address-btn::after {
    content: none !important;
    display: none !important;
}

/* inner span to tweak vertical placement if needed */
.widget_shopping_cart_content .bb-profile-address-btn span {
    display: inline-block;
    line-height: 1 !important;
}

/* Force-optical center: absolute center the inner span inside the button */
.woocommerce .widget_shopping_cart_content .bb-profile-address-btn,
.woocommerce .woocommerce-mini-cart .bb-profile-address-btn,
.widget_shopping_cart_content .bb-profile-address-btn {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    padding-left: 2.2em !important;   /* preserve any left visual affordance */
    padding-right: 2.2em !important;  /* keep symmetry */
    box-sizing: border-box !important;
}

/* Remove interfering pseudo content */
.woocommerce .widget_shopping_cart_content .bb-profile-address-btn::before,
.woocommerce .widget_shopping_cart_content .bb-profile-address-btn::after {
    content: none !important;
    display: none !important;
}

/* Absolute center the visible text regardless of padding/icons */
.woocommerce .widget_shopping_cart_content .bb-profile-address-btn span {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    display: inline-block !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    text-align: center !important;
    width: auto !important;
}
