/* === zoey-v27-cart-map-css === */
/* 5.1 Khoi dia chi: ba o hanh chinh xep ngang khi du cho */
html body #zf-delivery-suite{
  border-radius: 18px !important;
  padding: 12px !important;
  gap: 9px !important;
  box-shadow: 0 2px 10px rgba(28, 44, 33, .05) !important;
}
html body #zf-delivery-suite .zf-addr-grid{
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 8px !important;
}
/* Tren man hinh rong: o Tinh/Thanh nam rieng mot hang (ten dai nhat),
   hai o con lai dung canh nhau cho do ton chieu cao. */
@media (min-width: 1024px){
  html body #zf-delivery-suite .zf-addr-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  html body #zf-delivery-suite .zf-addr-grid > .zf-addr-field:first-child{
    grid-column: 1 / -1 !important;
  }
}
/* Ten tinh/quan rat dai — cho chay mot dong roi cat bang dau ba cham,
   khong de xuong hai dong rui bi khung o cat mat. */
html body #zf-delivery-suite .zf-addr-select{
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
  overflow: hidden !important;
}
html body #zf-delivery-suite .zf-addr-field label{
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: .02em !important;
  text-transform: uppercase !important;
  margin-bottom: 4px !important;
}
html body #zf-delivery-suite .zf-addr-preview{ border-radius: 13px !important; }

/* 5.2 Khung ban do */
html body #zf-map-box{
  border-radius: 18px !important;
  border: 1px solid var(--border) !important;
  overflow: hidden !important;
  background: #0f172a;
  position: relative;
}
html body #zf-map-box .zf-map-stage{
  height: 240px !important;
  transition: height .3s cubic-bezier(.32, .72, 0, 1);
}
@media (min-width: 768px){
  html body #zf-map-box .zf-map-stage{ height: 310px !important; }
}
/* Che do xem lon: de ghim trung noc nha tren dien thoai */
html body #zf-map-box.zf-lon .zf-map-stage{ height: 58vh !important; height: 58dvh !important; }
@media (min-width: 768px){
  html body #zf-map-box.zf-lon .zf-map-stage{ height: 66vh !important; height: 66dvh !important; }
}
html body #zf-single-map-canvas{ width: 100% !important; height: 100% !important; }

/* 5.3 Thanh chip noi tren ban do (kinh mo) */
html body #zf-map-box .zf-map-smart-bar{
  position: absolute !important;
  top: 8px; left: 8px; right: 8px;
  z-index: 520;
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: none !important;
  border: 0 !important;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
html body #zf-map-box .zf-map-smart-bar::-webkit-scrollbar{ display: none; }
html body #zf-map-box .zf-smart-btn,
html body #zf-map-box .zf-map-open-float{
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 11px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255, 255, 255, .7) !important;
  background: rgba(255, 255, 255, .92) !important;
  -webkit-backdrop-filter: blur(10px) saturate(1.25);
  backdrop-filter: blur(10px) saturate(1.25);
  color: var(--primary) !important;
  font-size: 11.5px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  text-decoration: none !important;
  box-shadow: 0 3px 12px rgba(15, 23, 42, .18) !important;
  cursor: pointer;
  transition: transform .16s cubic-bezier(.34, 1.5, .64, 1), background-color .18s ease, color .18s ease;
}
html body #zf-map-box .zf-smart-btn i{ font-size: 12px !important; }
html body #zf-map-box .zf-smart-btn:active{ transform: scale(.93) !important; }
html body #zf-map-box .zf-smart-btn.primary{
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}
html body #zf-map-box .zf-smart-btn.zf-chi-hinh{ width: 34px !important; padding: 0 !important; }
/* Nut "Mo Google Maps" ve dung hang voi cac chip khac */
html body #zf-map-box .zf-map-open-float{
  position: static !important;
  right: auto !important; top: auto !important;
  font-size: 11px !important;
  margin-left: auto !important;
}

/* 5.4 Vien phong to / thu nho rieng, thay cho nut mac dinh cua Leaflet */
html body #zf-map-box .leaflet-control-zoom,
html body #zf-map-box .leaflet-control-attribution{ display: none !important; }
html body #zf-map-box .zf-map-zoom{
  position: absolute;
  right: 10px; bottom: 12px;
  z-index: 520;
  display: flex;
  flex-direction: column;
  border-radius: 13px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .7);
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px rgba(15, 23, 42, .2);
}
html body #zf-map-box .zf-map-zoom button{
  width: 36px; height: 34px;
  border: 0; background: none; cursor: pointer;
  color: var(--primary);
  font-size: 16px; font-weight: 900; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background-color .16s ease;
}
html body #zf-map-box .zf-map-zoom button + button{ border-top: 1px solid var(--border); }
html body #zf-map-box .zf-map-zoom button:active{ background: var(--light); }

