.checkout-mobile-label { display: none; }
.checkout-items-table { width: 100%; table-layout: fixed; }
.checkout-items-table th:first-child { width: 56%; }
.checkout-items-table td { overflow-wrap: anywhere; }
.site-main > .checkout.checkout-standalone { padding-top: 150px; }

@media screen and (max-width: 991px) {
  .site-main > .checkout { padding-bottom: 40px; }
  .site-main > .checkout.checkout-standalone { padding-top: 125px; }
  .checkout .container, .checkout .row > div { min-width: 0; }
  .checkout p, .checkout h1, .checkout h2, .checkout h3,
  .checkout .title, .checkout .alert { overflow-wrap: anywhere; }
  .checkout h1 { font-size: clamp(25px, 5vw, 34px); line-height: 1.25; }
  .checkout .row > .col-md-5 { margin-top: 28px; }
  .checkout .form-control { width: 100%; max-width: 100%; min-height: 44px; font-size: 16px; }
  .checkout textarea.form-control { height: auto; }
  .checkout form label { line-height: 1.5; }
  .checkout form input[type="radio"] { margin-right: 8px; }
  .checkout .cart-block.cart-block-header { display: none; }
  .checkout .cart-block.cart-block-item {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 16px;
    margin-bottom: 14px;
    border: 1px solid #e4e7eb;
    border-radius: 12px;
    background: #fff;
  }
  .checkout .cart-block.cart-block-item::before,
  .checkout .cart-block.cart-block-item::after { display: none; }
  .checkout .cart-block.cart-block-item > div {
    float: none;
    display: block;
    width: auto;
    min-width: 0;
    max-width: 100%;
    padding: 0;
    margin: 0;
    text-align: left;
  }
  .checkout .cart-block.cart-block-item > .image { grid-column: 1; grid-row: 1; }
  .checkout .cart-block.cart-block-item > .image img { width: 80px; height: 80px; object-fit: contain; }
  .checkout .cart-block.cart-block-item > .title { grid-column: 2; grid-row: 1; }
  .checkout .cart-block.cart-block-item .title .h4 { margin: 0 0 6px; font-size: 17px; white-space: normal; }
  .checkout .cart-block.cart-block-item > .quantity { grid-column: 1; grid-row: 2; }
  .checkout .cart-block.cart-block-item .form-quantity { width: 80px; max-width: 100%; height: 44px; padding: 8px; }
  .checkout .cart-block.cart-block-item > .price { grid-column: 2; grid-row: 2; text-align: right; }
  .checkout .cart-block.cart-block-item .price .final { display: block; margin: 0; font-size: 21px; line-height: 1.3; }
  .checkout .checkout-mobile-label { display: block; font-size: 12px; color: #687581; margin-bottom: 5px; }
  .checkout .cart-block.cart-block-item > .cart-remove { grid-column: 1 / -1; justify-self: end; width: auto; min-height: 44px; }
  .checkout .cart-block.cart-block-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px 16px;
  }
  .checkout .cart-block.cart-block-footer::before,
  .checkout .cart-block.cart-block-footer::after { display: none; }
  .checkout .cart-block.cart-block-footer > div { width: auto; float: none; padding: 0; }
  .checkout .cart-block.cart-block-footer .title { margin: 0; font-size: 24px; }
  .checkout .checkout-step-actions { display: flex; flex-direction: column; gap: 10px; }
  .checkout .btn { min-height: 44px; white-space: normal; line-height: 1.5; padding: 12px 16px; max-width: 100%; }
  .checkout .checkout-step-actions > *, .checkout.checkout-page .btn { width: 100%; margin: 0; }
  .checkout.checkout-page .btn + .btn { margin-top: 10px; }
  .checkout .btn-clean { color: #304b78 !important; border-color: #9daab7; background: #fff; }
}

@media screen and (max-width: 599px) {
  .checkout .table-responsive { border: 0; overflow: visible; }
  .checkout .checkout-items-table, .checkout .checkout-items-table tbody { display: block; width: 100%; }
  .checkout .checkout-items-table thead {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
  }
  .checkout .checkout-items-table tbody tr {
    display: block; padding: 12px 16px; margin-bottom: 12px;
    border: 1px solid #e4e7eb; border-radius: 12px; background: #fff;
  }
  .checkout .checkout-items-table tbody td {
    display: grid; grid-template-columns: 75px minmax(0, 1fr); gap: 12px;
    padding: 8px 0; border: 0; white-space: normal; text-align: right;
  }
  .checkout .checkout-items-table tbody td::before { content: attr(data-label); text-align: left; color: #687581; font-weight: 500; }
  .checkout .checkout-items-table tbody td:first-child { font-weight: 600; }
}

/* Staff record tabs must not inherit the site's fixed navbar or button rules. */
.staff-orders .staff-record-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  position: static;
  gap: 6px;
  padding: 6px;
  margin: 20px 0 28px;
  border: 1px solid #dce1e6;
  border-radius: 10px;
  background: #f3f5f7;
  max-width: 600px;
}
.staff-orders .staff-record-tabs > a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 46px;
  padding: 12px;
  border-radius: 6px;
  color: #455361;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  text-shadow: none;
}
.staff-orders .staff-record-tabs > a[aria-current="page"] { background: #ffbb00; color: #252b32; }
.staff-orders .staff-record-tabs > a:not([aria-current]):hover { background: #e4e9ee; }
.staff-orders .staff-record-tabs > a:focus-visible { outline: 2px solid #304b78; outline-offset: 2px; }

/* Keep confirmation fieldsets and native date/select controls within narrow screens. */
@media screen and (max-width: 991px) {
  .checkout.checkout-page form,
  .checkout.checkout-page fieldset { min-width: 0; max-width: 100%; }
  .checkout.checkout-page fieldset { box-sizing: border-box; }
  .checkout.checkout-page legend { font-size: 18px; overflow-wrap: anywhere; }
  .checkout.checkout-page form label { display: block; margin-bottom: 6px; }
  .checkout.checkout-page form p { margin-bottom: 18px; }
  .checkout.checkout-page input[type="date"] { display: block; min-width: 0; }
  .checkout.checkout-page select.form-control { text-overflow: ellipsis; }
  .checkout.checkout-page .errorlist { padding-left: 20px; color: #a12622; }
  .checkout.whatsapp-order-confirmation h2 { font-size: 23px; line-height: 1.3; }
  .checkout.checkout-page .cart-block.cart-block-item > .price:last-child {
    grid-column: 2; grid-row: 2; justify-self: end;
  }
}
