/* Sewlyra shared UI standards
   Single set of responsive form, dialog and accessibility rules used by
   public pages, shop dashboard, account and administrator screens.
   Existing business logic, page branding and positioning are unchanged. */
:root{
  --sl-ui-gap:12px;
  --sl-ui-radius:10px;
  --sl-ui-border:#cbd9dc;
  --sl-ui-focus:#0b8063;
  --sl-ui-touch:44px;
}
body[data-sewlyra-ui]{
  overflow-x:clip;
  text-size-adjust:100%;
  -webkit-text-size-adjust:100%;
}
body[data-sewlyra-ui] :where(main,section,article,.panel,.fields,.field-grid,.two,.app-layout,.app-main,#screen,#dialog-content){
  min-width:0;
}
body[data-sewlyra-ui] :where(input,select,textarea){
  box-sizing:border-box;
  max-width:100%;
}
body[data-sewlyra-ui] :where(input,select,textarea):not([type=checkbox]):not([type=radio]){
  min-width:0;
}
body[data-sewlyra-ui] :where(label,.field,.fields,.form-group,.customer-picker,.two,.field-grid){
  overflow-wrap:anywhere;
}
body[data-sewlyra-ui] :where(button,a,input,select,textarea):focus-visible{
  outline:3px solid var(--sl-ui-focus);
  outline-offset:2px;
}
body[data-sewlyra-ui] :where(dialog,[role=dialog]){
  box-sizing:border-box;
  max-width:min(calc(100vw - 16px),100%);
  max-height:calc(100dvh - 16px);
}
body[data-sewlyra-ui] dialog:not([open]){
  display:none;
}
body[data-sewlyra-ui] dialog .sl-dialog-language{
  min-width:0;
  flex-wrap:wrap;
  gap:8px;
}
body[data-sewlyra-ui] :where(dialog,.panel,.fields,.field-grid) :where(input,select,textarea){
  min-width:0;
}
body[data-sewlyra-ui] :where(.table-scroll,.data-table-wrap,.table-wrapper){
  overflow-x:auto;
  max-width:100%;
  -webkit-overflow-scrolling:touch;
}
body[data-sewlyra-ui] :where(table){
  border-collapse:collapse;
}
body[data-sewlyra-ui] :where([role=status],[role=alert],.help,.muted){
  overflow-wrap:anywhere;
}
body[data-sewlyra-ui] :where(.dialog-head,.form-actions,.dialog-actions,.actions,.header-tools){
  min-width:0;
}
body[data-sewlyra-ui] :where(.dialog-head,.form-actions,.dialog-actions){
  gap:10px;
}
body[data-sewlyra-ui] :where(.dialog-head,.dialog-actions) > *{
  min-width:0;
}
body[data-sewlyra-ui] :where(#sewlyra-language-bar,.sl-dialog-language) select{
  min-height:40px;
  max-width:100%;
}
body[data-sewlyra-ui] #sewlyra-language-bar{
  max-width:100%;
  flex-wrap:wrap;
}
body[data-sewlyra-ui] :where(#dialog-content,dialog .panel,form){
  max-width:100%;
}
@media(max-width:760px){
  body[data-sewlyra-ui] :where(input:not([type=checkbox]):not([type=radio]),select,textarea){
    font-size:16px; /* Prevent unexpected iOS form zoom. */
  }
  body[data-sewlyra-ui] :where(form input:not([type=checkbox]):not([type=radio]),form select,form textarea){
    width:100%;
    max-width:100%;
  }
  body[data-sewlyra-ui] :where(.fields,.field-grid,.two,.form-grid){
    min-width:0;
  }
  body[data-sewlyra-ui] :where(form button:not(.icon-button):not(.sewlyra-hotspot),.dialog-actions button,.form-actions button){
    min-height:var(--sl-ui-touch);
  }
  body[data-sewlyra-ui] :where(dialog){
    margin-block:max(8px,env(safe-area-inset-top,0px));
    max-height:calc(100dvh - 16px - env(safe-area-inset-bottom,0px));
    overscroll-behavior:contain;
  }
  body[data-sewlyra-ui] :where(#dialog-content,.panel){
    max-width:100%;
  }
  body[data-sewlyra-ui] .sl-dialog-language select{
    min-height:var(--sl-ui-touch);
  }
}
@media(max-width:380px){
  body[data-sewlyra-ui] :where(.dialog-head,.dialog-actions,.form-actions){
    gap:7px;
  }
  body[data-sewlyra-ui] :where(.field-grid,.form-grid){
    grid-template-columns:minmax(0,1fr);
  }
}
html[dir=rtl] body[data-sewlyra-ui] :where(.field,.fields label,dialog label,dialog p){
  text-align:start;
}
html[dir=rtl] body[data-sewlyra-ui] :where(.dialog-head,.form-actions,.dialog-actions){
  direction:rtl;
}
@media(prefers-reduced-motion:reduce){
  body[data-sewlyra-ui] :where(dialog,.panel,.table-scroll){
    scroll-behavior:auto;
  }
}
@media print{
  body[data-sewlyra-ui] :where(#sewlyra-language-bar,.sl-dialog-language){
    display:none!important;
  }
}

