/* Tiệm Hoa Zoey Menu — Live Customer Chat Bubble & Drawer (Desktop + Mobile) */

.zoey-menu-chat-dock-btn {
  position: relative;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border-radius: 999px;
  border: 2.5px solid #fff;
  background: linear-gradient(135deg, var(--primary, #f97316), color-mix(in srgb, var(--primary, #f97316) 78%, #ea580c));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--primary, #f97316) 34%, rgba(15, 23, 42, 0.22));
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  padding: 0;
  z-index: 3;
}

.zoey-menu-chat-dock-btn:hover {
  transform: translateX(-4px) scale(1.06);
  box-shadow: 0 14px 30px color-mix(in srgb, var(--primary, #f97316) 42%, rgba(15, 23, 42, 0.26));
}

.zoey-chat-robot-svg {
  width: 32px;
  height: 32px;
  display: block;
  flex-shrink: 0;
}

.zoey-menu-chat-dock-btn .zoey-chat-tooltip {
  position: absolute;
  right: 58px;
  top: 50%;
  transform: translate(6px, -50%);
  background: #111827;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 9px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

.zoey-menu-chat-dock-btn:hover .zoey-chat-tooltip {
  opacity: 1;
  transform: translate(0, -50%);
}

.zoey-menu-chat-unread {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  border: 2px solid #fff;
  font-size: 9px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#zoey-menu-chat-mobile-btn {
  display: none;
}

@media (max-width: 767px) {
  #zoey-menu-chat-mobile-btn {
    position: fixed;
    right: 14px;
    bottom: calc(146px + env(safe-area-inset-bottom, 0px));
    z-index: 59;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    border: 2px solid #fff;
    background: linear-gradient(135deg, var(--primary, #f97316), color-mix(in srgb, var(--primary, #f97316) 78%, #ea580c));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 24px color-mix(in srgb, var(--primary, #f97316) 32%, rgba(15, 23, 42, 0.2));
    transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
  }

  #zoey-menu-chat-mobile-btn .zoey-chat-robot-svg {
    width: 30px;
    height: 30px;
  }

  #zoey-menu-chat-mobile-btn:active {
    transform: scale(0.92);
  }

  body:has(#zoey-mobile-contact-bubble.is-open) #zoey-menu-chat-mobile-btn,
  body.zoey-mcf-open #zoey-menu-chat-mobile-btn {
    transform: translateY(-153px);
  }

  @media (max-width: 380px) {
    #zoey-menu-chat-mobile-btn {
      right: 11px;
      bottom: calc(144px + env(safe-area-inset-bottom, 0px));
      width: 44px;
      height: 44px;
    }
  }
}

body:has(#cart-modal:not(.hidden)) #zoey-menu-chat-mobile-btn,
body:has(#product-detail-modal:not(.hidden)) #zoey-menu-chat-mobile-btn,
body:has(#order-lookup-modal:not(.hidden)) #zoey-menu-chat-mobile-btn,
body:has(#zoey-menu-chat-panel:not(.hidden)) #zoey-menu-chat-mobile-btn,
body:has(#zoey-menu-chat-panel:not(.hidden)) #zoey-mobile-contact-bubble {
  opacity: 0 !important;
  pointer-events: none !important;
}

#zoey-menu-chat-panel {
  position: fixed;
  right: 18px;
  bottom: 20px;
  width: min(390px, calc(100vw - 24px));
  height: min(580px, calc(100dvh - 38px));
  z-index: 80;
  background: #fff;
  border-radius: 24px;
  border: 1.5px solid var(--border, #e9e3d9);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity 0.16s ease;
}

#zoey-menu-chat-panel.hidden {
  display: none !important;
}

/* Khi khách mở popup xem sản phẩm, giỏ hàng hoặc tra cứu đơn: chat tạm lùi xuống dưới để xem sản phẩm thoải mái, đóng popup là hiện lại ngay không bị tắt mất */
body:has(#product-detail-modal:not(.hidden)) #zoey-menu-chat-panel,
body:has(#cart-modal:not(.hidden)) #zoey-menu-chat-panel,
body:has(#order-lookup-modal:not(.hidden)) #zoey-menu-chat-panel,
body:has(#product-image-zoom:not(.hidden)) #zoey-menu-chat-panel,
body:has(#promo-popup-modal:not(.hidden)) #zoey-menu-chat-panel {
  z-index: 40;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 767px) {
  #zoey-menu-chat-panel {
    right: 10px;
    left: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    width: auto;
    height: min(78dvh, 570px);
    border-radius: 22px;
  }
}

.zoey-mchat-hdr {
  padding: 12px 15px;
  background: var(--primary, #f97316);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.zoey-mchat-hdr-logo-wrap {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid rgba(255, 255, 255, 0.85);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.zoey-mchat-hdr-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.zoey-mchat-staff-banner {
  padding: 7px 12px;
  background: #ecfdf5;
  border-bottom: 1px solid #a7f3d0;
  color: #065f46;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.zoey-mchat-staff-banner.hidden {
  display: none !important;
}

.zoey-mchat-staff-banner.is-waiting-accept {
  background: #fff7ed;
  border-bottom-color: #fed7aa;
  color: #9a3412;
}

/* Nhân viên đang mở xem cuộc trò chuyện (AI vẫn trả lời) */
.zoey-mchat-staff-banner.is-viewing {
  background: #eff8ff;
  border-bottom-color: #bae6fd;
  color: #075985;
}
.zoey-mchat-staff-banner .zoey-mchat-eye {
  flex: 0 0 auto;
  margin-right: 6px;
}

.zoey-mchat-profile-bar {
  padding: 6px 13px;
  background: #fffbf5;
  border-bottom: 1px solid var(--border, #e9e3d9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  flex-shrink: 0;
}

.zoey-mchat-profile-bar.hidden {
  display: none !important;
}

#zoey-mchat-profile-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#zoey-mchat-profile-label i {
  color: var(--primary, #ff8c00);
  flex-shrink: 0;
}

.zoey-mchat-edit-profile-btn {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border, #e9e3d9);
  background: #fff;
  color: var(--primary, #ea580c);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
}

.zoey-mchat-edit-profile-btn:hover {
  background: #fff7ed;
  border-color: var(--primary, #ff8c00);
}

.zoey-mchat-pregate {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  background: var(--bg, #faf8f5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.zoey-mchat-pregate.hidden {
  display: none !important;
}

.zoey-mchat-pregate-card {
  width: 100%;
  background: #fff;
  border: 1.5px solid var(--border, #e9e3d9);
  border-radius: 20px;
  padding: 18px 16px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.zoey-mchat-pregate-badge {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #c2410c;
  font-size: 10.5px;
  font-weight: 900;
}

.zoey-mchat-pregate-title {
  font-size: 14px;
  line-height: 1.4;
  font-weight: 900;
  color: var(--text, #1e293b);
}

.zoey-mchat-pregate-sub {
  font-size: 11px;
  line-height: 1.45;
  font-weight: 600;
  color: #64748b;
  margin-top: -4px;
}

.zoey-mchat-pregate-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.zoey-mchat-pregate-field label {
  font-size: 11px;
  font-weight: 800;
  color: #334155;
}

.zoey-mchat-pregate-field input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border-radius: 12px;
  border: 1.5px solid var(--border, #cbd5e1);
  background: #faf8f5;
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #1e293b);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.zoey-mchat-pregate-field input:focus {
  border-color: var(--primary, #ff8c00);
  background: #fff;
}

@media (max-width: 767px) {
  .zoey-mchat-pregate-field input {
    font-size: 16px !important;
  }
}

.zoey-mchat-pregate-err {
  padding: 8px 11px;
  border-radius: 10px;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #be123c;
  font-size: 11px;
  font-weight: 800;
}

.zoey-mchat-pregate-err.hidden {
  display: none !important;
}

.zoey-mchat-pregate-btn {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 0;
  background: var(--primary, #ff8c00);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--primary, #ff8c00) 28%, transparent);
}

.zoey-mchat-pregate-btn:hover {
  filter: brightness(0.96);
}

.zoey-mchat-pregate-cancel {
  width: 100%;
  min-height: 36px;
  border-radius: 12px;
  border: 1px solid var(--border, #e2e8f0);
  background: #fff;
  color: #475569;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}

.zoey-mchat-pregate-cancel.hidden {
  display: none !important;
}

.zoey-mchat-pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  margin-right: 6px;
  animation: zoeyMchatPulse 1.3s ease-in-out infinite;
}

@keyframes zoeyMchatPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}

.zoey-mchat-feed {
  flex: 1;
  overflow-y: auto;
  padding: 13px;
  background: var(--bg, #faf8f5);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.zoey-mchat-feed.hidden,
.zoey-mchat-quick.hidden,
.zoey-mchat-form.hidden {
  display: none !important;
}

.zoey-mchat-msg {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 12.5px;
  line-height: 1.5;
  font-weight: 600;
  word-break: break-word;
}

.zoey-mchat-sender {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9.5px;
  font-weight: 900;
  opacity: 0.78;
  margin-bottom: 4px;
}

.zoey-mchat-mini-logo {
  width: 15px;
  height: 15px;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
}

.zoey-mchat-msg.is-user {
  align-self: flex-end;
  background: var(--primary, #f97316);
  color: #fff;
  border-bottom-right-radius: 5px;
}

.zoey-mchat-msg.is-shop {
  align-self: flex-start;
  background: #fff;
  color: var(--text, #202921);
  border: 1px solid var(--border, #e9e3d9);
  border-bottom-left-radius: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.zoey-mchat-msg.is-staff {
  align-self: flex-start;
  background: #f0fdf4;
  color: #064e3b;
  border: 1px solid #86efac;
  border-bottom-left-radius: 5px;
  box-shadow: 0 2px 8px rgba(6, 95, 70, 0.06);
}

.zoey-mchat-msg.is-system {
  align-self: center;
  max-width: 96%;
  padding: 8px 12px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px dashed #6ee7b7;
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
}

.zoey-mchat-msg.is-waiting {
  align-self: flex-start;
  background: #fffbeb;
  color: #78350f;
  border: 1px solid #fcd34d;
  border-bottom-left-radius: 5px;
}

.zoey-mchat-msg.is-waiting-staff {
  align-self: flex-start;
  background: #fff7ed;
  color: #9a3412;
  border: 1.5px solid #fdba74;
  border-bottom-left-radius: 5px;
  box-shadow: 0 3px 10px rgba(234, 88, 12, 0.08);
}

.zoey-mchat-dots {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  margin-left: 3px;
  font-weight: 900;
}

.zoey-mchat-dots span {
  display: inline-block;
  font-size: 15px;
  line-height: 1;
  animation: zoeyDotsBounce 1.15s infinite ease-in-out;
}

.zoey-mchat-dots span:nth-child(2) {
  animation-delay: 0.18s;
}

.zoey-mchat-dots span:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes zoeyDotsBounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.45;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .zoey-mchat-dots span {
    animation: none;
    opacity: 1;
  }
}

.zoey-mchat-wait-note {
  margin-top: 6px;
  font-size: 10.5px;
  font-weight: 800;
  color: #92400e;
  display: flex;
  align-items: center;
}

.zoey-mchat-wait-note.is-staff-wait {
  color: #c2410c;
}

.zoey-mchat-prod-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
  padding: 7px 9px;
  border-radius: 12px;
  background: var(--light, #f4efe6);
  border: 1px solid var(--border, #e9e3d9);
}

.zoey-mchat-prod-btns {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.zoey-mchat-prod-view {
  padding: 5px 9px;
  border-radius: 999px;
  background: #fff;
  color: var(--primary, #ea580c);
  border: 1px solid var(--border, #e2e8f0);
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.zoey-mchat-prod-add {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--primary, #f97316);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}

.zoey-mchat-quick {
  padding: 8px 10px 6px;
  background: #fff;
  border-top: 1px solid var(--border, #e9e3d9);
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

.zoey-mchat-quick::-webkit-scrollbar {
  display: none;
}

.zoey-mchat-chip {
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--light, #f4efe6);
  color: var(--primary, #1c2c21);
  border: 1px solid var(--border, #e9e3d9);
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.zoey-mchat-chip:hover {
  background: #ffedd5;
  border-color: var(--primary, #f97316);
}

.zoey-mchat-chip.is-staff-chip {
  background: #ecfdf5;
  color: #065f46;
  border-color: #86efac;
}

.zoey-mchat-chip.is-staff-chip:hover {
  background: #d1fae5;
  border-color: #10b981;
}

.zoey-mchat-form {
  padding: 8px 12px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 1px solid rgba(233, 227, 217, 0.65);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.zoey-mchat-input-shell {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1.5px solid var(--border, #e9e3d9);
  background: var(--bg, #faf8f5);
  display: flex;
  align-items: center;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.zoey-mchat-input-shell:focus-within {
  border-color: var(--primary, #f97316);
}

#zoey-mchat-input {
  width: 100%;
  min-width: 0;
  border: 0 !important;
  background: transparent !important;
  outline: none !important;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text, #202921);
  line-height: 1.3;
  padding: 0 !important;
  margin: 0 !important;
}

#zoey-mchat-input::placeholder {
  font-weight: 500;
  color: #94a3b8;
  opacity: 1;
}

@media (max-width: 767px) {
  /* Giữ computed font-size 16px để Safari iOS không zoom khi gõ, nhưng thu tỷ lệ 0.78 (~12.5px) cho cân đối với khung chat */
  html body #zoey-mchat-input {
    font-size: 16px !important;
    line-height: 1.25 !important;
    width: 128.2% !important;
    flex: 0 0 128.2%;
    transform: scale(0.78);
    transform-origin: left center;
  }
}

.zoey-mchat-tel-link {
  color: var(--primary, #ea580c);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.zoey-mchat-msg.is-user .zoey-mchat-tel-link {
  color: #fff;
}

.zoey-mchat-store-card {
  margin-top: 8px;
  padding: 9px 10px;
  border-radius: 13px;
  background: var(--light, #faf5ee);
  border: 1px solid var(--border, #e9e3d9);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.zoey-mchat-store-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text, #1f2937);
}

.zoey-mchat-store-row-ico {
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  color: var(--primary, #f97316);
  margin-top: 2px;
}

.zoey-mchat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 3px;
}

.zoey-mchat-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  line-height: 1.2;
  transition: transform 0.14s ease, filter 0.14s ease;
}

.zoey-mchat-action-btn:hover {
  transform: translateY(-1px);
  filter: brightness(0.96);
}

.zoey-mchat-action-btn.is-map {
  background: var(--primary, #f97316);
  color: #fff;
}

.zoey-mchat-action-btn.is-call {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #86efac;
}

.zoey-mchat-action-btn.is-zalo {
  background: #eff6ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

/* === UX fixes 2026-11-20 === */
/* Badge số tin chưa đọc: .zoey-menu-chat-unread{display:inline-flex} đè mất lớp .hidden, nên luôn hiện "0" */
.zoey-menu-chat-unread.hidden { display: none !important; }

/* Toast cảnh báo (vd kho chưa đủ nguyên hộp) có biểu tượng riêng */
#cart-toast.is-warn i { color: #fbbf24 !important; }

/* Ảnh chính sách: gợi ý chạm để phóng to */
.zoey-policy-img-card { position: relative; }
.zoey-policy-img-card::after {
  content: "\f00e  Chạm để phóng to";
  font-family: "Font Awesome 6 Free", "Quicksand", sans-serif;
  font-weight: 900;
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .72);
  color: #fff;
  font-size: 10px;
  letter-spacing: .01em;
  pointer-events: none;
}

@media (max-width: 767px) {
  /* Thanh lọc đã thu gọn: khung giữ chỗ trong suốt + bấm xuyên, chỉ thanh gọn có nền trắng */
  html.zoey-filter-motion #mobile-filter-anchor.zf-settled-compact {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    pointer-events: none !important;
  }
  html.zoey-filter-motion #mobile-filter-anchor.zf-settled-compact .mobile-filter-compact {
    background: #fff !important;
    border: 1px solid var(--border) !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .10) !important;
  }

  /* Chừa chỗ cuối trang để nút nổi + thanh giỏ không che nút bản đồ / liên hệ ở footer */
  #zoey-footer { padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px)) !important; }
}

@media (max-width: 420px) {
  /* Header điện thoại: tên tiệm không bị cắt "TIỆM HOA ZO...", nút Chính sách không xuống 2 dòng */
  header #store-logo { width: 38px !important; height: 38px !important; }
  header #store-name { font-size: 13px !important; letter-spacing: .01em !important; }
  header #store-name + #store-subtitle { font-size: 8.5px !important; }
  header .flex.items-center.justify-between.gap-3 { gap: 8px !important; }
  header .flex.items-center.justify-between > .flex.items-center.gap-2 { gap: 5px !important; flex-shrink: 0; }
  header #zoey-open-policy-btn,
  header [data-z-click="openOrderLookup"] {
    white-space: nowrap !important;
    padding-left: 9px !important;
    padding-right: 9px !important;
  }
}

/* === Filter morph 2026-11-20 === */
/* Bảng lọc lớn: nền giữ đặc, chỉ nội dung mờ dần khi cuộn (biến do JS đặt). */
html.zoey-filter-motion #mobile-filter-anchor .mobile-filter-expanded > * {
  opacity: var(--zf-content-opacity, 1);
  transition: none;
}

/* === Giỏ hàng trên iPhone 2026-11-20 ===
   Khung giỏ chỉ có max-height + height:auto, vùng cuộn flex:1 1 0%. Chrome Android giãn theo nội dung nên giỏ to,
   còn Safari iOS tính vùng cuộn gần như 0 nên giỏ nhỏ, cộng thêm khoảng an toàn 34px dưới nút Gửi đơn trông như bị nhô lên.
   Cách sửa: cho khung giỏ một chiều cao cố định (bằng đúng cỡ đang thấy trên Android) và bớt khoảng trống dưới nút. */
@media (max-width: 767px) {
  html body #cart-modal.cart-shell .cart-panel {
    height: 80vh !important;
    height: min(80vh, calc(100dvh - 68px)) !important;
    max-height: min(80vh, calc(100dvh - 68px)) !important;
  }
  @supports (height: 100svh) {
    html body #cart-modal.cart-shell .cart-panel {
      /* svh = vùng nhìn thấy khi thanh địa chỉ Safari đang hiện, nên đáy giỏ luôn nằm trên thanh công cụ */
      height: min(86svh, calc(100svh - 64px)) !important;
      max-height: min(86svh, calc(100svh - 64px)) !important;
    }
  }
  html body #cart-modal.cart-shell .cart-panel > div.overflow-y-auto {
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }
  html body #cart-modal.cart-shell .cart-panel > div:last-child.safe-bottom {
    padding-top: 12px !important;
    padding-bottom: max(10px, calc(env(safe-area-inset-bottom, 0px) - 12px)) !important;
  }
}

/* === iPhone bottom stack 2026-11-20 === */
/* Thanh giỏ đang cách đáy 10px + 34px vùng an toàn của iPhone, nên trông bị nhô cao và chừa một dải trống vô ích.
   Chỉ giữ phần vùng an toàn vượt quá 24px (thanh home của iPhone chỉ cao ~13px), Android không đổi (inset = 0).
   Nút chat, nút liên hệ và thông báo nhỏ hạ xuống theo để giữ nguyên khoảng cách với thanh giỏ. */
@media (max-width: 767px) {
  :root { --zf-safe-b: max(0px, calc(env(safe-area-inset-bottom, 0px) - 24px)); }
  html body #floating-cart { bottom: calc(10px + var(--zf-safe-b)) !important; }
  html body #zoey-mobile-contact-bubble { bottom: calc(88px + var(--zf-safe-b)) !important; }
  html body #zoey-menu-chat-mobile-btn { bottom: calc(146px + var(--zf-safe-b)) !important; }
  html body #cart-toast { bottom: calc(82px + var(--zf-safe-b)) !important; }
}
@media (max-width: 380px) {
  html body #zoey-menu-chat-mobile-btn { bottom: calc(144px + var(--zf-safe-b)) !important; }
}

/* === Price line 1 dòng 2026-11-20 === */
/* Giá 2 cột giữ 1 dòng (JS nén nhẹ khi cần). Chỉ khi quá dài JS mới gắn .zf-price-wrap để đơn vị xuống dòng. */
html body #products-grid .zoey-card-sap-col .zoey-card-price-line {
  flex-wrap: nowrap !important;
}
html body #products-grid .zoey-card-sap-col .zoey-card-price-line.zf-price-wrap {
  flex-wrap: wrap !important;
  row-gap: 2px !important;
  transform: none !important;
}

/* === PC price frame + hero copy 2026-11-20 === */
/* Máy tính: khung "đang chọn" của ô giá 2 cột (Bán lẻ | Bán nguyên hộp) được vẽ nở ra ngoài ô ~5px (bằng bóng viền),
   nên trông rộng rãi, không ôm sát chữ, mà KHÔNG lấy bớt chỗ của giá (đệm trong giữ nguyên, giá không bị đẩy xuống dòng).
   Chừa thêm khoảng trên/dưới để khung không chạm tên sản phẩm và nút bấm. */
@media (min-width: 768px) {
  html body #products-grid .zoey-card-sap-prices.has-mode-choice {
    margin-top: 6px !important;
    margin-bottom: 6px !important;
    overflow: visible !important;
  }
  html body #products-grid .zoey-card-sap-prices.has-mode-choice .zoey-card-sap-col {
    border-radius: 9px !important;
  }
  html body #products-grid .zoey-card-sap-prices.has-mode-choice .zoey-card-sap-col.is-mode-active {
    box-shadow:
      0 0 0 5px color-mix(in srgb, var(--primary) 9%, #fff),
      0 0 0 6.6px color-mix(in srgb, var(--primary) 58%, transparent) !important;
  }
  html body #products-grid .zoey-card-sap-prices.has-mode-choice .zoey-card-sap-col:not(.is-mode-active):hover {
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--primary) 5%, #fff) !important;
  }
  html body #products-grid .zoey-card-sap-col .zoey-card-price-label {
    font-size: 11px !important;
  }
}
/* Màn rộng (thẻ ~300px như màn 1845px của tiệm) còn dư chỗ: chữ nhãn và giá to thêm một chút. */
@media (min-width: 1780px) {
  html body #products-grid .zoey-card-sap-col .zoey-card-price-label {
    font-size: 11.5px !important;
    margin-bottom: 5px !important;
  }
  html body #products-grid .zoey-card-sap-col .zoey-card-price-main {
    font-size: 17.5px !important;
  }
  html body #products-grid .zoey-card-sap-col .zoey-card-price-unit {
    font-size: 10.5px !important;
  }
}
/* Điện thoại: dòng giới thiệu trong băng cam đang chỉ 9.5–10px, khó đọc. */
@media (max-width: 767px) {
  html body .hero-section .hero-copy {
    font-size: 11.5px !important;
    line-height: 1.45 !important;
  }
}
