/* Responsive craft for order label, dispatch, dock, showroom gallery.
   Breakpoints align with Valor / UX Pro Max: 375 · 480 · 768 · 981 · 1024 · 1440.
   Intrinsic first (clamp, flex-wrap), media for structural shifts. */

/* --------------------------------------------------------------------------
   Shared action rows (buyer / seller / payment)
   -------------------------------------------------------------------------- */
.ship-btn-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.ship-btn-wrap .ship-btn {
  flex: 1 1 220px;
  max-width: 100%;
}

.ship-btn-wrap .btn {
  flex: 1 1 auto;
  min-height: 44px;
  min-width: 0;
}

.buyer-order__actions,
.account-section__head,
.seller-order__courier {
  max-width: 100%;
  min-width: 0;
}

.buyer-order__actions .btn,
.account-section__head .btn {
  min-height: 44px;
}

/* Admin order table: status + label stay usable on narrow desks */
.admin-table td .btn {
  display: inline-flex;
  margin-top: 8px;
  min-height: 36px;
}

@media (max-width: 479px) {
  .ship-btn-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .ship-btn-wrap .ship-btn,
  .ship-btn-wrap .btn {
    flex: 1 1 auto;
    width: 100%;
  }

  .buyer-order__actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .buyer-order__actions .btn {
    width: 100%;
    justify-content: center;
  }

  .account-section__head {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .account-section__head .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (min-width: 480px) and (max-width: 767px) {
  .ship-btn-wrap {
    gap: 10px;
  }

  .buyer-order__actions {
    gap: 8px;
  }
}

@media (min-width: 768px) {
  .ship-btn-wrap {
    gap: 12px;
  }

  .ship-btn-wrap .ship-btn {
    flex: 0 0 240px;
    width: 240px;
  }

  .ship-btn-wrap .btn {
    flex: 0 1 auto;
  }
}

@media (min-width: 1024px) {
  .ship-btn-wrap {
    gap: 12px 14px;
  }
}

/* --------------------------------------------------------------------------
   Order label ticket — phone / tablet / desktop
   -------------------------------------------------------------------------- */
.order-label-page {
  padding-inline: clamp(12px, 3vw, 28px);
  padding-block: clamp(20px, 4vw, 48px) clamp(40px, 8vw, 72px);
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

.order-label-page .container--narrow {
  width: 100%;
  max-width: min(440px, 100%);
  margin-inline: auto;
  padding-inline: 0;
  box-sizing: border-box;
}

.ol-machine,
.ol-foot {
  width: min(400px, 100%);
  max-width: 100%;
}

.ol-window {
  padding-inline: clamp(12px, 4vw, 22px);
  padding-bottom: clamp(20px, 4vw, 30px);
}

.ol-receipt {
  padding: clamp(20px, 4vw, 30px) clamp(14px, 3.5vw, 24px) clamp(20px, 4vw, 26px);
  border-radius: 0 0 clamp(18px, 4vw, 28px) clamp(18px, 4vw, 28px);
}

.ol-receipt h1 {
  font-size: clamp(1.35rem, 5vw, 1.65rem);
}

.ol-receipt .ol-sub {
  font-size: clamp(0.9rem, 3.2vw, 0.95rem);
  max-width: 28ch;
}

.ol-grid {
  gap: clamp(12px, 3vw, 16px) clamp(8px, 2vw, 12px);
}

.ol-grid dd {
  font-size: clamp(0.9rem, 3.2vw, 0.95rem);
}

.ol-grid .ol-amount {
  font-size: clamp(1.15rem, 4.5vw, 1.375rem);
}

.ol-codes {
  flex-wrap: wrap;
  gap: 12px;
  padding: clamp(10px, 2.5vw, 13px) clamp(12px, 3vw, 16px);
}

.ol-codes img {
  width: clamp(80px, 22vw, 96px);
  height: clamp(80px, 22vw, 96px);
}

.ol-actions a,
.ol-actions button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-inline: clamp(14px, 3vw, 18px);
}

.ol-actions {
  width: 100%;
  gap: 8px;
}

@media (max-width: 379px) {
  .ol-grid {
    grid-template-columns: 1fr;
  }

  .ol-grid > div:nth-child(even) {
    text-align: left;
  }

  .ol-codes {
    flex-direction: column;
    align-items: flex-start;
  }

  .ol-actions {
    flex-direction: column;
  }

  .ol-actions a,
  .ol-actions button {
    width: 100%;
  }

  .ol-m-body {
    height: 56px;
    border-radius: 18px 18px 6px 6px;
  }

  .ol-m-gap {
    top: 52px;
  }

  .ol-m-lip {
    top: 62px;
    height: 16px;
  }
}

@media (min-width: 480px) {
  .order-label-page .container--narrow {
    max-width: 460px;
  }

  .ol-machine,
  .ol-foot {
    width: min(420px, 100%);
  }
}

@media (min-width: 768px) {
  .order-label-page {
    padding-block: 40px 80px;
  }

  .order-label-page .container--narrow {
    max-width: 480px;
  }

  .ol-machine,
  .ol-foot {
    width: min(440px, 100%);
  }

  .ol-receipt {
    padding: 32px 28px 28px;
  }

  .ol-codes {
    flex-wrap: nowrap;
  }
}

@media (min-width: 1024px) {
  .page-order-label main {
    min-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
  }

  .order-label-page {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-block: 48px 96px;
  }

  .order-label-page .container--narrow {
    max-width: 500px;
  }
}

@media (min-width: 1440px) {
  .order-label-page .container--narrow {
    max-width: 520px;
  }
}

/* --------------------------------------------------------------------------
   Dispatch button scale
   -------------------------------------------------------------------------- */
.ship-btn {
  height: 48px;
  width: min(100%, 240px);
  border-radius: 28px;
}

.ship-btn .lbl {
  top: 12px;
  font-size: 14px;
}

.ship-btn .cargo {
  top: 14px;
}

.ship-btn .vehicle {
  top: 4px;
}

.ship-btn .rail {
  top: 23px;
}

.payment-card .ship-btn-wrap {
  justify-content: center;
  margin-block: 16px 8px;
}

@media (min-width: 480px) {
  .ship-btn {
    height: 52px;
  }

  .ship-btn .lbl {
    top: 14px;
    font-size: 15px;
  }

  .ship-btn .cargo {
    top: 16px;
  }

  .ship-btn .vehicle {
    top: 6px;
  }

  .ship-btn .rail {
    top: 25px;
  }
}

@media (min-width: 768px) {
  .ship-btn {
    height: 56px;
    border-radius: 32px;
  }

  .ship-btn .lbl {
    top: 16px;
  }

  .ship-btn .cargo {
    top: 18px;
  }

  .ship-btn .vehicle {
    top: 8px;
  }

  .ship-btn .rail {
    top: 27px;
  }
}

/* Short landscape phones: keep dispatch compact, hide decorative height */
@media (max-height: 500px) and (orientation: landscape) {
  .ship-btn {
    height: 44px;
  }

  .ship-btn .vehicle,
  .ship-btn .cargo,
  .ship-btn .rail {
    display: none;
  }

  .ship-btn .lbl {
    top: 10px;
  }

  .ol-machine .ol-m-body,
  .ol-m-gap,
  .ol-m-lip,
  .ol-led {
    display: none;
  }

  .ol-window {
    padding-top: 0;
  }

  .ol-paper {
    transform: none !important;
  }
}

/* --------------------------------------------------------------------------
   Mobile floating dock — phone only; safe areas + no clip
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  body:not(.page-seller):not(.page-admin):not(.page-moderator) .mobile-dock {
    max-width: calc(100vw - 24px);
  }

  body:not(.page-seller):not(.page-admin):not(.page-moderator) .site-footer,
  body.page-home:not(.page-seller):not(.page-admin):not(.page-moderator) .site-footer {
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  }

  body.page-order-label:not(.page-seller),
  body.page-payment:not(.page-seller) {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 768px) {
  .mobile-dock {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   Showroom gallery (store-gallery__*) — keep rail inside viewport
   -------------------------------------------------------------------------- */
.store-showroom {
  container-type: inline-size;
  container-name: showroom;
}

.store-gallery,
.store-gallery__stage,
.store-gallery__controls,
.store-gallery__caption {
  max-width: 100%;
  min-width: 0;
}

@container showroom (max-width: 420px) {
  .store-gallery__controls {
    gap: 10px;
  }

  .store-gallery__copy {
    font-size: 0.85rem;
  }
}

/* --------------------------------------------------------------------------
   Payment success with dispatch
   -------------------------------------------------------------------------- */
.payment-card {
  width: 100%;
  max-width: min(440px, 100%);
  margin-inline: auto;
  box-sizing: border-box;
}

@media (max-width: 479px) {
  .payment-card .section__actions {
    display: grid;
    gap: 8px;
  }

  .payment-card .section__actions .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (min-width: 768px) {
  .payment-card {
    max-width: 480px;
  }
}

@media (min-width: 1024px) {
  .payment-card {
    max-width: 520px;
  }
}

/* --------------------------------------------------------------------------
   Seller order cards on tablet / desktop
   -------------------------------------------------------------------------- */
.seller-order {
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 767px) {
  .seller-order .seller-statement {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .seller-order .ship-btn-wrap {
    margin-top: 12px;
  }
}
