/* Shared interaction geometry; theme colours and typography remain inherited. */
:root{--ux-height:100dvh;--ux-top:0px}
button,a,input,select,textarea,[role=button],summary{touch-action:manipulation}
button,[role=button]{cursor:pointer}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid var(--olive,#245b46);outline-offset:3px}
button:disabled{cursor:default}
input,select,textarea{max-width:100%;min-width:0}
img{max-width:100%}
.ux-close{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;min-height:44px;border:1px solid var(--line,#ddd);border-radius:12px;background:var(--white,#fff);color:inherit;font:inherit;font-size:26px;line-height:1}
.ux-sheet-head{position:sticky;top:0;z-index:6;display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:64px;padding:12px 16px;background:var(--paper,var(--white,#fff));color:inherit;border-bottom:1px solid var(--line,#ddd);flex-shrink:0}
.ux-grip{position:absolute;top:5px;left:calc(50% - 20px);width:40px;height:4px;border-radius:8px;background:currentColor;opacity:.25}
.ux-panel{overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;scroll-padding-top:80px;scroll-padding-bottom:100px;min-width:0;max-height:calc(var(--ux-height) - 24px)!important}
.ux-overlay{top:var(--ux-top)!important;bottom:auto!important;height:var(--ux-height)!important;padding-top:env(safe-area-inset-top)!important}
.ux-panel>.ux-sheet-head{margin-bottom:14px}
#modal .panel{padding:0!important;max-width:760px;margin-inline:auto}
#modal .inner{padding:8px clamp(14px,4vw,28px) calc(24px + env(safe-area-inset-bottom));max-width:100%}
#modal .row>div:first-child{min-width:0;overflow-wrap:anywhere}
#modal .qty{flex-shrink:0}
#modal .total{gap:12px;flex-wrap:wrap}
#modal .field label{font-size:clamp(17px,4vw,22px)}
.ux-quantity{display:flex;align-items:center;gap:5px;flex-wrap:nowrap;min-width:0}
body[data-theme] .ux-quantity button,.ux-quantity button{display:grid!important;place-items:center;width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;margin:0!important;padding:0!important;flex:0 0 44px;line-height:1;font-size:24px;border:1px solid var(--line);border-radius:var(--v4-radius,10px);background:var(--white);color:var(--surface-ink,var(--ink));box-shadow:none!important}
.ux-quantity button:disabled{opacity:.35}
.ux-quantity output{min-width:22px;max-width:5ch;text-align:center;font:inherit;font-weight:750;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
body[data-theme] .item .item-meta{min-width:0}
body[data-theme] .item{min-width:0}
.item-main,.item-body,.reward-card,.reward-summary>div{min-width:0;overflow-wrap:anywhere}
.qty button{min-width:44px!important;min-height:44px!important;width:44px!important;height:44px!important;touch-action:manipulation}
.ux-loyalty-guide h2{font-size:22px!important;margin:0 0 12px}
.ux-loyalty-guide p,.ux-loyalty-guide li{font-size:14px;line-height:1.6}
.ux-loyalty-guide ul{padding-left:20px}.ux-loyalty-guide li{margin:12px 0}.ux-loyalty-guide li span{display:block}
.ux-panel .ux-sheet-head+*{margin-top:0}
body[data-ux-surface=admin] .ux-panel,body[data-ux-surface=operations] .ux-panel{padding:0!important}
body[data-ux-surface=admin] .ux-panel>:not(.ux-sheet-head),body[data-ux-surface=operations] .ux-panel>:not(.ux-sheet-head){margin-left:18px;margin-right:18px}
body[data-ux-surface=admin] .ux-panel>:last-child,body[data-ux-surface=operations] .ux-panel>:last-child{margin-bottom:calc(18px + env(safe-area-inset-bottom))}
body[data-ux-surface=operations] .modal-summary{bottom:0;margin:0!important;padding-bottom:calc(14px + env(safe-area-inset-bottom));flex-wrap:wrap}
body[data-ux-surface=operations] .product-row{min-width:0}
body[data-ux-surface=operations] .product-row>div:first-child{min-width:0;overflow-wrap:anywhere}
body[data-ux-surface=operations] .cash-grid{grid-template-columns:repeat(auto-fit,minmax(min(290px,100%),1fr))}
body[data-ux-surface=operations] .layout,body[data-ux-surface=operations] .main{min-width:0}
@media(max-width:600px){
 body[data-theme] .item{grid-template-columns:minmax(0,1fr)!important;gap:12px!important}
 body[data-theme] .item .item-meta{flex-direction:row!important;justify-content:flex-end!important;width:100%!important}
 body[data-theme] main{padding-left:max(14px,env(safe-area-inset-left))!important;padding-right:max(14px,env(safe-area-inset-right))!important}
 .reward-tabs{display:flex;flex-wrap:wrap;gap:6px}.reward-tabs button{min-height:44px;flex:1 1 auto}
 .reward-summary{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .phone-field{grid-template-columns:minmax(100px,115px) minmax(0,1fr)!important}
 .customer-name-grid{grid-template-columns:minmax(0,1fr)!important}
 input:not([type=checkbox]):not([type=radio]),select,textarea{font-size:16px!important}
 .ux-overlay{align-items:flex-end!important;padding-left:0!important;padding-right:0!important;padding-bottom:0!important}
 .ux-panel{width:100%!important;max-width:100%!important;max-height:calc(var(--ux-height) - env(safe-area-inset-top) - 8px)!important;border-bottom-left-radius:0!important;border-bottom-right-radius:0!important}
 body[data-ux-surface=admin] .staff{padding-left:12px;padding-right:12px}
 body[data-ux-surface=admin] .top{flex-wrap:wrap;gap:10px}
 body[data-ux-surface=admin] .nav{max-width:100%;overflow-x:auto}
 body[data-ux-surface=admin] .settings-grid,body[data-ux-surface=admin] .comm-form-grid{grid-template-columns:minmax(0,1fr)!important}
 body[data-ux-surface=operations] .top{flex-wrap:wrap}
 body[data-ux-surface=operations] .side{position:static}
 body[data-ux-surface=operations] .product-row{grid-template-columns:minmax(0,1fr)}
 body[data-ux-surface=operations] .product-row .qty{justify-content:flex-end}
}
@media(max-height:500px) and (orientation:landscape){.ux-panel{max-height:calc(var(--ux-height) - 8px)!important}.ux-sheet-head{min-height:52px;padding-block:4px}.modal-summary{position:static!important}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto!important}*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
.ux-cart-summary{display:block;font-size:12px;line-height:1.5;font-weight:500;margin-top:2px}
@media(max-width:600px){body[data-ux-surface=admin] .editRow{flex-wrap:wrap}body[data-ux-surface=admin] .editRow>.qty{margin-left:auto}body[data-ux-surface=admin] .v4-grid{grid-template-columns:minmax(0,1fr)!important}}
@media(min-width:601px){body[data-theme] #menuScreen .item{grid-template-columns:minmax(0,1fr) auto!important}}
body[data-ux-surface=admin] .ux-panel>:not(.ux-sheet-head){max-width:calc(100% - 36px)}
body[data-ux-surface=admin] .ux-panel>input,body[data-ux-surface=admin] .ux-panel>textarea,body[data-ux-surface=admin] .ux-panel>select{width:calc(100% - 36px)!important}
body[data-ux-surface=admin] .ux-panel>h2:first-of-type,body[data-ux-surface=operations] .ux-panel .order-top h2,body[data-ux-surface=operations] #closeModal{display:none}

/* Inmersivo conserva 90% del viewport con la capa de navegación móvil. */
body[data-ux-surface="customer"] .comm-card.style-immersive.ux-panel{max-height:calc(var(--ux-height,100dvh) - 16px)!important;height:min(90dvh,calc(var(--ux-height,100dvh) - 16px))!important;padding:0!important}
body[data-ux-surface="customer"] .comm-card.style-immersive.ux-panel>:not(.ux-sheet-head){margin-left:0;margin-right:0}

/* Immersive communication stays centered, including on small screens. */
body[data-ux-surface="customer"] #commSheet:has(.style-immersive){align-items:center!important;justify-content:center!important;padding:8px 12px!important}
body[data-ux-surface="customer"] #commSheet .comm-card.style-immersive.ux-panel{width:min(calc(var(--ux-height,100dvh) * .9 * 9 / 16),calc(100vw - 24px))!important;max-width:700px!important;height:auto!important;aspect-ratio:9/16;max-height:calc(var(--ux-height,100dvh) * .9)!important;border-radius:var(--v4-radius,20px)!important;overflow:hidden}
body[data-ux-surface="customer"] #commSheet .comm-card.style-immersive .comm-image{object-fit:contain}

/* Checkout: keyboard-aware bounded body with one persistent submit action. */
body[data-ux-surface="customer"] #modal .panel{display:flex;flex-direction:column;height:calc(var(--ux-height,100dvh) - 16px);overflow:hidden}
body[data-ux-surface="customer"] #modal .panel>.ux-sheet-head{flex:none}
body[data-ux-surface="customer"] #modal .panel>.inner{flex:1;min-height:0;min-width:0;width:100%;box-sizing:border-box;margin:0;align-self:stretch;overflow:auto;overscroll-behavior:contain;padding-bottom:20px;scrollbar-gutter:stable}
body[data-ux-surface="customer"] .checkout-footer{flex:none;padding:10px 16px max(12px,env(safe-area-inset-bottom));background:var(--paper);border-top:1px solid var(--line)}
body[data-ux-surface="customer"] .checkout-footer #checkoutHelp{font-size:12px;line-height:1.4;margin:0 0 8px}
body[data-ux-surface="customer"] .checkout-footer #send{margin:0;min-height:44px}
body[data-ux-surface="customer"] .checkout-footer[hidden]{display:none}

/* Touch devices keep readable fields when rotated beyond mobile breakpoints. */
@media(pointer:coarse) {
 body[data-ux-surface="admin"] :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea) { font-size:16px!important; }
}
