body.modal-open,
body.cart-drawer-open {
  overflow: hidden;
}

/* Produtos: imagem real ou emoji */
.product-card {
  cursor: pointer;
}
.product-card:focus-visible {
  outline: 2px solid #ea1d2c;
  outline-offset: 3px;
}
.product-image img,
.cart-item-emoji img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.product-image .product-emoji {
  font-size: 44px;
  line-height: 1;
}
.cart-item-emoji .product-emoji {
  font-size: 23px;
}

/* Modal de personalização */
.product-dialog {
  width: min(1200px, calc(100vw - 28px));
  height: min(760px, calc(100vh - 28px));
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 5px;
  overflow: hidden;
  background: #fff;
  color: #2f2f36;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .30);
}
.product-dialog::backdrop {
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(1px);
}
.product-modal-shell {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(380px, 1fr) minmax(460px, 1fr);
  background: #fff;
}
.product-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 8;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: #666;
  font-size: 22px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .11);
}
.product-modal-close:hover {
  color: #ea1d2c;
  transform: rotate(4deg);
}
.product-modal-visual {
  min-width: 0;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 40% 35%, rgba(255,255,255,.75), transparent 28%),
    linear-gradient(135deg, #f8d488, #d99336);
  border-right: 1px solid #efefef;
}
.product-modal-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.product-modal-visual .product-emoji {
  font-size: clamp(120px, 17vw, 230px);
  filter: drop-shadow(0 24px 22px rgba(89, 50, 12, .22));
  animation: productFloat 3.8s ease-in-out infinite;
}
@keyframes productFloat {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}
.product-modal-content {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #fff;
}
.product-modal-header {
  padding: 28px 64px 20px 34px;
  border-bottom: 1px solid #f0f0f0;
}
.product-modal-header p {
  margin: 0 0 7px;
  color: #ea1d2c;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.product-modal-header h2 {
  margin: 0;
  color: #2e2e34;
  font-size: 23px;
  line-height: 1.25;
  font-weight: 900;
}
.product-modal-header > span {
  display: block;
  margin-top: 8px;
  color: #777;
  font-size: 14px;
  line-height: 1.45;
}
.product-modal-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.product-option-group,
.product-note-group {
  padding: 22px 34px;
  border-bottom: 1px solid #eeeeee;
}
.product-option-title,
.product-note-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.product-option-title h3,
.product-note-title h3 {
  margin: 0;
  color: #3a3a3f;
  font-size: 16px;
  font-weight: 900;
}
.product-option-title p {
  margin: 4px 0 0;
  color: #888;
  font-size: 13px;
}
.product-option-title > span {
  padding: 5px 9px;
  border-radius: 999px;
  background: #f5f5f5;
  color: #747474;
  font-size: 11px;
  font-weight: 900;
}
.product-note-title > span {
  color: #999;
  font-size: 12px;
}
.product-addons {
  display: grid;
}
.addon-row {
  width: 100%;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 8px 14px 0;
  border: 0;
  border-top: 1px solid #f0f0f0;
  background: transparent;
  color: #333;
  text-align: left;
}
.addon-row:first-child { border-top: 0; }
.addon-row > span {
  display: grid;
  gap: 4px;
}
.addon-row strong {
  font-size: 15px;
  font-weight: 800;
}
.addon-row small {
  color: #666;
  font-size: 13px;
}
.addon-row > b {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ea1d2c;
  font-size: 23px;
  font-weight: 500;
  transition: .18s ease;
}
.addon-row:hover > b {
  background: #fff0f1;
  transform: scale(1.08);
}
.addon-row.selected > b {
  background: #eaf8ef;
  color: #249055;
  font-size: 16px;
  font-weight: 900;
}
.product-note-group textarea {
  width: 100%;
  min-height: 105px;
  resize: vertical;
  border: 1px solid #dedede;
  border-radius: 5px;
  padding: 15px 16px;
  outline: 0;
  color: #333;
  background: #fff;
}
.product-note-group textarea:focus {
  border-color: #ea1d2c;
  box-shadow: 0 0 0 1px #ea1d2c;
}
.product-modal-footer {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 20px;
  border-top: 1px solid #e8e8e8;
  background: #fff;
  box-shadow: 0 -8px 22px rgba(0,0,0,.04);
}
.product-qty-selector {
  height: 52px;
  display: grid;
  grid-template-columns: 1fr 38px 1fr;
  align-items: center;
  border: 1px solid #dedede;
  border-radius: 5px;
  overflow: hidden;
}
.product-qty-selector button {
  height: 100%;
  border: 0;
  background: #fff;
  color: #ea1d2c;
  font-size: 22px;
}
.product-qty-selector button:hover { background: #fff5f5; }
.product-qty-selector b {
  text-align: center;
  color: #333;
  font-size: 16px;
}
.product-add-confirm {
  min-width: 0;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 20px;
  border: 0;
  border-radius: 5px;
  background: #ea1d2c;
  color: #fff;
  font-weight: 900;
}
.product-add-confirm:hover {
  background: #c91522;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(234, 29, 44, .22);
}

/* Carrinho lateral universal */
.content-grid.cart-visible,
.content-grid:not(.cart-visible) {
  grid-template-columns: minmax(0, 1fr) !important;
}
.content-grid .products-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
.desktop-cart {
  display: none !important;
}
.drawer-backdrop {
  display: block !important;
  position: fixed;
  inset: 0;
  z-index: 74;
  background: rgba(0,0,0,.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.mobile-drawer {
  display: block !important;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  width: min(430px, 100vw);
  max-height: none;
  z-index: 75;
  overflow-y: auto;
  padding: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: -12px 0 38px rgba(0,0,0,.14);
  transform: translateX(104%);
  transition: transform .26s cubic-bezier(.2,.75,.2,1);
}
.mobile-drawer.open {
  transform: translateX(0);
}
.mobile-drawer .drawer-handle {
  display: none;
}
.mobile-drawer .mobile-version {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 22px 28px 26px;
}
.mobile-drawer .cart-card-header {
  margin-bottom: 12px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}
.mobile-drawer .cart-card-header h3 {
  font-size: 21px;
}
.mobile-drawer .cart-items {
  max-height: none;
  overflow: visible;
  gap: 0;
}
.mobile-drawer .coupon-box {
  margin-top: 18px;
}
.mobile-drawer .mobile-summary {
  margin-top: auto;
}
.cart-item {
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 16px 0;
}
.cart-item-emoji {
  width: 52px;
  height: 52px;
  overflow: hidden;
}
.cart-item-main {
  min-width: 0;
}
.cart-item-main > strong {
  font-size: 14px;
  line-height: 1.35;
}
.cart-item-main > small {
  display: block;
  margin-top: 4px;
  color: #878787;
  font-size: 11px;
  line-height: 1.35;
}
.cart-item-main > span {
  margin-top: 7px;
  color: #333;
  font-size: 14px;
  font-weight: 900;
}
.cart-item-links {
  display: flex;
  gap: 14px;
  margin-top: 8px;
}
.cart-item-links button {
  border: 0;
  padding: 0;
  background: transparent;
  color: #ea1d2c;
  font-size: 12px;
  font-weight: 800;
}
.cart-item-links button:last-child { color: #999; }
.cart-item .qty-control {
  align-self: center;
  flex-direction: column-reverse;
  height: auto;
  gap: 4px;
}
.cart-item .qty-control button {
  width: 26px;
  height: 26px;
  font-size: 16px;
}

/* Botão flutuante igual aos apps de delivery */
.topbar .floating-cart-button {
  position: fixed;
  left: 18px;
  bottom: 18px;
  top: auto;
  right: auto;
  z-index: 60;
  min-width: 128px;
  min-height: 58px;
  padding: 9px 16px 9px 13px;
  border-radius: 999px;
  background: #ea1d2c;
  box-shadow: 0 11px 30px rgba(234,29,44,.30);
  gap: 10px;
  animation: floatingCartIn .28s cubic-bezier(.2,.8,.2,1);
}
@keyframes floatingCartIn {
  from { opacity: 0; transform: translateY(15px) scale(.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.floating-cart-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
}
.floating-cart-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.floating-cart-copy {
  display: grid;
  justify-items: start;
  line-height: 1.08;
}
.floating-cart-copy strong {
  color: #fff;
  font-size: 14px;
}
.floating-cart-copy small {
  margin-top: 4px;
  color: rgba(255,255,255,.92);
  font-size: 11px;
  font-weight: 700;
}
.floating-cart-copy small b {
  display: inline;
  min-width: 0;
  height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

@media (max-width: 900px) {
  .product-dialog {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }
  .product-modal-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 34vh minmax(0, 1fr);
  }
  .product-modal-visual {
    border-right: 0;
    border-bottom: 1px solid #eee;
  }
  .product-modal-visual .product-emoji {
    font-size: 115px;
  }
  .product-modal-header {
    padding: 20px 54px 16px 20px;
  }
  .product-option-group,
  .product-note-group {
    padding: 18px 20px;
  }
  .product-modal-footer {
    grid-template-columns: 108px minmax(0, 1fr);
    padding: 12px 14px max(12px, env(safe-area-inset-bottom));
  }
  .content-grid .products-grid {
    grid-template-columns: 1fr !important;
  }
  .topbar .floating-cart-button {
    left: 14px;
    right: 14px;
    bottom: 14px;
    width: auto;
    justify-content: center;
  }
  .mobile-drawer {
    top: auto;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 90dvh;
    border-radius: 18px 18px 0 0;
    transform: translateY(104%);
  }
  .mobile-drawer.open { transform: translateY(0); }
  .mobile-drawer .drawer-handle {
    display: block;
    width: 44px;
    height: 4px;
    margin: 10px auto 0;
    border-radius: 999px;
    background: #ddd;
  }
  .mobile-drawer .mobile-version {
    min-height: 0;
    padding: 14px 18px max(20px, env(safe-area-inset-bottom));
  }
  .mobile-drawer .cart-items {
    max-height: 44dvh;
    overflow-y: auto;
  }
}

@media (max-width: 520px) {
  .product-modal-shell {
    grid-template-rows: 29vh minmax(0, 1fr);
  }
  .product-modal-header h2 { font-size: 19px; }
  .product-modal-header > span { font-size: 13px; }
  .product-modal-footer {
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 9px;
  }
  .product-add-confirm {
    padding: 0 13px;
    gap: 8px;
  }
  .product-add-confirm strong { font-size: 13px; }
}

.cart-store-context small {
  display: block;
  margin-bottom: 4px;
  color: #888;
  font-size: 12px;
}
.cart-store-context h3 {
  margin: 0;
}

/* Movimento reforçado do personalizador e carrinho */
.product-dialog[open] {
  animation: dialogBackdropIn .36s ease both;
}
.product-dialog[open] .product-modal-shell {
  animation: modalSpringIn .62s cubic-bezier(.16,.86,.25,1.14) both;
  transform-origin: center;
}
.product-dialog[open] .product-modal-visual {
  animation: modalVisualIn .68s .08s cubic-bezier(.16,.84,.25,1) both;
}
.product-dialog[open] .product-modal-header,
.product-dialog[open] .product-option-group,
.product-dialog[open] .product-note-group,
.product-dialog[open] .product-modal-footer {
  opacity: 0;
  transform: translateY(24px);
  animation: modalContentIn .54s cubic-bezier(.16,.84,.25,1) forwards;
}
.product-dialog[open] .product-modal-header { animation-delay: .12s; }
.product-dialog[open] .product-option-group { animation-delay: .18s; }
.product-dialog[open] .product-note-group { animation-delay: .24s; }
.product-dialog[open] .product-modal-footer { animation-delay: .30s; }
.product-dialog.is-confirming .product-modal-shell {
  animation: modalConfirmOut .56s cubic-bezier(.4,0,.2,1) both;
}
.product-dialog::backdrop {
  animation: backdropFadeIn .34s ease both;
}
.product-modal-close {
  transition: transform .38s cubic-bezier(.18,1.24,.36,1), color .22s ease, box-shadow .28s ease, background-color .22s ease;
}
.product-modal-close:hover {
  transform: rotate(92deg) scale(1.08);
  box-shadow: 0 10px 24px rgba(0,0,0,.15);
}
.product-modal-scroll { scroll-behavior: smooth; }
.product-option-title h3,
.product-note-title h3 { transition: transform .28s ease, color .28s ease; }
.product-option-group:hover .product-option-title h3,
.product-note-group:hover .product-note-title h3 { transform: translateX(3px); color: #232329; }
.addon-row {
  transition: transform .34s cubic-bezier(.18,1.24,.36,1), background-color .24s ease, padding .3s ease, border-color .24s ease;
}
.addon-row::before {
  content: "";
  position: absolute;
  inset: 8px 0;
  border-radius: 8px;
  z-index: -1;
  background: linear-gradient(90deg, rgba(234,29,44,.065), transparent 78%);
  opacity: 0;
  transform: scaleX(.88);
  transform-origin: left;
  transition: opacity .25s ease, transform .32s cubic-bezier(.16,.84,.25,1);
}
.addon-row:hover { transform: translateX(7px); padding-left: 8px; }
.addon-row:hover::before,
.addon-row.selected::before { opacity: 1; transform: scaleX(1); }
.addon-row.selected { animation: addonSelected .5s cubic-bezier(.18,1.24,.36,1); }
.addon-row.selected > b { animation: addonCheck .5s cubic-bezier(.18,1.24,.36,1); }
.product-note-group textarea { transition: min-height .3s ease, border-color .25s ease, box-shadow .25s ease, transform .3s ease; }
.product-note-group textarea:focus { min-height: 120px; transform: translateY(-2px); }
.product-qty-selector { transition: transform .3s ease, box-shadow .3s ease, border-color .25s ease; }
.product-qty-selector:focus-within,
.product-qty-selector:hover { transform: translateY(-2px); border-color: rgba(234,29,44,.35); box-shadow: 0 9px 18px rgba(0,0,0,.08); }
.product-qty-selector b { transition: transform .28s cubic-bezier(.18,1.24,.36,1); }
.product-add-confirm {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.product-add-confirm::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 18%, rgba(255,255,255,.28) 44%, transparent 70%);
  transform: translateX(-130%);
  transition: transform .75s ease;
}
.product-add-confirm:hover::before { transform: translateX(130%); }
.product-add-confirm.is-adding {
  pointer-events: none;
  animation: addButtonLoading .76s ease-in-out infinite alternate;
}
.product-add-confirm.is-adding span { opacity: .65; }
.product-add-confirm.is-adding::after {
  content: "";
  width: 18px;
  height: 18px;
  margin-left: auto;
  border: 2px solid rgba(255,255,255,.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: addButtonSpin .65s linear infinite;
}
.product-add-confirm.is-adding strong { display: none; }
.product-add-confirm.is-success {
  background: #20a15b;
  animation: addSuccess .68s cubic-bezier(.18,1.24,.36,1);
}
.product-add-confirm.is-success span { font-size: 0; }
.product-add-confirm.is-success span::after { content: "Adicionado ✓"; font-size: 14px; }

.mobile-drawer {
  transition: transform .46s cubic-bezier(.16,.84,.25,1) !important;
  will-change: transform;
}
.mobile-drawer.open .cart-card-header { animation: drawerHeaderIn .48s .1s cubic-bezier(.16,.84,.25,1) both; }
.mobile-drawer.open .coupon-box { animation: drawerSectionIn .5s .23s cubic-bezier(.16,.84,.25,1) both; }
.mobile-drawer.open .mobile-summary { animation: drawerSectionIn .5s .3s cubic-bezier(.16,.84,.25,1) both; }
.mobile-drawer.drawer-spring { animation: drawerSettle .66s cubic-bezier(.18,1.24,.36,1); }
.drawer-backdrop { transition: opacity .38s ease, backdrop-filter .38s ease !important; }
.drawer-backdrop.open { backdrop-filter: blur(3px); }
.cart-item-links button { transition: transform .25s ease, color .2s ease; }
.cart-item-links button:hover { transform: translateY(-2px); }
.cart-item-links button:last-child:hover { color: #d43a45; }

@keyframes dialogBackdropIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes backdropFadeIn { from { background: rgba(0,0,0,0); backdrop-filter: blur(0); } to { background: rgba(0,0,0,.58); backdrop-filter: blur(3px); } }
@keyframes modalSpringIn { 0% { opacity:0; transform:translateY(48px) scale(.92); } 70% { opacity:1; transform:translateY(-5px) scale(1.012); } 100% { opacity:1; transform:none; } }
@keyframes modalVisualIn { from { opacity:0; transform:scale(1.08); filter:blur(7px) saturate(.7); } to { opacity:1; transform:scale(1); filter:none; } }
@keyframes modalContentIn { to { opacity:1; transform:none; } }
@keyframes modalConfirmOut { 0% { transform:scale(1); opacity:1; } 36% { transform:scale(.985); } 100% { transform:translateY(22px) scale(.95); opacity:0; } }
@keyframes addonSelected { 0%,100% { transform:translateX(0) scale(1); } 45% { transform:translateX(7px) scale(.988); } 75% { transform:translateX(3px) scale(1.006); } }
@keyframes addonCheck { 0% { transform:scale(.45) rotate(-35deg); } 70% { transform:scale(1.18) rotate(5deg); } 100% { transform:scale(1) rotate(0); } }
@keyframes addButtonLoading { from { box-shadow:0 9px 22px rgba(234,29,44,.18); filter:saturate(1); } to { box-shadow:0 15px 30px rgba(234,29,44,.35); filter:saturate(1.18); } }
@keyframes addButtonSpin { to { transform:rotate(360deg); } }
@keyframes addSuccess { 0% { transform:scale(.96); } 55% { transform:scale(1.035); box-shadow:0 0 0 7px rgba(32,161,91,.13); } 100% { transform:scale(1); } }
@keyframes drawerHeaderIn { from { opacity:0; transform:translateX(22px); } to { opacity:1; transform:none; } }
@keyframes drawerSectionIn { from { opacity:0; transform:translateY(18px); } to { opacity:1; transform:none; } }
@keyframes drawerSettle { 0% { filter:brightness(.98); } 55% { filter:brightness(1.025); } 100% { filter:none; } }


/* =========================================================
   HOTFIX 2026-07-14 — modal nunca pode abrir vazio
   ========================================================= */
.product-dialog[open],
.product-dialog.dialog-fallback-open {
  display: block;
  opacity: 1 !important;
  visibility: visible !important;
}

.product-dialog[open] .product-modal-shell,
.product-dialog[open] .product-modal-close,
.product-dialog[open] .product-modal-visual,
.product-dialog[open] .product-modal-content,
.product-dialog[open] .product-modal-header,
.product-dialog[open] .product-modal-scroll,
.product-dialog[open] .product-option-group,
.product-dialog[open] .product-note-group,
.product-dialog[open] .product-modal-footer,
.product-dialog.dialog-fallback-open .product-modal-shell,
.product-dialog.dialog-fallback-open .product-modal-close,
.product-dialog.dialog-fallback-open .product-modal-visual,
.product-dialog.dialog-fallback-open .product-modal-content,
.product-dialog.dialog-fallback-open .product-modal-header,
.product-dialog.dialog-fallback-open .product-modal-scroll,
.product-dialog.dialog-fallback-open .product-option-group,
.product-dialog.dialog-fallback-open .product-note-group,
.product-dialog.dialog-fallback-open .product-modal-footer {
  opacity: 1 !important;
  visibility: visible !important;
  filter: none !important;
}

/* A animação antiga iniciava vários blocos em opacity:0 e podia congelar.
   Esta versão anima apenas transform, então mesmo uma falha mantém o conteúdo visível. */
.product-dialog[open] .product-modal-shell,
.product-dialog.dialog-fallback-open .product-modal-shell {
  animation: productModalSafeEnter .34s cubic-bezier(.16,.84,.25,1) both !important;
}
.product-dialog[open] .product-modal-visual,
.product-dialog.dialog-fallback-open .product-modal-visual {
  animation: productVisualSafeEnter .38s .03s cubic-bezier(.16,.84,.25,1) both !important;
}
.product-dialog[open] .product-modal-header,
.product-dialog[open] .product-option-group,
.product-dialog[open] .product-note-group,
.product-dialog[open] .product-modal-footer,
.product-dialog.dialog-fallback-open .product-modal-header,
.product-dialog.dialog-fallback-open .product-option-group,
.product-dialog.dialog-fallback-open .product-note-group,
.product-dialog.dialog-fallback-open .product-modal-footer {
  transform: none;
  animation: productContentSafeEnter .30s cubic-bezier(.16,.84,.25,1) both !important;
}
.product-dialog[open] .product-modal-header { animation-delay: .04s !important; }
.product-dialog[open] .product-option-group { animation-delay: .07s !important; }
.product-dialog[open] .product-note-group { animation-delay: .10s !important; }
.product-dialog[open] .product-modal-footer { animation-delay: .13s !important; }

.product-dialog.is-opening-safe .product-modal-shell,
.product-dialog.is-opening-safe .product-modal-visual,
.product-dialog.is-opening-safe .product-modal-header,
.product-dialog.is-opening-safe .product-option-group,
.product-dialog.is-opening-safe .product-note-group,
.product-dialog.is-opening-safe .product-modal-footer {
  opacity: 1 !important;
  visibility: visible !important;
}

@keyframes productModalSafeEnter {
  from { transform: translateY(18px) scale(.985); }
  to { transform: translateY(0) scale(1); }
}
@keyframes productVisualSafeEnter {
  from { transform: scale(1.025); }
  to { transform: scale(1); }
}
@keyframes productContentSafeEnter {
  from { transform: translateY(8px); }
  to { transform: translateY(0); }
}

/* Fallback para navegadores que não aceitam showModal por algum motivo. */
.product-dialog.dialog-fallback-open {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  z-index: 10010;
}
.product-dialog.dialog-fallback-open::backdrop { display: none; }

@media (prefers-reduced-motion: reduce) {
  .product-dialog[open] *,
  .product-dialog.dialog-fallback-open * {
    animation: none !important;
    transition-duration: .01ms !important;
  }
}

/* HOTFIX DE PERFORMANCE 2026-07-16
   Remove filtros de tela inteira, animações contínuas e composição excessiva. */
.product-dialog::backdrop {
  background: rgba(20,20,24,.56) !important;
  backdrop-filter: none !important;
  animation: none !important;
}
.product-dialog[open],
.product-dialog.dialog-fallback-open {
  animation: none !important;
}
.product-dialog[open] .product-modal-shell,
.product-dialog.dialog-fallback-open .product-modal-shell {
  animation: productModalFastEnter .2s cubic-bezier(.2,.8,.2,1) both !important;
  filter: none !important;
}
.product-dialog[open] .product-modal-visual,
.product-dialog.dialog-fallback-open .product-modal-visual,
.product-dialog[open] .product-modal-header,
.product-dialog[open] .product-option-group,
.product-dialog[open] .product-note-group,
.product-dialog[open] .product-modal-footer,
.product-dialog.dialog-fallback-open .product-modal-header,
.product-dialog.dialog-fallback-open .product-option-group,
.product-dialog.dialog-fallback-open .product-note-group,
.product-dialog.dialog-fallback-open .product-modal-footer {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
  animation: none !important;
}
.product-dialog.is-confirming .product-modal-shell {
  animation: productModalFastExit .14s ease both !important;
}
.product-modal-visual,
.product-modal-content {
  contain: paint;
}
.product-modal-visual .product-emoji {
  animation: none !important;
  filter: none !important;
}
.product-modal-scroll { scroll-behavior: auto !important; }
.product-modal-close,
.product-modal-shell,
.mobile-drawer {
  will-change: auto !important;
}
.product-add-confirm.is-adding {
  animation: none !important;
  filter: none !important;
}
.drawer-backdrop {
  transition: opacity .2s ease !important;
  backdrop-filter: none !important;
}
.drawer-backdrop.open { backdrop-filter: none !important; }
.mobile-drawer.open,
.mobile-drawer.open .cart-card-header,
.mobile-drawer.open .coupon-box,
.mobile-drawer.open .mobile-summary,
.mobile-drawer.drawer-spring {
  animation: none !important;
  filter: none !important;
}
.addon-row.selected,
.addon-row.selected > b {
  animation: none !important;
}

@keyframes productModalFastEnter {
  from { opacity: .7; transform: translateY(8px) scale(.992); }
  to { opacity: 1; transform: none; }
}
@keyframes productModalFastExit {
  to { opacity: .85; transform: scale(.992); }
}