/* 5.5 Ghim do giua khung + vong ngam */
html body #zf-map-box .zf-pin-center-reticle{
  font-size: 34px !important;
  z-index: 510 !important;
  transition: transform .18s cubic-bezier(.34, 1.5, .64, 1) !important;
}
html body #zf-map-box .zf-map-stage::after{
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 12px; height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .9);
  background: rgba(225, 29, 72, .9);
  box-shadow: 0 0 0 4px rgba(225, 29, 72, .18);
  z-index: 505;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
}
html body #zf-map-box .zf-map-stage.dragging::after{ opacity: 1; }
html body #zf-map-box .zf-map-stage.dragging .zf-pin-center-reticle{
  transform: translate(-50%, -124%) scale(1.1) !important;
}

/* 5.6 Loi nhac giua ban do, tu mo di sau vai giay */
html body #zf-map-box .zf-map-coach{
  position: absolute;
  left: 50%; bottom: 14px;
  transform: translateX(-50%);
  z-index: 515;
  max-width: calc(100% - 92px);
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .82);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1.3;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  opacity: 1;
  transition: opacity .35s ease, transform .35s ease;
}
html body #zf-map-box .zf-map-coach.zf-an{
  opacity: 0;
  transform: translateX(-50%) translateY(6px);
}

/* 5.7 Dong ket qua duoi ban do */
html body #zf-map-box .zf-map-status{
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
  padding: 10px 12px !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  background: #fff !important;
  border-top: 1px solid var(--border) !important;
  color: #475569 !important;
}
html body #zf-map-box .zf-map-status b{
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  color: var(--primary) !important;
}
html body #zf-map-box .zf-map-status.pinned{
  background: #ecfdf5 !important;
  color: #047857 !important;
  border-top-color: #a7f3d0 !important;
}
html body #zf-map-box .zf-map-status.pinned b{ color: #065f46 !important; }
html body #zf-map-box .zf-map-toa-do{
  margin-left: auto !important;
  padding: 3px 9px !important;
  border-radius: 999px !important;
  background: rgba(28, 44, 33, .07) !important;
  font-size: 10.5px !important;
  font-weight: 800 !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em !important;
  white-space: nowrap !important;
}
html body #zf-map-box .zf-map-status.pinned .zf-map-toa-do{
  background: rgba(6, 95, 70, .12) !important;
  color: #065f46 !important;
}

@media (prefers-reduced-motion: reduce){
  html body #zf-map-box .zf-map-stage,
  html body #zf-map-box .zf-map-coach,
  html body #zf-map-box .zf-pin-center-reticle{ transition: none !important; }
}

/* Dien thoai: chi giu chu cho hai nut hay dung nhat, con lai thu ve hinh tron
   de ca nam chip deu nam gon trong mot hang, khong phai cuon ngang moi thay. */
@media (max-width: 639px){
  html body #zf-map-box #zf-map-recenter span,
  html body #zf-map-box .zf-map-open-float{ font-size: 0 !important; }
  html body #zf-map-box #zf-map-recenter{ width: 34px !important; padding: 0 !important; gap: 0 !important; }
  html body #zf-map-box .zf-map-open-float{
    width: 34px !important; padding: 0 !important; gap: 0 !important;
  }
  html body #zf-map-box .zf-map-open-float i{ font-size: 12px !important; }
  html body #zf-map-box .zf-map-smart-bar{ gap: 5px !important; }
}
@media (max-width: 420px){
  html body #zf-map-box .zf-map-toa-do{ margin-left: 0 !important; }
}

/* === zoey-v9-popup-layout === */
/* Khóa cuộn ở gốc trang để logo và bộ tìm kiếm vẫn bám đúng vị trí. */
html { scrollbar-gutter: stable; }
html.zf-modal-locked body { overflow: visible !important; }

/* Ảnh giữ trọn cột trái, nội dung cuộn độc lập với nút thêm giỏ. */
html body #product-detail-modal .product-detail-panel {
  --detail-side-padding: 22px;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "photo info" "photo buy";
  width: min(920px, 100%) !important;
  height: min(556px, calc(100vh - 36px)) !important;
  height: min(556px, calc(100dvh - 36px)) !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden !important;
  border-radius: 28px !important;
}
html body #product-detail-modal .detail-scroll-area { display: contents !important; }
html body #product-detail-modal #zoey-detail-carousel {
  grid-area: photo;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
}
html body #product-detail-modal .detail-content-column {
  grid-area: info;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  min-height: 0 !important;
  padding: 17px var(--detail-side-padding) 12px !important;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  scrollbar-gutter: stable;
  touch-action: pan-y;
}
#product-detail-modal .detail-content-column > * { flex: 0 0 auto; }
#product-detail-modal .detail-heading { padding-right: 32px; }
html body #product-detail-modal #detail-product-code {
  font-size: 10px !important;
  margin: 0 0 3px !important;
}
html body #product-detail-modal #detail-product-name {
  font-size: 23px !important;
  line-height: 1.18 !important;
  margin: 0 !important;
  overflow-wrap: anywhere;
}
html body #product-detail-modal #detail-product-description {
  font-size: 12px !important;
  line-height: 1.4 !important;
  margin: 0 !important;
  color: #475569;
  overflow-wrap: anywhere;
}
html body #product-detail-modal #detail-product-tags {
  align-items: center;
  gap: 6px !important;
  margin: 0 !important;
}
html body #product-detail-modal #detail-product-tags > span {
  padding: 5px 8px !important;
  font-size: 11px !important;
}
html body #product-detail-modal .zoey-detail-color-row {
  display: inline-flex !important;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  margin: 0;
}
html body #product-detail-modal .zoey-detail-color-row select {
  display: block;
  height: 36px !important;
  min-width: min(110px, 100%) !important;
  max-width: 100% !important;
  padding: 0 29px 0 10px !important;
  margin: 0 !important;
  font-size: 12px !important;
  line-height: normal !important;
  text-align: center;
  text-align-last: center;
}

