/* ============================================================
   Checkout – Collapsible billing address section

   No class gate needed. Selectors are scoped to checkout-specific
   elements that don't exist on other pages:
   - .wp-block-woocommerce-checkout-billing-address-block (checkout block only)
   - form.checkout .woocommerce-billing-fields (checkout form only)
   - .wdj-billing-section (added by JS only when billing section found)
   ============================================================ */

/* ---- Toggle button ---- */

.wdj-billing-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #a1a1aa;
    text-align: left;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.wdj-billing-toggle:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #e4e4e7;
    border-color: rgba(255, 255, 255, 0.2);
}

.wdj-billing-toggle[aria-expanded="true"] {
    color: #FDDA47;
    border-color: rgba(253, 218, 71, 0.3);
    background-color: rgba(253, 218, 71, 0.05);
}

.wdj-billing-toggle__icon {
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.wdj-billing-toggle[aria-expanded="true"] .wdj-billing-toggle__icon {
    transform: rotate(180deg);
}

/* ---- Block checkout – billing address block ---- */

.wp-block-woocommerce-checkout-billing-address-block {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease;
}

.wdj-billing-open .wp-block-woocommerce-checkout-billing-address-block {
    max-height: 1600px;
    opacity: 1;
}

/* ---- Classic checkout – billing fields (scoped to checkout form) ---- */

form.checkout .woocommerce-billing-fields {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease;
}

form.checkout.wdj-billing-open .woocommerce-billing-fields {
    max-height: 1600px;
    opacity: 1;
}

/* ---- Heading-text fallback (class added by JS) ---- */

.wdj-billing-section {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease;
}

.wdj-billing-open .wdj-billing-section {
    max-height: 1600px;
    opacity: 1;
}
