/* BANUK Account Layout Hardening — stage scoped, 2026-11-09.
   Only the WooCommerce element whose immediate children are account nav and content
   should become a two-column layout. Outer shortcode containers remain block.
*/
body.woocommerce-account #main,
body.woocommerce-account main#main,
body.woocommerce-account .wp-block-post-content,
body.woocommerce-account .entry-content {
  min-width: 0;
  box-sizing: border-box;
}
body.woocommerce-account .entry-content:has(.woocommerce-MyAccount-navigation) {
  width: 100%;
  max-width: 1400px;
  margin-inline: auto;
  padding-inline: clamp(15px, 3.4vw, 52px);
  box-sizing: border-box;
}
body.woocommerce-account .woocommerce,
body.logged-in.woocommerce-account .woocommerce,
body:not(.logged-in).woocommerce-account .woocommerce {
  display: block !important;
  grid-template-columns: none !important;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
body.woocommerce-account .woocommerce.bn-account-layout-root,
body.woocommerce-account .woocommerce:has(> .woocommerce-MyAccount-navigation):has(> .woocommerce-MyAccount-content) {
  display: grid !important;
  grid-template-columns: minmax(215px,245px) minmax(0,1fr) !important;
  column-gap: clamp(20px, 3.4vw, 48px) !important;
  row-gap: 16px !important;
  align-items: start;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}
body.woocommerce-account .woocommerce.bn-account-layout-root::before,
body.woocommerce-account .woocommerce.bn-account-layout-root::after,
body.woocommerce-account .woocommerce:has(> .woocommerce-MyAccount-navigation)::before,
body.woocommerce-account .woocommerce:has(> .woocommerce-MyAccount-navigation)::after {
  display: none !important;
  content: none !important;
}
body.woocommerce-account .bn-account-layout-root > .woocommerce-notices-wrapper,
body.woocommerce-account .woocommerce:has(> .woocommerce-MyAccount-navigation) > .woocommerce-notices-wrapper {
  grid-column: 1 / -1 !important;
  width: 100%;
  min-width: 0;
}
body.woocommerce-account .bn-account-layout-root > .woocommerce-MyAccount-navigation,
body.woocommerce-account .woocommerce:has(> .woocommerce-MyAccount-navigation) > .woocommerce-MyAccount-navigation {
  grid-column: 1 !important;
  grid-row: auto !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  float: none !important;
  margin: 0 !important;
  align-self: start;
}
body.woocommerce-account .bn-account-layout-root > .woocommerce-MyAccount-content,
body.woocommerce-account .woocommerce:has(> .woocommerce-MyAccount-navigation) > .woocommerce-MyAccount-content {
  grid-column: 2 !important;
  grid-row: auto !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  float: none !important;
  margin: 0 !important;
  overflow-wrap: anywhere;
}
body.woocommerce-account :is(.bn-dashboard,.bn-orders,.bn-wallet-page,.bn-dashboard__panel,.bn-order-card) {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}
body.woocommerce-account .bn-dashboard__stats {
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px;
}
body.woocommerce-account .bn-stat {min-width: 0; padding: 20px 16px;}
body.woocommerce-account .bn-stat strong {overflow-wrap:normal;word-break:normal;line-height:1.5;}
body.woocommerce-account .bn-dashboard__intro > div {min-width:0;flex:1;}
body.woocommerce-account .bn-dashboard__intro {align-items:flex-start;}
body.woocommerce-account .bn-dashboard__intro .bn-btn {flex:0 0 auto;}
body.woocommerce-account .bn-dashboard__lower {grid-template-columns: repeat(2,minmax(0,1fr));}
body.woocommerce-account .bn-dashboard__lower > * {min-width:0}
body.woocommerce-account .bn-product-cards {grid-template-columns:repeat(3,minmax(0,1fr));}
body.woocommerce-account .bn-product-card__media img {max-width:100%}
body.woocommerce-account .bn-wallet-page {width:100%!important;max-width:none!important;}
body.woocommerce-account .bn-wallet-stats {grid-template-columns:repeat(3,minmax(0,1fr));}
body.woocommerce-account .bn-wallet-stats > div {min-width:0;overflow-wrap:anywhere}
body.woocommerce-account .bn-wallet-ledger {max-width:100%;overflow-x:auto;}
body.woocommerce-account .bn-wallet-ledger__head,
body.woocommerce-account .bn-wallet-ledger__row {min-width:0;}
body.woocommerce-account :is(.woocommerce-EditAccountForm,.woocommerce-address-fields) {
  max-width:100% !important;
}
body.woocommerce-account :is(.woocommerce-EditAccountForm,.woocommerce-address-fields__field-wrapper,.woocommerce-Addresses) > * {
  min-width:0;
}
body.woocommerce-account .bn-order-card__body {min-width:0}
body.woocommerce-account :is(.woocommerce-MyAccount-content,.woocommerce-MyAccount-navigation) > :first-child {margin-top:0}
body.woocommerce-account .woocommerce .bn-dashboard__intro h2 {
  font-size:clamp(24px,2.4vw,36px);line-height:1.55;
}
/* Drop-down overlay and form controls never overrun the viewport. */
body.woocommerce-account .select2-container {min-width:0!important;max-width:100%!important}
body.woocommerce-account .select2-container .select2-selection--single {display:flex;align-items:center}
body.woocommerce-account .select2-container .select2-selection__rendered {
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:calc(100% - 28px)
}
body.woocommerce-account .select2-container--open .select2-dropdown,
.select2-container--open .select2-dropdown {
  box-sizing:border-box;max-width:calc(100vw - 24px)!important;
}
body.woocommerce-account .woocommerce-address-fields__field-wrapper > p {min-width:0}
body.woocommerce-account :is(input,select,textarea) {max-width:100%;box-sizing:border-box}
body.woocommerce-account .bn-nav-enhanced > ul {max-width:100%}
@media (min-width:1101px) and (max-width:1330px) {
  body.woocommerce-account .woocommerce.bn-account-layout-root,
  body.woocommerce-account .woocommerce:has(> .woocommerce-MyAccount-navigation):has(> .woocommerce-MyAccount-content) {
    grid-template-columns: 215px minmax(0,1fr)!important;
    gap: 23px!important;
  }
  body.woocommerce-account .bn-dashboard__stats {grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width:1100px) {
  body.woocommerce-account .woocommerce.bn-account-layout-root,
  body.woocommerce-account .woocommerce:has(> .woocommerce-MyAccount-navigation):has(> .woocommerce-MyAccount-content) {
    display:flex!important;flex-direction:column!important;gap:18px!important;
    width:100%!important;max-width:100%!important;
  }
  body.woocommerce-account .bn-account-layout-root > .woocommerce-MyAccount-navigation,
  body.woocommerce-account .bn-account-layout-root > .woocommerce-MyAccount-content,
  body.woocommerce-account .woocommerce:has(> .woocommerce-MyAccount-navigation) > .woocommerce-MyAccount-navigation,
  body.woocommerce-account .woocommerce:has(> .woocommerce-MyAccount-navigation) > .woocommerce-MyAccount-content {
    flex:0 1 auto!important;width:100%!important;max-width:100%!important;
    margin:0!important;float:none!important;
  }
  body.woocommerce-account .bn-dashboard__stats {grid-template-columns:repeat(4,minmax(0,1fr));}
}
@media (max-width:820px) {
  body.woocommerce-account .bn-dashboard__stats {grid-template-columns:repeat(2,minmax(0,1fr));}
  body.woocommerce-account .bn-dashboard__lower {grid-template-columns:1fr;}
  body.woocommerce-account .bn-wallet-stats {grid-template-columns:repeat(2,minmax(0,1fr));}
  body.woocommerce-account .bn-wallet-stats > div:last-child {grid-column:1/-1;}
}
@media (max-width:600px) {
  body.woocommerce-account .entry-content:has(.woocommerce-MyAccount-navigation) {padding-inline:12px}
  body.woocommerce-account .bn-dashboard__intro {flex-direction:column;align-items:stretch}
  body.woocommerce-account .bn-dashboard__intro .bn-btn {align-self:flex-start}
  body.woocommerce-account .bn-dashboard__stats {grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  body.woocommerce-account .bn-stat {padding:14px 12px;}
  body.woocommerce-account .bn-stat span {font-size:11px;line-height:1.8}
  body.woocommerce-account .bn-stat strong {font-size:22px}
  body.woocommerce-account .bn-stat small {font-size:10px;line-height:1.8}
  body.woocommerce-account .bn-dashboard__lower {grid-template-columns:1fr}
  body.woocommerce-account .bn-wallet-stats {grid-template-columns:1fr}
  body.woocommerce-account .bn-wallet-stats > div:last-child {grid-column:auto}
  body.woocommerce-account .bn-product-cards {grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  body.woocommerce-account .bn-product-card:last-child:nth-child(odd) {grid-column:1/-1;max-width:60%}
  body.woocommerce-account .bn-order-card__actions {align-items:stretch}
  body.woocommerce-account .bn-order-card__actions > .bn-btn {min-width:0}
  body.woocommerce-account .woocommerce-address-fields__field-wrapper {grid-template-columns:1fr!important}
}
@media (max-width:355px) {
  body.woocommerce-account .bn-stat strong {font-size:19px}
  body.woocommerce-account .bn-dashboard__stats {gap:7px}
  body.woocommerce-account .bn-product-card:last-child:nth-child(odd) {max-width:100%}
}

@media (min-width:1025px) and (max-width:1100px) {
 body.woocommerce-account .bn-nav-enhanced .bn-nav-toggle {
   display:flex;align-items:center;justify-content:space-between;width:100%;
   background:#f1eae3;border:1px solid #e3d9d0;border-radius:6px;
   padding:12px 17px;color:#292328;font-size:14px;min-height:48px;cursor:pointer;margin-bottom:8px;
 }
 body.woocommerce-account .bn-nav-enhanced .bn-nav-toggle::after {content:"⌄";font-size:21px}
 body.woocommerce-account .bn-nav-enhanced .bn-nav-toggle[aria-expanded=true]::after {content:"⌃"}
 body.woocommerce-account .bn-nav-enhanced > ul {display:none!important}
 body.woocommerce-account .bn-nav-enhanced.bn-nav-open > ul {
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));
    padding:10px!important;background:white;border:1px solid #e7e0d9;
    border-radius:7px;gap:7px!important;overflow:visible;white-space:normal;
 }
 body.woocommerce-account .bn-nav-enhanced.bn-nav-open > ul li {min-width:0;width:100%}
 body.woocommerce-account .bn-nav-enhanced.bn-nav-open > ul a {white-space:normal;text-align:center;justify-content:center;}
}
