/*
 * Delivery dos Pimentas Core — v0.4.42
 * Revisão mobile e usabilidade.
 * Carregado por último para complementar, sem substituir, os estilos existentes.
 */

/* Proteções gerais contra estouro horizontal nas telas próprias do Delivery. */
body.dp-site-body,
body.dp-home-template-body,
body.dp-portal-body,
body.dp-store-template-body{
  overflow-x:hidden;
}

body.dp-site-body img,
body.dp-home-template-body img,
body.dp-portal-body img,
body.dp-store-template-body img{
  max-width:100%;
}

@media (max-width:900px){
  /* Cabeçalho público: permanece disponível durante a navegação no celular. */
  .dp-public-topbar{
    position:sticky;
    top:0;
    z-index:1000;
    padding-left:max(13px,env(safe-area-inset-left));
    padding-right:max(13px,env(safe-area-inset-right));
  }
  .admin-bar .dp-public-topbar{top:46px}

  .dp-mobile-menu>summary{
    min-width:44px;
    min-height:44px;
  }
  .dp-mobile-menu-panel{
    max-height:calc(100dvh - 86px);
    overscroll-behavior:contain;
    padding-bottom:max(9px,env(safe-area-inset-bottom));
  }
  .dp-mobile-menu-panel a{min-height:46px}

  /* Evita zoom automático do iOS e melhora leitura/preenchimento dos formulários. */
  .dp-site-body input:not([type="checkbox"]):not([type="radio"]),
  .dp-site-body select,
  .dp-site-body textarea,
  .dp-portal-body input:not([type="checkbox"]):not([type="radio"]),
  .dp-portal-body select,
  .dp-portal-body textarea,
  .dp-store-template-body input:not([type="checkbox"]):not([type="radio"]),
  .dp-store-template-body select,
  .dp-store-template-body textarea,
  .dp-account-shell input:not([type="checkbox"]):not([type="radio"]),
  .dp-account-shell select,
  .dp-account-shell textarea,
  .dp-merchant-shell input:not([type="checkbox"]):not([type="radio"]),
  .dp-merchant-shell select,
  .dp-merchant-shell textarea,
  .dp-apply-shell input:not([type="checkbox"]):not([type="radio"]),
  .dp-apply-shell select,
  .dp-apply-shell textarea{
    font-size:16px!important;
  }

  /* Alvos de toque principais com dimensão confortável. */
  .dp-location-confirm,.dp-location-gps,
  .dp-contact-submit,.dp-apply-submit,
  .dp-account-form button,.dp-account-primary-link,.dp-account-secondary,
  .dp-merchant-primary,.dp-merchant-secondary,.dp-merchant-link-button,
  .dp-order-status-form button,.dp-order-review-button,
  .dp-cart-whatsapp,.dp-add-cart{
    min-height:44px;
  }

  /* Home: os blocos do Core respeitam uma margem lateral consistente. */
  .dp-home-root .dp-location-box,
  .dp-home-root .dp-category-grid,
  .dp-home-root .dp-stores{
    max-width:calc(100% - 24px)!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }

  .dp-home-root .dp-stores,
  .dp-site-main .dp-stores{
    min-width:0;
  }

  /* Páginas institucionais e contato. */
  .dp-site-institutional-content{
    padding-left:max(18px,env(safe-area-inset-left));
    padding-right:max(18px,env(safe-area-inset-right));
  }
  .dp-contact-field input,.dp-contact-field select{min-height:48px}

  /* Portal/cadastro: mantém o conteúdo longe das bordas. */
  .dp-portal-main{min-width:0}
  .dp-apply-shell{
    width:100%;
    max-width:920px;
    box-sizing:border-box;
    padding-left:14px;
    padding-right:14px;
  }
  .dp-apply-card{box-sizing:border-box}
  .dp-apply-grid>*{min-width:0}

  /* Minha Conta e Painel do Lojista: nenhum filho deve forçar largura da tela. */
  .dp-account-shell,.dp-account-panel,.dp-customer-order-card,
  .dp-merchant-shell,.dp-merchant-store-card,.dp-merchant-product-card,.dp-merchant-order-card{
    min-width:0;
  }
  .dp-account-panel,.dp-merchant-store-card,.dp-merchant-product-editor{
    overflow-wrap:anywhere;
  }

  /* Loja/cardápio. */
  .dp-store-page,.dp-store-section,.dp-cart{min-width:0}
  .dp-menu-tabs{
    scrollbar-width:none;
    overscroll-behavior-x:contain;
    scroll-snap-type:x proximity;
  }
  .dp-menu-tabs::-webkit-scrollbar{display:none}
  .dp-menu-tab{scroll-snap-align:start;min-height:42px}

  .dp-product-modal-dialog{
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
  }
}

