/* RUN Release A UI Polish R1 — visual-only: catalog CTA + mobile alignment.
   Does not affect OTP, price, delivery, Project storage or Firebase rules. */

/* Product actions: consistent typography and optical centering on desktop. */
#productTableBody .price-brand-cell .run-price-stack .run-row-actions button {
  box-sizing:border-box;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  vertical-align:middle;
  border-radius:10px!important;
  min-height:42px!important;
  font:750 12px/1.25 Arial,sans-serif!important;
  padding:10px 12px!important;
  letter-spacing:0;
}
#productTableBody .price-brand-cell .run-price-stack .run-row-actions [data-run-action="add"] {
  background:#ce0e1d!important;
  border-color:#ce0e1d!important;
  color:#fff!important;
}
#productTableBody .price-brand-cell .run-price-stack .run-row-actions [data-run-action="delivery"] {
  background:#135d96!important;
  border-color:#135d96!important;
  color:#fff!important;
}
#productTableBody .price-brand-cell .run-price-stack .run-row-actions button:focus-visible {
  outline:3px solid #377ff3!important;
  outline-offset:2px;
}

/* Result-view Add to Project uses the same centered button system. */
#deliveryEstimatorResultView .delivery-result-actions #runRC3BAddDelivery,
#deliveryEstimatorResultView .delivery-result-actions #deliveryConfirmSales {
  box-sizing:border-box;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  text-align:center!important;
  line-height:1.3!important;
  min-height:48px;
  padding:11px 14px;
  border-radius:11px;
}

@media(max-width:700px) {
  /* Preserve mobile cards while reclaiming the full price area for actions.
     Price + logo are row 1; actions span the full available value width in row 2. */
  #productTableBody td:nth-child(5) .price-brand-cell {
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 64px!important;
    grid-template-rows:auto auto!important;
    align-items:center!important;
    justify-content:stretch!important;
    justify-items:stretch!important;
    column-gap:8px!important;
    row-gap:9px!important;
    box-sizing:border-box!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    padding:0!important;
  }
  #productTableBody td:nth-child(5) .price-brand-cell .run-price-stack {
    display:contents!important;
  }
  #productTableBody td:nth-child(5) .price-brand-cell .run-price-stack .price-badge {
    grid-column:1!important;
    grid-row:1!important;
    justify-self:center!important;
    align-self:center!important;
    text-align:center!important;
    min-width:0!important;
    max-width:100%!important;
    margin-inline:auto!important;
    box-sizing:border-box!important;
    white-space:normal!important;
    overflow-wrap:anywhere;
  }
  #productTableBody td:nth-child(5) .price-brand-cell > .brand-logo-mark,
  #productTableBody td:nth-child(5) .price-brand-cell > .brand-logo-mark.has-asset {
    grid-column:2!important;
    grid-row:1!important;
    width:64px!important;
    max-width:64px!important;
    min-width:0!important;
    justify-self:center!important;
    margin-inline:auto!important;
    box-sizing:border-box!important;
  }
  #productTableBody td:nth-child(5) .price-brand-cell .run-price-stack .run-row-actions {
    grid-column:1 / -1!important;
    grid-row:2!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    justify-content:stretch!important;
    justify-items:stretch!important;
    align-items:stretch!important;
    flex-wrap:initial!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    gap:8px!important;
    margin:0 auto!important;
  }
  #productTableBody td:nth-child(5) .price-brand-cell .run-price-stack .run-row-actions button {
    box-sizing:border-box!important;
    width:100%!important;
    min-width:0!important;
    min-height:46px!important;
    padding:8px 6px!important;
    font-size:12.5px!important;
    line-height:1.25!important;
    white-space:normal!important;
    overflow-wrap:normal!important;
  }
  #productTableBody td:nth-child(5) .price-brand-cell .run-row-actions button:only-child {
    grid-column:1 / -1!important;
  }
  /* Center mobile hero navigation, with symmetric gutters. */
  .run-next-mobile-nav {
    box-sizing:border-box;
    max-width:100%;
    margin-inline:auto!important;
    justify-items:center!important;
  }
  /* Keep dialogs inside the viewport and centered. */
  #runProjectModal.run-next-modal {
    box-sizing:border-box;
    padding:12px!important;
    align-items:center!important;
    justify-content:center!important;
  }
  #runProjectModal .run-next-sheet {
    box-sizing:border-box!important;
    width:min(100%,560px)!important;
    max-width:100%!important;
    margin-inline:auto!important;
  }
  #deliveryEstimatorResultView .delivery-result-actions {
    align-items:stretch;
    justify-items:stretch;
    width:100%;
  }
  #deliveryEstimatorResultView .delivery-result-actions #runRC3BAddDelivery,
  #deliveryEstimatorResultView .delivery-result-actions #deliveryConfirmSales {
    width:100%!important;
    max-width:100%!important;
    flex:1 1 auto!important;
    font-size:13px!important;
  }
}

/* Narrow phones: keep complete labels instead of cramped two-button mini labels. */
@media(max-width:400px) {
  #productTableBody td:nth-child(5) .price-brand-cell .run-price-stack .run-row-actions {
    grid-template-columns:minmax(0,1fr)!important;
    gap:7px!important;
  }
  #productTableBody td:nth-child(5) .price-brand-cell .run-row-actions [data-run-action="add"] .run-cta-full {
    display:inline!important;
  }
  #productTableBody td:nth-child(5) .price-brand-cell .run-row-actions [data-run-action="add"] .run-cta-compact {
    display:none!important;
  }
}
@media print {
  #productTableBody .run-row-actions {display:none!important;}
}
