/*
 Theme Name:   Apexx Child
 Theme URI:    https://wdtapexx.wpengine.com/
 Description:  Apexx Child Theme
 Author:       the WeDesignTech team
 Author URI:   https://wedesignthemes.com/
 Template:     apexx
 Version:      1.0.0
 Text Domain:  apexx-child
*/

/* Registration field icons: override the parent's one-envelope-for-all rule. */
.woocommerce form.register label[for="reg_first_name"]::before,
.woocommerce form.register label[for="reg_last_name"]::before {
    content: "" !important;
    width: 17px;
    height: 17px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23b8b8b8' d='M12 12a5 5 0 1 0 0-10 5 5 0 0 0 0 10Zm0 2c-5.33 0-8 2.67-8 5v1h16v-1c0-2.33-2.67-5-8-5Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.woocommerce form.register label[for="reg_password"]::before,
.woocommerce form.register label[for="reg_password2"]::before {
    content: "" !important;
    width: 17px;
    height: 17px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23b8b8b8' d='M17 8h-1V6a4 4 0 0 0-8 0v2H7a2 2 0 0 0-2 2v10h14V10a2 2 0 0 0-2-2Zm-7-2a2 2 0 0 1 4 0v2h-4V6Zm3 9.73V18h-2v-2.27a2 2 0 1 1 2 0Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.woocommerce form.register label.woocommerce-form__label-for-checkbox {
    padding-left: 0;
}

.woocommerce form.register label.woocommerce-form__label-for-checkbox::before {
    content: none !important;
    display: none !important;
}

/* Apexx draws both a native checkbox and a second box on the adjacent span. */
.woocommerce form.register label.woocommerce-form__label-for-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding-left: 0;
}

.woocommerce form.register input[name="policy_agree"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: inline-block !important;
    flex: 0 0 17px;
    width: 17px !important;
    min-width: 17px !important;
    height: 17px !important;
    min-height: 17px !important;
    margin: 4px 0 0 !important;
    padding: 0 !important;
    border: 5px solid transparent !important;
    outline: 1px solid var(--wdtBodyTxtColor) !important;
    outline-offset: 0;
    box-shadow: inset var(--wdtPrimaryColor) 0 0 0 0;
}

.woocommerce form.register input[name="policy_agree"]:checked {
    box-shadow: inset var(--wdtPrimaryColor) 0 0 0 10px;
}

.woocommerce form.register input[name="policy_agree"] + span::before {
    content: none !important;
    display: none !important;
}

/* Keep WooCommerce's native checkout terms field; suppress Apexx's duplicate box. */
.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper label.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper #terms {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: inline-block !important;
    flex: 0 0 17px;
    width: 17px !important;
    min-width: 17px !important;
    height: 17px !important;
    min-height: 17px !important;
    margin: -4px 0 0 !important;
    padding: 0 !important;
    border: 5px solid transparent !important;
    outline: 1px solid var(--wdtBodyTxtColor) !important;
    outline-offset: 0;
    box-shadow: inset var(--wdtPrimaryColor) 0 0 0 0;
}

.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper #terms:checked {
    box-shadow: inset var(--wdtPrimaryColor) 0 0 0 10px;
}

.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper #terms + .woocommerce-terms-and-conditions-checkbox-text::before {
    content: none !important;
    display: none !important;
}

/* Make the selected product category visible in the sidebar filter. */
.woocommerce .widget_product_categories .product-categories li.current-cat > a,
.woocommerce .widget_product_categories .product-categories li.current-cat-parent > a {
    color: var(--wdtPrimaryColor);
    font-weight: 600;
}

/* Click-to-copy hint without changing the product title typography. */
.single-product .product_title.click-copy-initialized {
    position: relative;
}

.single-product .product_title.click-copy-initialized::after {
    content: attr(data-hint);
    position: absolute;
    left: 0;
    bottom: calc(100% + 7px);
    z-index: 30;
    padding: 5px 8px;
    border-radius: 3px;
    background: #111;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-style: normal;
    font-weight: 500;
    letter-spacing: normal;
    line-height: 1.2;
    text-transform: none;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateY(3px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.single-product .product_title.click-copy-initialized:hover::after,
.single-product .product_title.click-copy-initialized:focus-visible::after {
    opacity: 1;
    transform: translateY(0);
}
