/* Product details, seller-store browsing, and cart return actions. */
#catalog #product-grid .product-card { cursor: pointer; }
#catalog #product-grid .product-card:focus-visible { outline: 3px solid #dc8133; outline-offset: 2px; }
#catalog #product-grid .seller-tag { cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 900px) {
  #catalog #product-grid .product-bottom {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: stretch !important;
    gap: 8px !important;
    margin-top: 10px !important;
  }
  #catalog #product-grid .add-button {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    justify-content: center !important;
    align-items: center !important;
    white-space: normal !important;
    touch-action: manipulation;
  }
}
#catalog #product-grid .add-button:active,
.continue-shopping-button:active,
.product-store-link:active,
.vendor-store-item:active { transform: scale(.98); }
.continue-shopping-button {
  display: inline-flex;
  min-height: 44px;
  justify-content: center;
  align-items: center;
  padding: 10px 14px;
  border: 1px solid #1b4d3e;
  border-radius: 9px;
  background: #fff;
  color: #1b4d3e;
  font: 750 .88rem/1.2 system-ui, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
}
.product-browser-dialog {
  width: min(820px, calc(100vw - 20px));
  max-width: 820px;
  max-height: 92dvh;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e2e8de;
  border-radius: 18px;
  background: #fffdf8;
  color: #203b30;
  box-shadow: 0 22px 70px rgba(16, 43, 31, .35);
}
.product-browser-dialog::backdrop { background: rgba(14, 31, 22, .58); }
.product-browser-panel { display: flex; max-height: 92dvh; flex-direction: column; overflow: hidden; }
.product-browser-header { display: flex; flex: 0 0 auto; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #e7ebe2; }
.product-browser-header h2 { margin: 3px 0 0; font: 800 1.15rem/1.25 system-ui, sans-serif; }
.product-browser-content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; overflow-y: auto; padding: 16px; }
.product-detail-gallery { min-width: 0; }
.product-detail-main-photo { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: contain; border-radius: 10px; background: #f1f2ec; }
.product-detail-thumbnails { display: flex; gap: 8px; overflow-x: auto; padding-top: 8px; }
.product-detail-thumb { width: 58px; height: 58px; flex: 0 0 auto; padding: 2px; border: 1px solid #dfe5da; border-radius: 7px; background: #fff; }
.product-detail-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.product-detail-info { min-width: 0; }
.product-detail-price { margin: 0 0 12px; color: #a9561d; font: 850 1.25rem/1.2 system-ui, sans-serif; }
.product-detail-specs { margin: 0 0 12px; border-top: 1px solid #e7ebe2; }
.product-detail-specs > div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 8px; padding: 8px 0; border-bottom: 1px solid #e7ebe2; }
.product-detail-specs dt { color: #68766d; font-size: .8rem; }
.product-detail-specs dd { margin: 0; font-size: .82rem; font-weight: 700; overflow-wrap: anywhere; }
.product-detail-info h3 { margin: 12px 0 5px; font-size: .9rem; }
.product-detail-description,.product-photo-note { color: #596b5e; font-size: .82rem; line-height: 1.5; white-space: pre-wrap; }
.product-store-link { width: 100%; min-height: 44px; margin-top: 8px; border: 0; border-radius: 9px; background: #1b4d3e; color: #fff; font: 750 .84rem/1.2 system-ui, sans-serif; cursor: pointer; touch-action: manipulation; }
.product-photo-note { margin: 8px 0 0; font-size: .7rem; }
.product-chat-start-button { width: 100%; min-height: 44px; margin-top: 8px; border: 1px solid #1b4d3e; border-radius: 9px; background: #fff; color: #1b4d3e; font: 750 .84rem/1.2 system-ui, sans-serif; cursor: pointer; touch-action: manipulation; }
.product-chat-dialog { width: min(620px, calc(100vw - 24px)); }
.product-chat-panel { width: 100%; max-height: min(88dvh, 760px); overflow: auto; }
.product-chat-privacy { margin: 8px 0 12px; padding: 9px 11px; border-radius: 8px; background: #f0f5ee; color: #42564a; font-size: .78rem; line-height: 1.45; }
.product-chat-messages { display: flex; min-height: 150px; max-height: 42dvh; flex-direction: column; gap: 9px; overflow-y: auto; padding: 8px 4px; }
.product-chat-bubble { align-self: flex-start; width: min(86%, 460px); padding: 9px 11px; border: 1px solid #e2e8df; border-radius: 12px 12px 12px 3px; background: #f6f8f4; overflow-wrap: anywhere; }
.product-chat-bubble.mine { align-self: flex-end; border-color: #cfe1d2; border-radius: 12px 12px 3px 12px; background: #eaf4eb; }
.product-chat-bubble p { margin: 6px 0 0; color: #34433a; font-size: .86rem; line-height: 1.45; white-space: pre-wrap; }
.product-chat-bubble .product-chat-offer { color: #164b3d; font-weight: 800; }
.product-chat-photo { display: block; max-width: 100%; max-height: 240px; margin-top: 8px; border-radius: 8px; object-fit: contain; }
.product-chat-actions { display: flex; gap: 8px; margin: 8px 0; }
.product-chat-actions button { flex: 1; min-height: 42px; }
.product-chat-form { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: end; }
.product-chat-form textarea { width: 100%; min-height: 48px; max-height: 140px; padding: 10px; border: 1px solid #cad6cb; border-radius: 8px; resize: vertical; font: inherit; }
.product-chat-form .checkout-button { min-width: 78px; min-height: 44px; }
.product-inquiry-card { display: grid; gap: 8px; }
.vendor-store-content { display: block; }
.vendor-store-content > p { margin: 0 0 12px; color: #596b5e; font-size: .84rem; }
.vendor-store-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.vendor-store-item { display: flex; min-width: 0; gap: 9px; align-items: center; padding: 8px; border: 1px solid #e5e8df; border-radius: 9px; background: #fff; text-align: left; cursor: pointer; touch-action: manipulation; }
.vendor-store-item img { width: 58px; height: 58px; flex: 0 0 auto; object-fit: cover; border-radius: 6px; background: #f1f2ec; }
.vendor-store-item span { display: grid; min-width: 0; gap: 4px; }
.vendor-store-item strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: .78rem; }
.vendor-store-item small { color: #a9561d; font-weight: 800; }
@media (max-width: 680px) {
  .continue-shopping-button { width: 100%; }
  .product-browser-dialog { width: calc(100vw - 12px); max-height: 88dvh; border-radius: 15px; }
  .product-browser-panel { max-height: 88dvh; }
  .product-browser-content { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px; }
  .product-detail-main-photo { max-height: 34dvh; }
  .product-detail-info { padding-bottom: 6px; }
  .product-chat-messages { max-height: 36dvh; }
  .product-chat-form { grid-template-columns: minmax(0,1fr); }
  .product-chat-form .checkout-button { width: 100%; }
  .vendor-store-list { grid-template-columns: minmax(0, 1fr); }
}
