@media (max-width: 600px) {
  .product-detail-modal {
    align-items: flex-end !important;
    padding: 0 !important;
    z-index: 2147483646 !important;
  }

  .product-detail-dialog {
    display: flex !important;
    flex-direction: column;
    width: 100% !important;
    max-width: 100% !important;
    max-height: min(92dvh, 720px) !important;
    overflow: hidden !important;
    border-radius: 17px 17px 0 0 !important;
  }

  .product-detail-head {
    flex: 0 0 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 12px !important;
  }

  .product-detail-head h3 {
    max-width: calc(100% - 44px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px !important;
  }

  .product-detail-close {
    width: 32px !important;
    height: 32px !important;
  }

  .product-detail-body {
    display: grid !important;
    flex: 1 1 auto;
    min-height: 0;
    gap: 6px !important;
    padding: 9px 10px 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .product-detail-preview {
    grid-template-columns: 52px minmax(0, 1fr) !important;
    gap: 8px !important;
    min-height: 48px;
  }

  .product-detail-preview > .product-placeholder,
  .product-detail-preview img {
    width: 52px !important;
    height: 48px !important;
    border-radius: 9px !important;
  }

  .product-detail-preview h4 {
    margin: 0 0 2px !important;
    font-size: 14px !important;
    line-height: 1.15;
  }

  .product-detail-preview p { font-size: 13px !important; }
  .qr-material-field { gap: 3px !important; }
  .qr-material-field > label,
  .product-detail-body > label { gap: 4px !important; font-size: 10px !important; }

  .qr-material-field > b {
    min-height: 30px !important;
    padding: 6px 8px !important;
    font-size: 10px !important;
    line-height: 1.2 !important;
  }

  .product-meta-grid.qr-product-meta {
    grid-template-columns: 1fr 1fr !important;
    gap: 5px !important;
  }

  .product-meta-grid.qr-product-meta > div {
    min-height: 37px !important;
    padding: 4px 6px !important;
  }

  .product-meta-grid.qr-product-meta > div:first-child,
  .product-meta-grid.qr-product-meta > div:nth-child(2) {
    grid-template-columns: 24px minmax(0, 1fr) !important;
    gap: 5px !important;
  }

  .product-meta-grid.qr-product-meta > div:first-child::before,
  .product-meta-grid.qr-product-meta > div:nth-child(2)::before {
    width: 24px !important;
    height: 24px !important;
    font-size: 10px !important;
  }

  .product-meta-grid.qr-product-meta span { font-size: 7px !important; }
  .product-meta-grid.qr-product-meta b { font-size: 9px !important; }

  .portal-quick-notes {
    gap: 5px !important;
    min-height: 27px;
    max-height: 27px !important;
  }

  .portal-quick-note {
    height: 27px !important;
    padding: 0 7px !important;
    font-size: 9px !important;
  }

  .product-detail-body textarea {
    height: 42px !important;
    min-height: 42px !important;
    padding: 7px 8px !important;
    font-size: 10px !important;
  }

  .qr-product-quantity .modal-qty-controls {
    grid-template-columns: 38px minmax(0, 1fr) 38px !important;
    gap: 5px !important;
  }

  .qr-product-quantity .modal-qty-controls button,
  .qr-product-quantity .modal-qty-controls input {
    height: 34px !important;
    min-height: 34px !important;
  }

  .qr-product-quantity .modal-qty-controls button { font-size: 18px !important; }
  .qr-product-quantity .modal-qty-controls input { font-size: 15px !important; }
  .qr-product-quantity .modal-qty-controls input[readonly] { cursor: default; caret-color: transparent; user-select: none; }

  .product-detail-actions {
    position: relative !important;
    z-index: 3;
    flex: 0 0 auto;
    width: 100%;
    margin: 0 !important;
    padding: 7px 10px calc(7px + env(safe-area-inset-bottom)) !important;
    background: #fff !important;
    box-shadow: 0 -7px 16px rgba(15, 35, 51, .08);
  }

  .product-detail-actions button {
    height: 39px !important;
    font-size: 12px !important;
  }
}

@media (max-width: 600px) {
  body.product-modal-open {
    overflow: hidden !important;
    padding-bottom: 0 !important;
  }

  body.product-modal-open .mobile-bottom-nav {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }
}

@media (max-width: 600px) and (max-height: 620px) {
  .product-detail-dialog { max-height: 96dvh !important; }
  .product-detail-preview { display: none !important; }
  .product-detail-body textarea { height: 36px !important; min-height: 36px !important; }
}
