[hidden] {
  display: none !important;
}

body {
  overflow-x: hidden;
}

/* One clean cart scroll: header and checkout footer always stay visible. */
.drawer {
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

.drawer-head,
.cart-footer {
  flex: 0 0 auto;
  background: #fff;
}

.cart-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.cart-lines {
  flex: none;
  overflow: visible;
}

.cart-lines .empty-state {
  margin: 0;
  padding: 18px 12px;
}

.cart-footer {
  z-index: 2;
  padding: 12px 16px calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(24, 32, 43, 0.08);
}

.cart-footer > div {
  margin-bottom: 8px;
}

/* Fast catalog, clear cart feedback, stock and secure payment proof UI. */
.product-card {
  content-visibility: auto;
  contain-intrinsic-size: 280px 390px;
}

.product-card.promoted {
  border-color: #38a59d;
  box-shadow: 0 8px 30px rgba(11, 117, 111, 0.12);
}

.product-card.out-of-stock {
  filter: saturate(0.55);
  opacity: 0.82;
}

.product-image {
  position: relative;
}

.product-image img {
  position: absolute;
  inset: 0;
  background: #f0f2f5;
}

.product-zoom {
  position: absolute;
  inset: 0;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.product-image.image-failed img {
  display: none;
}

.image-fallback {
  font-size: 12px;
}

.update-badge,
.stock-badge {
  position: absolute;
  z-index: 2;
  left: 7px;
  top: 7px;
  padding: 5px 7px;
  border-radius: 999px;
  color: #fff;
  background: var(--teal);
  font-size: 9px;
  font-weight: 900;
}

.stock-badge {
  left: auto;
  right: 7px;
  background: #475569;
}

.add-button {
  transition: 0.18s;
}

.add-button.added {
  background: var(--teal);
  transform: scale(1.04);
}

.add-button:disabled,
.qty-input:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.catalog-more {
  text-align: center;
  padding: 22px;
}

.order-summary {
  display: grid;
  gap: 3px;
}

.payment-proof-form {
  grid-column: 1 / -1;
  margin-top: 10px;
  padding: 14px;
  border-radius: 14px;
  background: #f5faf9;
  border: 1px solid #b9e5df;
  grid-template-columns: 1fr auto;
  align-items: end;
}

.payment-proof-form label {
  min-width: 0;
}

.payment-proof-form input {
  padding: 9px;
  background: #fff;
}

.payment-proof-form small {
  grid-column: 1 / -1;
  color: var(--teal);
}

.proof-done {
  grid-column: 1 / -1;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.cart-line {
  grid-template-columns: 54px minmax(0, 1fr) auto;
}

.cart-line > img {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  object-fit: cover;
  background: #f1f5f9;
}

.cart-qty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
}

.cart-qty button {
  width: 28px;
  height: 28px;
  border: 1px solid #d5e0e4;
  border-radius: 8px;
  background: #fff;
  color: var(--teal);
  font-weight: 900;
}

.payment-accounts,
.required-proof {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding: 13px;
  border: 1px solid #b9e5df;
  border-radius: 14px;
  background: #f5faf9;
}

.payment-accounts h3,
.payment-accounts p {
  margin: 0;
}

.payment-accounts article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px;
  border-radius: 10px;
  background: #fff;
}

.payment-accounts article span {
  display: grid;
}

.payment-accounts article strong {
  color: var(--teal);
  word-break: break-all;
}

.account-warning {
  color: #b42318;
  font-weight: 800;
}

.required-proof > span {
  font-weight: 900;
}

.required-proof > span b {
  color: #b42318;
}

.required-proof input {
  width: 100%;
  padding: 10px;
  border: 1px dashed #6cbdb6;
  border-radius: 10px;
  background: #fff;
}

.image-modal {
  width: min(94vw, 760px);
  max-height: 92vh;
  padding: 38px 12px 12px;
  border: 0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
}

.image-modal::backdrop { background: rgba(2, 8, 23, .76); }
.image-modal > button { position: absolute; right: 9px; top: 7px; }
.image-modal img { display: block; max-width: 100%; max-height: 80vh; margin: auto; object-fit: contain; }

.chat-bubble {
  max-width: 84%;
  margin: 7px 0;
  padding: 9px 11px;
  border-radius: 14px 14px 14px 4px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15,23,42,.08);
}
.chat-bubble.mine { margin-left: auto; border-radius: 14px 14px 4px 14px; background: #dff7f2; }
.chat-bubble p { margin: 0 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-bubble small { display: block; color: #64748b; font-size: 9px; text-align: right; }
.chat-picture { border: 0; border-radius: 9px; padding: 8px; background: #eef7f6; color: var(--teal); font-weight: 800; }
.chat-empty { margin: auto; color: #64748b; text-align: center; }

.cart-pulse {
  animation: cart-pulse 0.55s ease;
}

@keyframes cart-pulse {
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 9px rgba(244, 81, 30, 0.15);
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 82px;
  transform: translateX(-50%);
  z-index: 60;
  background: var(--teal);
  color: #fff;
  border-radius: 12px;
  padding: 11px 16px;
  max-width: min(92vw, 520px);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

.toast.error {
  background: #b42318;
}

.mobile-nav button span {
  position: relative;
}

.mobile-nav button span b {
  position: absolute;
  right: -10px;
  top: -4px;
  display: grid;
  place-items: center;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font-size: 8px;
}

@media (max-width: 640px) {
  .product-card {
    contain-intrinsic-size: 125px 205px;
  }

  .update-badge,
  .stock-badge {
    top: 4px;
    left: 4px;
    padding: 3px 4px;
    font-size: 6.5px;
  }

  .stock-badge {
    left: auto;
    right: 4px;
  }

  .order-card {
    padding: 12px;
  }

  .payment-proof-form {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .payment-proof-form button {
    width: 100%;
  }

  .drawer {
    width: 100vw;
    max-width: none;
  }
  .drawer-head { padding: 14px 16px; }
  .drawer-head h2 { font-size: 21px; }
  .cart-scroll { padding-bottom: 4px; }
  .cart-lines { padding: 10px 12px; }
  .payment-accounts,
  .required-proof { margin: 8px 10px; padding: 10px; }
  .delivery-options { padding: 10px; }
  .delivery-options label { padding: 8px 10px; margin-top: 6px; }
  .note-field { padding: 0 10px 8px; }
  .note-field textarea { min-height: 64px; padding: 10px; }
  .cart-footer { padding: 10px 12px calc(8px + env(safe-area-inset-bottom)); }
  .cart-footer .primary-button { padding: 12px 16px; }
  .cart-footer .form-status { min-height: 0; margin: 6px 0 0; }
  .cart-line { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .cart-line > img { width: 48px; height: 48px; }
  .payment-accounts article { align-items: flex-start; flex-direction: column; }
}

/* Compact cart checkout: keeps the important payment and delivery details visible. */
.drawer { width: min(410px, 100vw); }
.drawer-head { padding: 12px 15px; }
.drawer-head .eyebrow { font-size: 9px; }
.drawer-head h2 { font-size: 20px; }
.drawer-head .icon-button { width: 34px; height: 34px; font-size: 20px; }

.cart-lines { padding: 7px 12px; }
.cart-line {
  grid-template-columns: 44px minmax(0, 1fr) 32px;
  gap: 7px;
  padding: 7px 0;
}
.cart-line > img { width: 44px; height: 44px; border-radius: 8px; }
.cart-line span > b {
  display: -webkit-box;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.cart-line span > small {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cart-line > .icon-button { width: 30px; height: 30px; font-size: 18px; }
.cart-qty { gap: 5px; margin-top: 3px; font-size: 12px; }
.cart-qty button { width: 24px; height: 24px; border-radius: 7px; }

.payment-accounts,
.required-proof {
  gap: 5px;
  margin: 7px 10px;
  padding: 9px;
  border-radius: 11px;
}
.payment-accounts h3 { font-size: 14px; }
.payment-instruction { color: #475569; font-size: 10.5px; line-height: 1.3; }
.payment-accounts article.payment-account-card { display: block; padding: 7px 8px; }
.payment-account-card dl { display: grid; gap: 3px; margin: 0; }
.payment-account-card dl > div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 6px;
  align-items: baseline;
}
.payment-account-card dt { color: #64748b; font-size: 10.5px; font-weight: 700; }
.payment-account-card dt::after { content: " -"; }
.payment-account-card dd {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 900;
  overflow-wrap: anywhere;
}
.payment-account-card .account-number { color: var(--teal); }

.delivery-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 7px 10px;
}
.delivery-options legend { padding: 0 2px; font-size: 11px; }
.delivery-options label { gap: 6px; margin-top: 0; padding: 7px 8px; font-size: 11px; }
.delivery-options label small { font-size: 8.5px; line-height: 1.2; }

.note-field { gap: 4px; padding: 0 10px 6px; font-size: 11px; }
.note-field textarea { min-height: 44px; padding: 7px 9px; font-size: 11px; }
.required-proof > span { font-size: 11px; }
.required-proof input { padding: 7px; font-size: 10px; }
.required-proof small { font-size: 9px; line-height: 1.25; }

.cart-footer { padding: 8px 12px calc(7px + env(safe-area-inset-bottom)); }
.cart-footer > div { margin-bottom: 5px; font-size: 12px; }
.cart-footer strong { font-size: 17px; }
.cart-footer .primary-button { padding: 10px 14px; font-size: 13px; }
.cart-footer .form-status { min-height: 0; margin: 4px 0 0; font-size: 10px; }

@media (max-width: 640px) {
  .drawer { width: 100vw; max-width: none; }
  .drawer-head { padding: 10px 12px; }
  .drawer-head h2 { font-size: 18px; }
  .cart-lines { padding: 6px 9px; }
  .cart-line { grid-template-columns: 40px minmax(0, 1fr) 28px; padding: 6px 0; }
  .cart-line > img { width: 40px; height: 40px; }
  .cart-line > .icon-button { width: 28px; height: 28px; }
  .payment-accounts,
  .required-proof { margin: 6px 8px; padding: 8px; }
  .delivery-options { padding: 6px 8px; }
  .delivery-options label { padding: 6px; }
  .note-field { padding: 0 8px 5px; }
  .note-field textarea { min-height: 40px; }
  .cart-footer { padding: 7px 10px calc(6px + env(safe-area-inset-bottom)); }
}