@media (max-width:680px){
  /* Cadastro de empresa: menos densidade e mais espaço para toque. */
  .dp-apply-shell{margin-top:16px!important;padding-left:12px;padding-right:12px}
  .dp-apply-hero{padding:21px 18px;border-radius:17px}
  .dp-apply-hero h1{font-size:24px!important;line-height:1.12}
  .dp-apply-hero p{font-size:14px;line-height:1.55}
  .dp-apply-trial{font-size:12px;padding:7px 10px}
  .dp-apply-card{padding:17px 15px;border-radius:16px}
  .dp-apply-card h2{font-size:20px}
  .dp-apply-card>p{font-size:13px;line-height:1.5}
  .dp-apply-grid,.dp-apply-plans,.dp-apply-payment{grid-template-columns:1fr!important}
  .dp-apply-cycles{grid-template-columns:1fr 1fr!important}
  .dp-apply-grid input,.dp-apply-grid select,.dp-apply-full input,.dp-apply-full textarea,.dp-apply-full select{min-height:48px}
  .dp-apply-plan,.dp-apply-payment label{padding:14px;min-height:54px;box-sizing:border-box}
  .dp-apply-cycle{min-height:46px;display:flex;align-items:center;justify-content:center;gap:5px}
  .dp-apply-terms{line-height:1.5}
  .dp-apply-terms input{flex:0 0 20px;width:20px;height:20px;margin-top:1px}

  /* Painel do lojista: ações e pedidos ficam fáceis de tocar. */
  .dp-merchant-store-card{padding:16px!important}
  .dp-merchant-product-editor{padding:15px!important}
  .dp-merchant-product-editor-head{align-items:flex-start;gap:8px}
  .dp-merchant-product-editor-head>a{min-height:38px;display:flex;align-items:center}
  .dp-merchant-product-actions{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr));
    width:100%;
  }
  .dp-merchant-product-actions form{width:100%}
  .dp-merchant-product-actions .dp-merchant-secondary,
  .dp-merchant-product-actions .dp-merchant-link-button,
  .dp-merchant-product-actions button{
    width:100%;
    min-height:42px!important;
  }
  .dp-merchant-order-top{flex-wrap:wrap}
  .dp-merchant-order-top .dp-order-status{margin-left:0}
  .dp-order-status-form select{min-height:46px}

  /* Minha Conta: cartões mais compactos, sem perder leitura. */
  .dp-account-welcome{padding:18px 16px!important}
  .dp-account-panel{padding:18px 16px!important}
  .dp-customer-order-card{padding:14px!important}
  .dp-customer-order-summary{display:grid!important;grid-template-columns:1fr 1fr;gap:10px 12px!important}
  .dp-order-review-button{display:flex;align-items:center;justify-content:center}

  /* Loja: reduz as caixas, mas preserva títulos e botões. */
  .dp-store-page{padding-left:11px!important;padding-right:11px!important}
  .dp-store-section{padding:16px!important}
  .dp-cart{padding:16px!important}
  .dp-cart-payment,.dp-cart-customer{padding:14px!important}
}