/* Billing mobile view: self-contained cards, no clipped order numbers or vertical action labels. */
body[data-sewlyra-ui] .billing-table-scroll{max-width:100%;overflow-x:auto}
body[data-sewlyra-ui] .billing-order-table{width:100%;min-width:610px;table-layout:auto;white-space:nowrap}
body[data-sewlyra-ui] .billing-order-table td{vertical-align:middle;white-space:nowrap}
body[data-sewlyra-ui] .billing-order-table .billing-mobile-label{display:none}
body[data-sewlyra-ui] .billing-order-table .billing-action .small-button{white-space:nowrap;overflow-wrap:normal;word-break:normal;min-width:145px}
@media(max-width:760px){
 body[data-sewlyra-ui] .billing-toolbar-wrap .toolbar{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;margin-bottom:12px}
 body[data-sewlyra-ui] .billing-toolbar-wrap .toolbar input{min-width:0;width:100%;max-width:100%;min-height:46px;font-size:16px;flex:none;box-sizing:border-box;text-overflow:ellipsis}
 body[data-sewlyra-ui] .billing-toolbar-wrap .toolbar .secondary{justify-self:end;min-height:42px;max-width:100%;white-space:nowrap;padding:9px 14px}
 body[data-sewlyra-ui] .billing-table-scroll{padding:0 12px 14px;overflow-x:visible}
 body[data-sewlyra-ui] .billing-order-table{display:block;width:100%;min-width:0;table-layout:auto;white-space:normal}
 body[data-sewlyra-ui] .billing-order-table thead{display:none}
 body[data-sewlyra-ui] .billing-order-table tbody{display:grid;gap:12px;min-width:0}
 body[data-sewlyra-ui] .billing-order-table tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 14px;min-width:0;padding:14px;border:1px solid #dae6ed;border-radius:12px;background:#fff;box-shadow:0 1px 3px #17365b0a}
 body[data-sewlyra-ui] .billing-order-table tbody td{display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:4px;min-width:0;max-width:100%;padding:0;border:0;white-space:normal;overflow-wrap:anywhere;word-break:normal;text-align:start;font-size:13px;line-height:1.35}
 body[data-sewlyra-ui] .billing-order-table .billing-mobile-label{display:block;font-size:11px;line-height:1.25;font-weight:500;color:#62758a}
 body[data-sewlyra-ui] .billing-order-table td:first-child strong{font-size:15px;font-weight:700;white-space:nowrap;color:#152c46}
 body[data-sewlyra-ui] .billing-order-table .billing-customer{font-weight:600;overflow-wrap:anywhere;max-width:100%}
 body[data-sewlyra-ui] .billing-order-table .billing-money{font-variant-numeric:tabular-nums;white-space:nowrap;max-width:100%;font-size:14px;font-weight:600;color:#183e60}
 body[data-sewlyra-ui] .billing-order-table td.billing-balance{grid-column:1/-1;padding-top:8px;border-top:1px solid #edf1f4}
 body[data-sewlyra-ui] .billing-order-table td.billing-balance .billing-money{color:#0b6e57;font-size:17px}
 body[data-sewlyra-ui] .billing-order-table td.billing-action{grid-column:1/-1}
 body[data-sewlyra-ui] .billing-order-table td.billing-action button.small-button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;width:100%;min-width:0;padding:9px 12px;white-space:nowrap!important;overflow-wrap:normal!important;word-break:normal!important;text-align:center;font-size:14px;font-weight:650;border-radius:9px}
}
@media(max-width:340px){
 body[data-sewlyra-ui] .billing-order-table tbody tr{gap:9px 8px;padding:11px}
 body[data-sewlyra-ui] .billing-order-table .billing-money{font-size:12px}
}
