.layout-cart[hidden],
.layout-cart-trigger[hidden] { display: none !important; }

.layout-cart-trigger {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 9400;
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  gap: .55rem;
  border: 1px solid rgb(191 219 254 / 90%);
  border-radius: 999px;
  background: #fff;
  padding: .7rem .9rem;
  color: #1d4ed8;
  box-shadow: 0 12px 34px rgb(15 23 42 / 18%);
  font: 800 .78rem/1 'Inter', sans-serif;
  cursor: pointer;
}

.layout-cart-trigger svg { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.8; }
.layout-cart-trigger__count { display: grid; min-width: 1.35rem; height: 1.35rem; place-items: center; border-radius: 999px; background: #2563eb; color: #fff; font-size: .68rem; }

.layout-cart { position: fixed; inset: 0; z-index: 9800; }
.layout-cart__backdrop { position: absolute; inset: 0; border: 0; background: rgb(15 23 42 / 52%); backdrop-filter: blur(5px); cursor: pointer; }
.layout-cart__panel { position: absolute; top: 0; right: 0; bottom: 0; display: flex; width: min(100%, 28rem); flex-direction: column; background: #f8fafc; box-shadow: -22px 0 60px rgb(15 23 42 / 22%); }
.layout-cart__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; border-bottom: 1px solid #e2e8f0; background: #fff; padding: 1.25rem; }
.layout-cart__header h2 { margin: 0; color: #0f172a; font: 800 1.35rem/1.2 'Outfit', sans-serif; }
.layout-cart__header p { margin: .25rem 0 0; color: #64748b; font: 500 .78rem/1.45 'Inter', sans-serif; }
.layout-cart__close { display: grid; width: 2.5rem; height: 2.5rem; place-items: center; border: 1px solid #e2e8f0; border-radius: .8rem; background: #fff; color: #64748b; font-size: 1.4rem; cursor: pointer; }
.layout-cart__items { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: .75rem; overflow-y: auto; padding: 1rem; overscroll-behavior: contain; }
.layout-cart__empty { margin: auto; max-width: 18rem; color: #64748b; text-align: center; font: 500 .88rem/1.6 'Inter', sans-serif; }
.layout-cart__item { display: grid; grid-template-columns: 4.25rem minmax(0, 1fr) auto; gap: .8rem; align-items: center; border: 1px solid #e2e8f0; border-radius: 1rem; background: #fff; padding: .75rem; }
.layout-cart__item img { width: 4.25rem; height: 3.5rem; border-radius: .65rem; object-fit: cover; background: #e2e8f0; }
.layout-cart__item h3 { margin: 0; color: #0f172a; font: 750 .82rem/1.3 'Inter', sans-serif; }
.layout-cart__item strong { display: block; margin-top: .25rem; color: #0f172a; font: 800 .82rem/1 'Inter', sans-serif; }
.layout-cart__item-meta { margin: .15rem 0 .35rem; color: #64748b; font: 500 .72rem/1.35 'Inter', sans-serif; }
.layout-cart__quantity { display: inline-flex; align-items: center; gap: .45rem; margin: 0 0 .4rem; padding: .2rem; border: 1px solid #cbd5e1; border-radius: .65rem; background: #fff; }
.layout-cart__quantity button { width: 1.65rem; height: 1.65rem; border: 0; border-radius: .45rem; background: #eff6ff; color: #1d4ed8; font-weight: 800; cursor: pointer; }
.layout-cart__quantity button:disabled { opacity: .38; cursor: not-allowed; }
.layout-cart__quantity span { min-width: 1.5rem; text-align: center; color: #0f172a; font-size: .78rem; font-weight: 800; }
.layout-cart__remove { border: 0; background: transparent; color: #e11d48; padding: .4rem; font: 750 .7rem/1 'Inter', sans-serif; cursor: pointer; }
.layout-cart__footer { border-top: 1px solid #e2e8f0; background: #fff; padding: 1rem 1.1rem calc(1rem + env(safe-area-inset-bottom)); }
.layout-cart__total { display: flex; justify-content: space-between; margin-bottom: .8rem; color: #475569; font: 650 .86rem/1.3 'Inter', sans-serif; }
.layout-cart__total strong { color: #0f172a; font-size: 1.15rem; }
.layout-cart__checkout { width: 100%; min-height: 3.15rem; border: 0; border-radius: .9rem; background: #2563eb; color: #fff; font: 800 .88rem/1 'Inter', sans-serif; cursor: pointer; box-shadow: 0 10px 24px rgb(37 99 235 / 24%); }
.layout-cart__checkout:disabled { background: #cbd5e1; box-shadow: none; cursor: not-allowed; }
.layout-cart-add { display: inline-flex; min-height: 2.55rem; align-items: center; justify-content: center; gap: .35rem; border: 1px solid #bfdbfe; border-radius: .75rem; background: #eff6ff; padding: .55rem .7rem; color: #1d4ed8; font: 800 .72rem/1.1 'Inter', sans-serif; cursor: pointer; }
.layout-cart-add svg { display: block; width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2; }
.layout-cart-add__icon { flex: none; width: 1.1rem !important; height: 1.1rem !important; }
.layout-cart-add--detail { gap: .55rem; font-size: .82rem; }
.home-catalog-card-actions { display: flex; align-items: center; gap: .5rem; }
body.layout-cart-disabled .layout-cart-add { display: none !important; }
.layout-cart-toast { position: fixed; right: 1rem; bottom: 5rem; z-index: 10020; max-width: min(22rem, calc(100vw - 2rem)); border-radius: .9rem; background: #0f172a; padding: .8rem 1rem; color: #fff; box-shadow: 0 14px 40px rgb(15 23 42 / 28%); font: 700 .78rem/1.4 'Inter', sans-serif; }
body.layout-cart-open { overflow: hidden; }
body.layout-cart-open .storefront-bottom-navigation,
body.layout-cart-open .product-bottom-nav { pointer-events: none; opacity: 0; transform: translateY(110%); }

#checkout-modal-content.is-cart-checkout { max-width: 64rem; }
#checkout-modal-content.is-cart-checkout #checkout-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, .85fr); }
#checkout-cart-summary { border-left: 1px solid #e2e8f0; background: #f8fafc; padding: 1.25rem; }
.checkout-cart-summary__title { margin: 0 0 1rem; color: #0f172a; font: 800 1rem/1.2 'Outfit', sans-serif; }
.checkout-cart-summary__items { display: grid; gap: .65rem; }
.checkout-cart-summary__item { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid #e2e8f0; padding-bottom: .65rem; color: #475569; font: 600 .78rem/1.35 'Inter', sans-serif; }
.checkout-cart-summary__item strong { flex: none; color: #0f172a; }
.checkout-cart-summary__totals { display: grid; gap: .5rem; margin-top: 1rem; color: #475569; font: 650 .8rem/1.3 'Inter', sans-serif; }
.checkout-cart-summary__row { display: flex; justify-content: space-between; gap: 1rem; }
.checkout-cart-summary__row.is-total { border-top: 1px solid #cbd5e1; padding-top: .75rem; color: #0f172a; font-size: .95rem; font-weight: 850; }

@media (min-width: 768px) {
  .resource-card-commerce {
    display: flex !important;
    align-items: flex-end !important;
    justify-content: space-between !important;
    gap: .25rem !important;
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .resource-card-price {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
  }
  .resource-card-price__value {
    display: block !important;
    white-space: nowrap !important;
    line-height: 1.15 !important;
  }
  .resource-card-actions {
    display: flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    gap: .25rem !important;
    margin-left: auto !important;
    flex-shrink: 0 !important;
  }
  .resource-card-action {
    min-height: 2.25rem !important;
    padding-right: .55rem !important;
    padding-left: .55rem !important;
    font-size: .74rem !important;
    font-weight: 750 !important;
    border-radius: .7rem !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
  }
  .resource-card-actions .layout-cart-add--icon {
    width: 2.25rem !important;
    min-width: 2.25rem !important;
    height: 2.25rem !important;
    min-height: 2.25rem !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    border-radius: .7rem !important;
    box-sizing: border-box !important;
  }
}

@media (max-width: 767px) {
  .layout-cart-trigger { right: .75rem; bottom: calc(4.65rem + env(safe-area-inset-bottom)); padding: .65rem; }
  .layout-cart-trigger__label { display: none; }
  .layout-cart__panel { top: max(.5rem, env(safe-area-inset-top)); width: 100%; border-radius: 1.25rem 1.25rem 0 0; }
  #checkout-modal-content.is-cart-checkout { max-height: calc(100dvh - 1.25rem); overflow: hidden; }
  #checkout-modal-content.is-cart-checkout #checkout-body { display: flex; flex-direction: column; overflow-y: auto; }
  #checkout-modal-content.is-cart-checkout #checkout-form { order: 2; }
  #checkout-cart-summary { order: 1; border-right: 0; border-bottom: 1px solid #e2e8f0; padding: .9rem 1rem; }
  .checkout-cart-summary__items { max-height: 8.5rem; overflow-y: auto; }
  .resource-card-commerce {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.45rem !important;
    margin-top: 0.55rem !important;
    padding-top: 0.55rem !important;
  }
  .resource-card-actions {
    display: flex !important;
    align-items: center !important;
    gap: .35rem !important;
    width: 100% !important;
    flex-shrink: 0 !important;
  }
  .resource-card-action {
    display: inline-flex !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    justify-content: center !important;
    text-align: center !important;
    white-space: nowrap !important;
    min-height: 2.35rem !important;
    font-size: 0.75rem !important;
    padding: 0.45rem 0.65rem !important;
  }
  .resource-card-actions .layout-cart-add--icon {
    width: 2.35rem !important;
    min-width: 2.35rem !important;
    height: 2.35rem !important;
    min-height: 2.35rem !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
  }
}

/* Blindagem Mobile do Modal de Pré-Checkout */
#henny-checkout-modal {
  padding-top: max(0.65rem, env(safe-area-inset-top));
  padding-bottom: max(0.65rem, env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}

#checkout-modal-content {
  display: flex !important;
  flex-direction: column !important;
  max-height: calc(100dvh - 1.25rem) !important;
  max-height: calc(100vh - 1.25rem);
  margin: auto !important;
  overflow: hidden !important;
}

#checkout-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Animação sutil do produto entrando no carrinho */
.layout-cart-fly-item {
  position: fixed;
  z-index: 10050;
  pointer-events: none;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 2px solid #ffffff;
  background-color: #2563eb;
  background-size: cover;
  background-position: center;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.45);
  transition: transform 0.62s cubic-bezier(0.2, 0.85, 0.25, 1), opacity 0.62s cubic-bezier(0.2, 0.85, 0.25, 1);
  transform-origin: center center;
}

@keyframes layout-cart-bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.18); }
  70% { transform: scale(0.96); }
  100% { transform: scale(1); }
}

.layout-cart-trigger--bump {
  animation: layout-cart-bump 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes layout-cart-btn-active {
  0% { transform: scale(1); }
  45% { transform: scale(0.96); }
  100% { transform: scale(1); }
}

.layout-cart-add--active {
  animation: layout-cart-btn-active 0.25s ease-out;
}