@media (max-width:520px){
  /* Home: no telefone, prioriza legibilidade em vez de espremer cartões. */
  .dp-home-root .dp-category-grid,
  .dp-site-main .dp-category-grid{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:6px!important;
  }
  .dp-category-label{font-size:9.5px!important;line-height:1.08!important}

  .dp-home-root .dp-stores,
  .dp-site-main .dp-stores{
    grid-template-columns:1fr!important;
    gap:9px!important;
  }
  .dp-store-card{
    grid-template-columns:64px minmax(0,1fr)!important;
    min-height:92px!important;
    padding:10px!important;
  }
  .dp-logo-wrap{width:64px!important;height:64px!important}
  .dp-store-title{font-size:14px!important}
  .dp-store-category,.dp-store-rating,.dp-store-distance{font-size:11px!important}
  .dp-store-delivery{font-size:10.5px!important}
  .dp-status{font-size:10px!important;min-height:22px}

  /* Localização: campo em linha própria; ações grandes logo abaixo. */
  .dp-location-box{padding:13px!important}
  .dp-location-row{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important}
  .dp-location-input{grid-column:1/-1!important;width:100%!important;min-height:48px!important}
  .dp-location-confirm,.dp-location-gps{width:100%!important;min-height:46px!important;padding:0 8px!important}
  .dp-location-title{line-height:1.35}

  /* Cabeçalho público e menu. */
  .dp-site-topbar{min-height:64px!important;padding-top:6px!important;padding-bottom:6px!important}
  .dp-site-logo img{width:128px!important;max-height:50px!important}
  .dp-mobile-menu-panel{width:calc(100vw - 20px)!important;right:-2px!important}

  /* Loja: cabeçalho e hero se adaptam a aparelhos estreitos. */
  .dp-store-topbar{gap:8px!important;padding-left:10px!important;padding-right:10px!important}
  .dp-store-brand{min-width:0;font-size:13px!important}
  .dp-store-brand>span:not(.dp-store-brand-logo-wrap){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .dp-store-back{flex:0 0 auto;min-height:40px;display:flex;align-items:center}
  .dp-store-hero{grid-template-columns:62px minmax(0,1fr)!important;gap:11px!important;padding:14px!important}
  .dp-store-hero-logo{width:60px!important;height:60px!important}
  .dp-store-title-row h1{font-size:20px!important;overflow-wrap:anywhere}
  .dp-store-hero-category,.dp-store-fact,.dp-store-distance,.dp-store-area,.dp-store-delivery-summary{font-size:13px!important}
  .dp-store-section h2,.dp-cart-head h2{font-size:20px!important}

  /* Cards de produto: foto útil sem roubar espaço do texto. */
  .dp-product-summary{grid-template-columns:minmax(0,1fr) 96px!important;gap:10px!important;padding:12px!important}
  .dp-product-card.no-image .dp-product-summary{grid-template-columns:1fr!important;padding-right:48px!important}
  .dp-product-thumb-wrap{min-height:92px!important}
  .dp-product-image{min-height:92px!important;max-height:108px!important}
  .dp-product-head h4{font-size:15.5px!important}
  .dp-product-description-compact{font-size:12px!important}
  .dp-product-price-compact strong{font-size:15px!important}
  .dp-product-plus{width:38px!important;height:38px!important}

  /* Modal de personalização: usa toda a largura e respeita notch/barra inferior. */
  .dp-product-modal-dialog{max-height:94dvh!important}
  .dp-modal-product-image{height:min(210px,31vh)!important}
  .dp-modal-product-main{padding:18px 16px 14px!important}
  .dp-modal-option-section{padding:16px!important}
  .dp-option-row{min-height:50px!important}
  .dp-option-row input{width:22px!important;height:22px!important}
  .dp-modal-quantity{padding:13px 16px!important}
  .dp-qty-stepper button{width:40px!important;height:40px!important}
  .dp-modal-add{
    width:calc(100% - 32px)!important;
    margin:7px 16px max(10px,env(safe-area-inset-bottom))!important;
    min-height:52px!important;
  }

  /* Carrinho: itens longos não comprimem o preço/remover. */
  .dp-cart-head{align-items:center}
  .dp-cart-item{align-items:flex-start!important}
  .dp-cart-item>div:first-child{min-width:0;overflow-wrap:anywhere}
  .dp-cart-item-side{flex:0 0 auto;min-width:74px}
  .dp-cart-summary>div{align-items:flex-start}
  .dp-cart-whatsapp{min-height:50px!important;font-size:15px!important}

  /* Minha Conta: cabeçalho/status empilham quando necessário. */
  .dp-customer-order-top{flex-direction:column!important;align-items:flex-start!important}
  .dp-customer-status{align-self:flex-start}
  .dp-customer-order-summary{grid-template-columns:1fr!important}

  /* Lojista: uma ação por linha em aparelhos estreitos. */
  .dp-merchant-product-actions{grid-template-columns:1fr!important}
  .dp-merchant-order-top{flex-direction:column!important;align-items:flex-start!important}
  .dp-merchant-order-card{padding:14px!important}
  .dp-merchant-hours-row{grid-template-columns:1fr 1fr!important}
  .dp-merchant-form button[type="submit"],.dp-merchant-product-save button{min-height:48px!important}

  /* Contato/institucional. */
  .dp-contact-form,.dp-contact-card{padding-left:15px!important;padding-right:15px!important}
  .dp-terms-price-policy{padding:16px 14px!important}
}

@media (max-width:370px){
  .dp-home-root .dp-category-grid,
  .dp-site-main .dp-category-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  .dp-category-label{font-size:10px!important}
  .dp-location-row{grid-template-columns:1fr!important}
  .dp-location-input,.dp-location-confirm,.dp-location-gps{grid-column:1!important}
  .dp-apply-cycles{grid-template-columns:1fr!important}
  .dp-store-brand-logo-wrap{width:38px!important}
  .dp-store-brand-logo{max-width:38px!important}
}
