/* Ajustes compartilhados. Carregado após os estilos específicos de cada página. */
:root{--viewport-height:100vh;--viewport-top:0px;--dialog-gap:12px}
@supports(height:100dvh){:root{--viewport-height:100dvh}}
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{margin:0;min-width:0}
main{max-width:100%;min-width:0}
body>main{padding-left:env(safe-area-inset-left,0px);padding-right:env(safe-area-inset-right,0px)}
:where(section,article,form,fieldset,.conteudo,.contato-info,.contato-mapa,.service-copy,.service-media-item,.topbar>div){min-width:0;min-inline-size:0}
img,video,iframe{max-width:100%}
:where(h1,h2,h3,h4,p,label,legend,.item,.service-card-title,.service-message,.message){overflow-wrap:anywhere}
input,select,textarea{min-width:0;max-width:100%;font-size:16px}
textarea{resize:vertical}
button{max-width:100%;white-space:normal;overflow-wrap:anywhere;touch-action:manipulation}
input,textarea,select,button{scroll-margin-top:calc(var(--header-h,70px) + 16px);scroll-margin-bottom:24px}
footer{padding-bottom:calc(100px + env(safe-area-inset-bottom,0px))}
.hero-inner{grid-template-columns:minmax(0,620px) minmax(0,1fr)}
.hero-text{min-width:0}
.hero{min-height:calc(100svh - var(--header-h,86px))}
.hero-buttons>*{min-width:0}
.contato-layout{grid-template-columns:repeat(2,minmax(0,1fr))}
.contato-info .item a{overflow-wrap:anywhere}
.bloco{grid-template-columns:minmax(0,1.05fr) minmax(0,1fr)}
.destaque{max-width:100%;overflow-wrap:anywhere}
.edit-sobre-btn{white-space:normal}
.contact-grid,.about-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.table-wrap{width:100%;max-width:100%;min-width:0;overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
.table-wrap table{min-width:1050px}
.topbar>*{max-width:100%}
.form-actions,.password-tools{flex-wrap:wrap}
.login-card{min-width:0}
body:has(.login-card) main{min-height:calc(100svh - var(--header-h,86px));padding:26px env(safe-area-inset-right,0px) 36px env(safe-area-inset-left,0px)}
.whatsapp-float{right:max(14px,env(safe-area-inset-right,0px));bottom:max(14px,env(safe-area-inset-bottom,0px));max-width:calc(100% - 28px)}
body.navigation-open .whatsapp-float{visibility:hidden;pointer-events:none}

/* Janelas limitadas à área visível, inclusive quando o teclado é aberto. */
.service-dialog,#userDialog{position:fixed;inset:calc(var(--viewport-top) + max(var(--dialog-gap),env(safe-area-inset-top,0px))) 0 auto;margin:0 auto;max-height:calc(var(--viewport-height) - max(var(--dialog-gap),env(safe-area-inset-top,0px)) - max(var(--dialog-gap),env(safe-area-inset-bottom,0px)));max-width:calc(100% - 2 * var(--dialog-gap) - env(safe-area-inset-left,0px) - env(safe-area-inset-right,0px))}
.service-dialog-head{padding:clamp(12px,2vw,24px);gap:12px}
.service-dialog-head h2,.dialog-head h2{min-width:0;overflow-wrap:anywhere}
.service-close,#closeDialog,.contact-close-btn,.about-close-btn{min-width:44px;min-height:44px;flex-shrink:0}
.service-dialog-body{min-width:0;min-height:0;padding:clamp(16px,2.5vw,28px)}
.service-thumbnails button{min-height:44px}
.service-editor,.service-section-editor,.service-section-editor legend{min-width:0;max-width:100%}
.service-section-editor button{margin:4px 4px 4px 0}
.service-section-editor button+button{margin-left:0}
.service-editor input[type="file"]{overflow:hidden}
.service-editor input[type="file"]::file-selector-button{max-width:100%;white-space:normal}
.service-editor-actions,.service-admin-actions{gap:10px}
.service-gallery .service-dialog-image{max-height:calc(var(--viewport-height) * .56)}
.contact-modal-backdrop,.about-modal-backdrop{inset:var(--viewport-top) 0 auto;height:var(--viewport-height);padding:max(12px,env(safe-area-inset-top,0px)) max(12px,env(safe-area-inset-right,0px)) max(12px,env(safe-area-inset-bottom,0px)) max(12px,env(safe-area-inset-left,0px));overflow:hidden}
.contact-modal,.about-modal{max-height:100%;overflow-y:auto;overscroll-behavior:contain;min-width:0}

@media(max-width:980px){
 .hero-inner{grid-template-columns:minmax(0,1fr)}
 .hero-right{display:none}
 .contato-layout,.bloco{grid-template-columns:minmax(0,1fr)}
 .bloco.inverso .conteudo,.bloco.inverso img{order:initial}
 .contato-info{padding-right:0}
}
@media(max-width:600px){
 .container,.contato-box,.sobre-topo,.bloco,.login-card,.cabecalho{padding:20px}
 .bloco{gap:20px}
 .bloco img{padding:10px}
 .hero{padding:36px 0}
 .hero-text h1{font-size:clamp(1.8rem,8vw,2.7rem)}
 .hero-text p{font-size:1.05rem;line-height:1.6;max-width:100%}
 .hero-buttons a{flex:1 1 180px}
 .hero-buttons button{width:100%;min-height:44px;padding:13px 16px}
 .contact-grid,.about-grid{grid-template-columns:minmax(0,1fr)}
 .contact-modal,.about-modal,#userDialog{padding:18px}
 .form-actions>button,.contact-actions>button,.about-actions>button,.service-admin-actions>button,.service-editor-actions>button{flex:1 1 140px;min-height:44px}
 .service-detail-layout{gap:22px}
 .service-description p,.service-description ul{line-height:1.75}
 .service-gallery .service-dialog-image{max-height:calc(var(--viewport-height) * .4)}
 .item{font-size:1rem}
 .map-frame{min-height:240px}
}
@media(max-height:500px){
 :root{--dialog-gap:8px}
 .hero{min-height:0;padding:28px 0}
 .hero-right{display:none}
 .service-dialog-head{padding:8px 14px}
 .service-dialog-head h2{font-size:1.2rem;line-height:1.3}
 .service-dialog-body{padding:14px}
 .service-gallery{position:static}
 .service-gallery .service-dialog-image{max-height:calc(var(--viewport-height) * .5)}
 .whatsapp-float{min-height:44px;padding:8px 13px;font-size:.9rem}
}
@media(min-width:640px) and (max-height:500px){
 .service-detail-layout{grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);gap:22px}
}
@media(max-width:980px),(pointer:coarse){
 body.editing-field .whatsapp-float{visibility:hidden;pointer-events:none}
 .row-actions button,.password-tools button{min-height:44px;font-size:.9rem}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}.site-header a,.whatsapp-float{transition:none}}

/* Foto inteira no celular, independente da altura do texto ou da orientação. */
@media(max-width:980px),(max-width:1200px) and (pointer:coarse){
 .hero{display:block;min-height:0;padding:0;background:#111}
 .hero::before{display:none}
 .hero-photo{display:block;width:100%;height:auto;max-height:none;object-fit:contain}
 .hero-inner{grid-template-columns:minmax(0,1fr);padding:28px 0 36px}
 .hero-right{display:none}
}