html body #product-detail-modal #detail-sap-mode-wrap {
  background: var(--light);
  border-radius: 14px !important;
  padding: 6px 8px !important;
  margin: 0 !important;
}
html body #product-detail-modal #detail-purchase-label {
  font-size: 10px !important;
  padding: 0 2px 4px !important;
  margin: 0 !important;
  text-align: left !important;
}
html body #product-detail-modal #detail-sap-mode-wrap .grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px !important;
  padding: 3px !important;
  border-radius: 12px !important;
  overflow: hidden;
}
html body #product-detail-modal #detail-sap-mode-wrap .sap-mode-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 37px;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  padding: 4px 6px !important;
  border-radius: 9px !important;
}
html body #product-detail-modal #detail-sap-mode-wrap .grid:not([data-zf-glider="1"]) .sap-mode-button.active {
  background: var(--primary) !important;
}
#product-detail-modal #detail-sap-mode-wrap .zf-sliding-pill { box-shadow: none; }

html body #product-detail-modal .detail-price-summary {
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  gap: 6px !important;
  margin: 0 !important;
  padding: 10px 12px !important;
}
#product-detail-modal .detail-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 10px;
}
#product-detail-modal .detail-price-inline {
  display: flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}
html body #product-detail-modal .detail-summary-label {
  font-size: 10px !important;
  margin: 0 0 2px !important;
}
html body #product-detail-modal #detail-product-price {
  font-size: clamp(20px, 2.6vw, 26px) !important;
  line-height: 1.12 !important;
}
html body #product-detail-modal #detail-product-unit {
  font-size: 12px !important;
  margin: 0 !important;
}
html body #product-detail-modal #detail-product-available {
  font-size: 11px !important;
  margin: 0 !important;
  padding: 4px 8px !important;
}
html body #product-detail-modal #detail-product-unit-note {
  font-size: 11px !important;
  line-height: 1.38 !important;
  margin: 0 !important;
  padding-top: 5px;
  border-top: 1px dashed var(--border);
}

#product-detail-modal .detail-quantity-card { padding: 8px 12px; }
html body #product-detail-modal .detail-qty-button {
  width: 35px !important;
  height: 35px !important;
}
html body #product-detail-modal #detail-product-qty {
  width: 38px !important;
  min-width: 38px !important;
  font-size: 14px !important;
}
html body #product-detail-modal .detail-quantity-title { font-size: 13px !important; }
#product-detail-modal .zf-qty-quick-bar {
  margin: 6px 0 0;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
}
#product-detail-modal .zf-qty-chip { min-height: 30px; padding: 4px 8px; }

#product-detail-modal .detail-cart-footer {
  grid-area: buy;
  min-width: 0;
  padding: 9px var(--detail-side-padding) 12px;
  border-top: 1px solid var(--border);
  background: #fff;
}
html body #product-detail-modal #detail-add-cart-btn {
  height: auto !important;
  min-height: 46px;
  padding: 8px 10px !important;
  border-radius: 13px !important;
  font-size: 13px !important;
  line-height: 1.25;
  box-shadow: none !important;
}

@media (max-width: 767px) {
  html body #product-detail-modal .product-detail-panel {
    --detail-side-padding: 14px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "scroll" "buy";
    height: min(82vh, calc(100vh - 78px)) !important;
    height: min(82dvh, calc(100dvh - 78px)) !important;
    border-radius: 24px 24px 0 0 !important;
  }
  html body #product-detail-modal .detail-scroll-area {
    display: block !important;
    grid-area: scroll;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    padding-bottom: 0 !important;
    scrollbar-width: thin;
  }
  html body #product-detail-modal #zoey-detail-carousel {
    height: clamp(136px, 27vh, 244px) !important;
    height: clamp(136px, 27dvh, 244px) !important;
  }
  html body #product-detail-modal .detail-content-column {
    padding: 12px var(--detail-side-padding) !important;
    overflow: visible;
    touch-action: auto;
  }
  #product-detail-modal .detail-heading { padding-right: 0; }
  html body #product-detail-modal #detail-product-name { font-size: 19px !important; }
  html body #product-detail-modal #detail-sap-mode-wrap .sap-mode-button { font-size: 12px; }
  #product-detail-modal .detail-cart-footer { padding-bottom: max(10px, env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
  #product-detail-modal #detail-sap-mode-wrap .zf-sliding-pill { transition: none !important; }
}
