/* ── Admin box (outer container) ─────────────────────────────────── */
/* Full-width by default on every platform. The `card` class some frameworks
   add (e.g. WP core, Bootstrap) can impose a narrow max-width — neutralize it
   here so the responsive layout gets the full available width. */
.coleteonline-admin-box {
  max-width: none;
}

/* ── Admin box header (logo + title) ─────────────────────────────── */
.coleteonline-admin-box-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 10px;
  margin: 0 16px 12px;
  border-bottom: 1px solid #ddd;
}

.coleteonline-admin-box-header img {
  max-height: 25px;
  float: none;
}

.coleteonline-admin-box-header .panel-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

/* ── Main container ──────────────────────────────────────────────── */
#coleteonline_order_shipping_wrapper {
  /* full-width by default for every platform; a wrapper can cap it if needed */
  max-width: none;
  padding: 0 16px;
}

/* ── Order section ───────────────────────────────────────────────── */
.order {
  border: 1px solid #ddd;
  border-radius: 4px;
  margin: 10px 0;
  padding: 16px;
  background: #fff;
  overflow: hidden;
}

/* ── Addresses ───────────────────────────────────────────────────── */
.addresses {
  display: flex;
  gap: 24px;
  margin-top: 8px;
}

.addresses .pick-up-address,
.addresses .delivery-address {
  flex: 1;
  min-width: 0;
}

.addresses .pick-up-address {
  padding-right: 0;
}

.coleteonline-address-title {
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 600;
}

.address-table,
.coleteonline-address-table {
  font-size: 13px;
  line-height: 1.5;
}

.coleteonline-change-address {
  margin-bottom: 6px;
}

.coleteonline-address-select-wrapper {
  display: none;
  max-width: 100%;
  margin-bottom: 6px;
}

.coleteonline-address-select-wrapper .select2-container {
  max-width: 100% !important;
}

#coleteonline-address-select + .select2-container .select2-selection__rendered {
  padding-right: 32px;
}

/* ── Extra options ───────────────────────────────────────────────── */
.coleteonline-extra-options {
  margin-top: 20px;
}

.coleteonline-extra-options td {
  padding: 4px 8px 4px 0;
  vertical-align: middle;
}

.coleteonline-extra-options label {
  white-space: nowrap;
}

.coleteonline-extra-options input[type="text"],
.coleteonline-extra-options input[type="number"] {
  max-width: 140px;
}

/* ── Packages table ──────────────────────────────────────────────── */
.coleteonline-packages-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 4px;
}

.coleteonline-packages-table {
  border-collapse: collapse;
  width: 100%;
}

.coleteonline-packages-table th {
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  border-bottom: 1px solid #ddd;
  text-align: center;
  white-space: nowrap;
}

.coleteonline-packages-table td {
  padding: 5px 6px;
  vertical-align: middle;
}

.coleteonline-packages-table td:not(.coleteonline-product-name) {
  text-align: center;
  white-space: nowrap;
}

.coleteonline-packages-table .coleteonline-product-name {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.coleteonline-thumb img {
  width: 36px;
  height: 36px;
  border-radius: 3px;
  vertical-align: middle;
}

.coleteonline-product-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.coleteonline-product-sku {
  display: block;
  font-size: 11px;
  color: #787c82;
  font-weight: 400;
}

.coleteonline-thumb .order-product-thumbnail:empty {
  width: 32px;
  height: 32px;
  background: #f0f0f1;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.coleteonline-thumb .order-product-thumbnail:empty::after {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  background: #c3c4c7;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' fill='none' stroke='currentColor' stroke-width='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5' fill='currentColor'/%3E%3Cpath d='M21 15l-5-5L5 21' fill='none' stroke='currentColor' stroke-width='2'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' fill='none' stroke='currentColor' stroke-width='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5' fill='currentColor'/%3E%3Cpath d='M21 15l-5-5L5 21' fill='none' stroke='currentColor' stroke-width='2'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  mask-size: contain;
}

.coleteonline-package-weight,
.coleteonline-package-dimensions {
  text-align: center;
}

.coleteonline-package-weight-total-input,
.coleteonline-package-width-total-input,
.coleteonline-package-length-total-input,
.coleteonline-package-height-total-input,
.coleteonline-package-input {
  max-width: 50px;
  text-align: center;
}

.total-row, .total-row td {
  background: #f5f5f5;
}

.total-row td {
  padding: 6px;
  vertical-align: middle;
}

.coleteonline-add-item {
  vertical-align: middle !important;
  margin-left: 4px;
  padding: 0 8px !important;
  min-height: 24px;
  line-height: 22px;
  font-size: 14px;
}

/* ── Packages footer (add/reset/type/content) ────────────────────── */
.coleteonline-packages-table tfoot td {
  padding: 8px 6px;
  text-align: left !important;
}

/* ── Buttons ─────────────────────────────────────────────────────── */
/* Neutral DEFAULT button styling so the lib looks complete on any platform
   even with no Bootstrap/admin framework loaded. Platform wrappers (e.g. the
   WooCommerce overlay) re-theme these with their own brand colors. */
.coleteonline-admin-box .btn {
  display: inline-block;
  box-sizing: border-box;
  padding: 6px 14px;
  font-size: 13px;
  line-height: 1.5;
  font-family: inherit;
  border: 1px solid #c3c4c7;
  border-radius: 4px;
  background: #f6f7f7;
  color: #1d2327;
  cursor: pointer;
  text-decoration: none;
  vertical-align: middle;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.coleteonline-admin-box .btn:hover,
.coleteonline-admin-box .btn-default:hover {
  background: #ebebed;
  border-color: #8c8f94;
}
.coleteonline-admin-box .btn-default,
.coleteonline-admin-box .btn-outline-secondary {
  background: #fff;
  color: #1d2327;
  border-color: #c3c4c7;
}
.coleteonline-admin-box .btn-primary {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}
.coleteonline-admin-box .btn-primary:hover {
  background: #1e40af;
  border-color: #1e40af;
  color: #fff;
}
.coleteonline-admin-box .btn[disabled],
.coleteonline-admin-box .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Remove-item / remove-package buttons live only inside the package cards;
   they are styled as subtle ghost icon-buttons further below
   (.coleteonline-package-card / .coleteonline-pkg-head-actions). The old
   red filled style was removed so those subtle styles apply. */

/* Button icon prefixes */
.coleteonline-add-package::before { content: "+ "; }
.coleteonline-reset-packages::before { content: "↻ "; }
.coleteonline-do-fetch-services-list::before { content: "↻ "; }

button.coleteonline-do-fetch-services-list {
  margin-bottom: 10px !important;
  display: block;
}

button.coleteonline-show-all-offers {
  margin-top: 10px !important;
  margin-bottom: 10px !important;
  display: block;
}

button.coleteonline-do-create-courier-order {
  margin-top: 15px !important;
  display: block;
}

/* ── Offers table ────────────────────────────────────────────────── */
.coleteonline-couriers-offers {
  width: 100%;
  /* Collapse the default 2px border-spacing — otherwise the transparent table paints a
     white line between every row (incl. between a courier and its locker-select row).
     Row separation comes from the per-courier-row border-top instead. */
  border-collapse: collapse;
}

.coleteonline-couriers-offers td {
  padding: 4px 8px;
}

/* Zebra striping: alternate service blocks get a subtle tint so the price column
   is easy to follow. Selected/section-header rows keep their own background. */
.coleteonline-couriers-offers tbody tr.coleteonline-offer-alt {
  background: #eaecf0;
}

.coleteonline-couriers-offers .full-width {
  max-width: 350px;
}

tr.coleteonline-selected-by-client {
  color: inherit;
  font-weight: 500;
}

.coleteonline-courier-list-title {
  margin: 24px 0 8px;
}

/* Section headings spacing — but not the first one */
.order h3 {
  margin-top: 20px;
  margin-bottom: 8px;
}

.order > :first-child h3,
.order > h3:first-child,
.addresses .coleteonline-address-title {
  margin-top: 0;
}

/* ── Error messages ──────────────────────────────────────────────── */
.coleteonline-notice-error {
  border: 1px solid #dc3545;
  border-left: 4px solid #dc3545;
  background: #fff5f5;
  padding: 10px 14px;
  margin-bottom: 10px;
  border-radius: 2px;
}

.coleteonline-notice-error ul,
.coleteonline-show-offers-errors ul,
.coleteonline-show-order-errors ul {
  margin-left: 15px;
  list-style-type: disc;
}

.coleteonline-packages-errors {
  display: none;
  background: #fff5f5;
  border: 1px solid #dc3545;
  border-left: 4px solid #dc3545;
  border-radius: 2px;
  padding: 8px 14px;
  margin-top: 12px;
}

.coleteonline-show-offers-errors:not(:empty),
.coleteonline-show-order-errors:not(:empty) {
  border: 1px solid #dc3545;
  border-left: 4px solid #dc3545;
  background: #fff5f5;
  border-radius: 2px;
  padding: 10px 14px;
  margin-top: 12px;
}

.coleteonline-invalid {
  border-color: #dc3545 !important;
  background-color: #fff5f5 !important;
  color: #dc3545 !important;
}

/* ── Courier orders ──────────────────────────────────────────────── */
.coleteonline-courier-order {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px 24px;
  padding: 0;
}

.coleteonline-courier-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.coleteonline-courier-price .coleteonline-courier-price-total {
  font-weight: 600;
}

.coleteonline-courier-awb {
  font-weight: 600;
}

/* ── Utility ─────────────────────────────────────────────────────── */
.full-width {
  width: 100%;
}

.padding-bottom-1 {
  padding-bottom: .25em;
}

.border-bottom-black {
  border-bottom: 1px solid #ddd;
}

.text-center {
  text-align: center;
}

.bg-gray-100 {
  background-color: #f5f5f5;
}

.fs-xl {
  font-size: 1.25rem;
}

.vertical-align-middle {
  vertical-align: middle;
}

.add-extra-orders {
  margin: 20px 0 16px;
  text-align: right;
}

/* ── Map picker ──────────────────────────────────────────────────── */
.coleteonline-map-picker-row td {
  text-align: left !important;
  padding-top: 10px !important;
  padding-bottom: 18px !important;
}

.coleteonline-open-point-picker-admin {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  color: inherit;
  background: #f8f8f8;
  border: 1px solid #999;
  border-radius: 4px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  line-height: 1.4;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.coleteonline-open-point-picker-admin::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background: currentColor;
  -webkit-mask-image: url("../assets/map-pin.svg");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-image: url("../assets/map-pin.svg");
  mask-size: contain;
  mask-repeat: no-repeat;
}

.coleteonline-open-point-picker-admin:hover {
  background: #e8e8e8;
  border-color: #666;
  text-decoration: none;
}

.coleteonline-open-point-picker-admin:focus {
  outline: 2px solid currentColor;
  outline-offset: 1px;
}

/* ── Loading spinner ─────────────────────────────────────────────── */
.coleteonline-lds-ring {
  display: inline-block;
  position: relative;
  width: 36px;
  height: 36px;
  margin: 12px 0;
}

.coleteonline-lds-ring div {
  display: none;
}

.coleteonline-lds-ring div:first-child {
  display: block;
  box-sizing: border-box;
  width: 36px;
  height: 36px;
  border: 3px solid #ddd;
  border-top-color: #999;
  border-radius: 50%;
  animation: coleteonline-lds-ring 0.8s linear infinite;
}

@keyframes coleteonline-lds-ring {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media only screen and (max-width: 782px) {
  .addresses {
    flex-direction: column;
    gap: 16px;
  }

  .order {
    padding: 10px;
  }

  .coleteonline-courier-order {
    flex-direction: column;
    gap: 8px;
  }

  .coleteonline-couriers-offers .full-width {
    max-width: 100%;
  }

  .coleteonline-extra-options input[type="text"],
  .coleteonline-extra-options input[type="number"] {
    max-width: 110px;
  }
}

@media only screen and (max-width: 480px) {
  #coleteonline_order_shipping_wrapper {
    font-size: 13px;
  }

  .order {
    padding: 10px;
  }

  .coleteonline-packages-table td {
    padding: 3px 2px;
  }

  .coleteonline-packages-table th {
    padding: 4px 3px;
    font-size: 11px;
  }

  .coleteonline-package-weight-total-input,
  .coleteonline-package-width-total-input,
  .coleteonline-package-length-total-input,
  .coleteonline-package-height-total-input,
  .coleteonline-package-input {
    max-width: 40px;
    font-size: 12px;
    padding: 2px 3px;
  }

  .coleteonline-thumb img {
    width: 24px;
    height: 24px;
  }

  .coleteonline-remove-item, .coleteonline-remove-package {
    padding: 1px 5px !important;
    font-size: 11px;
    min-height: 22px;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   Redesign v4 — platform-agnostic layout
   Colors here are neutral; WP/PS/Magento overrides add branding.
   ═══════════════════════════════════════════════════════════════════ */

/* ── 1. Container query foundation ─────────────────────────────────── */
.coleteonline-metabox-container {
  container-type: inline-size;
  container-name: metabox;
}

.order {
  padding: 0;
}

/* ── 2. Address strip — 3-col default, 2+1 at ≤1100, 1-col at ≤860 ─ */
.coleteonline-address-strip {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1.05fr);
  gap: 14px;
  padding: 16px;
  margin-top: 0;
  background: #fbfbfc;
  border-bottom: 1px solid #dcdcde;
}

.coleteonline-address-strip > .pick-up-address,
.coleteonline-address-strip > .delivery-address,
.coleteonline-address-strip > .coleteonline-options-card {
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  padding: 12px 14px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.coleteonline-address-strip > .pick-up-address {
  padding-right: 14px;
}

/* Address block head — heading + action on same row */
.coleteonline-address-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.coleteonline-address-strip .coleteonline-address-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #50575e;
  margin: 0;
}

.coleteonline-address-strip .coleteonline-change-address {
  font-size: 12px;
  margin: 0;
  color: #1d4ed8;
  text-decoration: none;
  white-space: nowrap;
}
.coleteonline-address-strip .coleteonline-change-address:hover {
  color: #1e40af;
  text-decoration: underline;
}

.coleteonline-address-strip .address-table,
.coleteonline-address-strip .coleteonline-address-table {
  font-size: 13px;
  line-height: 1.5;
}

/* Address card field styling — name bold, phone/email accent, extras muted */
.coleteonline-address-name-company {
  font-weight: 600;
}
.coleteonline-address-phone {
  color: #1d4ed8;
}
.coleteonline-address-other-data {
  font-size: 12px;
  color: #787c82;
  margin-top: 2px;
}

/* Options card — 2-col grid (narrow 3rd column), 4-col when full-width */
.coleteonline-options-card .table {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  width: 100%;
}
.coleteonline-options-card .table tbody {
  display: contents;
}
.coleteonline-options-card .table tr {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.coleteonline-options-card .table td {
  display: block;
  padding: 0;
  font-size: 13px;
}
.coleteonline-options-card .table td:last-child {
  display: flex;
  align-items: center;
  gap: 4px;
}
.coleteonline-options-card .table label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #50575e;
  white-space: nowrap;
}
.coleteonline-options-card .table label .help-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid #c3c4c7;
  background: transparent;
  color: #787c82;
  font-size: 10px;
  cursor: help;
  margin-left: 4px;
  vertical-align: middle;
  flex-shrink: 0;
}
.coleteonline-options-card .table label .help-box::after {
  content: "i";
  font-weight: 600;
  font-style: italic;
  font-size: 9px;
  line-height: 1;
}
.coleteonline-options-card .table input[type="text"],
.coleteonline-options-card .table select {
  flex: 1;
  min-width: 0;
  max-width: none;
  box-sizing: border-box;
  height: 30px;
}
/* "Deschidere la livrare" row — full-width, row layout */
.coleteonline-options-card .table tr:nth-child(3) {
  order: 10;
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed #dcdcde;
}
.coleteonline-options-card .table tr:nth-child(3) td:first-child {
  order: 2;
}
.coleteonline-options-card .table tr:nth-child(3) td:last-child {
  order: 1;
}
.coleteonline-options-card .table tr:nth-child(3) label {
  text-transform: none;
  font-weight: normal;
  font-size: 13px;
  letter-spacing: normal;
  color: inherit;
}
.coleteonline-options-card .table tr:nth-child(4) {
  order: 3;
}
.coleteonline-options-card .table tr:nth-child(5) {
  order: 4;
}

/* ── 3. Packages section ───────────────────────────────────────────── */
.coleteonline-packages-section {
  padding: 16px;
  border-bottom: 1px solid #dcdcde;
  background: #fff;
}

.coleteonline-packages-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.coleteonline-packages-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.coleteonline-packages-actions {
  display: flex;
  gap: 8px;
}

.coleteonline-packages-table thead {
  display: none;
}

/* Package card (one tbody per package) */
.coleteonline-package-card {
  border: 1px solid #dcdcde;
  border-radius: 6px;
  display: table-row-group;
}

.coleteonline-packages-table {
  border-collapse: separate;
  border-spacing: 0 10px;
}

.coleteonline-package-card-header td {
  padding: 0;
  border: none;
}

.coleteonline-pkg-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f6f7f7;
  border-bottom: 1px solid #dcdcde;
  border-radius: 6px 6px 0 0;
}

.coleteonline-pkg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: #1d4ed8;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

.coleteonline-pkg-count {
  font-size: 12px;
  color: #787c82;
}

.coleteonline-pkg-head-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}

.coleteonline-pkg-head-actions .coleteonline-remove-package {
  padding: 4px 6px;
  line-height: 1;
  color: #787c82;
  background: transparent;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  cursor: pointer;
}

.coleteonline-pkg-head-actions .coleteonline-remove-package:hover {
  color: #b32d2e;
  border-color: #b32d2e;
}

.coleteonline-package-col-labels td {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #787c82;
  padding: 6px 10px 4px;
  border-bottom: 1px solid #f0f0f1;
}

.coleteonline-package-card .product-row td {
  padding: 8px 10px;
  vertical-align: middle;
  border-bottom: 1px solid #f0f0f1;
}

.coleteonline-package-card .product-row .coleteonline-thumb {
  width: 36px;
}

.coleteonline-package-card .product-row .coleteonline-thumb img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
}

.coleteonline-package-card .product-row .coleteonline-remove-item {
  padding: 4px 6px;
  line-height: 1;
  color: #787c82;
  background: transparent;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  cursor: pointer;
}

.coleteonline-package-card .product-row .coleteonline-remove-item:hover {
  color: #b32d2e;
  border-color: #b32d2e;
}

.coleteonline-package-card .total-row td {
  padding: 8px 10px;
  background: #f0f6fc;
  font-size: 13px;
}

.coleteonline-package-card .total-row:last-child td:first-child {
  border-radius: 0 0 0 6px;
}
.coleteonline-package-card .total-row:last-child td:last-child {
  border-radius: 0 0 6px 0;
}

.coleteonline-total-label {
  font-weight: 400;
  font-size: 12px;
  color: #787c82;
}

.coleteonline-package-card input[type="text"] {
  width: 50px;
  height: 28px;
  padding: 2px 6px;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  font-size: 13px;
  text-align: center;
}

.coleteonline-package-card .coleteonline-package-select {
  text-align: center;
  white-space: nowrap;
}

.coleteonline-package-card .coleteonline-package-select select {
  width: 58px;
  min-width: 58px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid #dcdcde;
  /* leave room on the right for the WP dropdown arrow; value sits left as in a
     standard select (centering it left the digit floating off-balance) */
  padding: 0 20px 0 8px;
  font-size: 13px;
}

/* COLET column header centered over the select */
.coleteonline-package-col-labels .coleteonline-col-label-package {
  text-align: center;
}

/* ── 4. Services section ───────────────────────────────────────────── */
.coleteonline-services-section {
  padding: 16px;
  background: #fafbfc;
}

.coleteonline-services-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.coleteonline-services-head .coleteonline-courier-list-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

/* Filter chips */
.coleteonline-service-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.coleteonline-service-filters:empty {
  display: none;
}

.coleteonline-service-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  font-size: 12px;
  background: #fff;
  border: 1px solid #c3c4c7;
  border-radius: 13px;
  color: #50575e;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.coleteonline-service-filter-chip:hover {
  border-color: #666;
  color: #1d2327;
}

.coleteonline-service-filter-chip.active {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
}

.coleteonline-service-filter-chip .chip-count {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.7;
}

/* Courier mark avatar */
.coleteonline-courier-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
  text-transform: uppercase;
  background: #787c82;
}
.coleteonline-courier-mark[data-courier*="fan"]   { background: #2563eb; }
.coleteonline-courier-mark[data-courier*="sameday"] { background: #dc2626; }
.coleteonline-courier-mark[data-courier*="cargus"]  { background: #d97706; }
.coleteonline-courier-mark[data-courier*="dpd"]     { background: #dc2626; }
.coleteonline-courier-mark[data-courier*="gls"]     { background: #f59e0b; }
.coleteonline-courier-mark[data-courier*="urgent"]  { background: #059669; }
.coleteonline-courier-mark[data-courier*="posta"]   { background: #7c3aed; }
.coleteonline-courier-mark[data-courier*="nemo"]    { background: #0891b2; }
.coleteonline-courier-mark[data-courier*="innoship"] { background: #4f46e5; }

/* Logo mode: neutral chip with the real logo contained inside (no colored letter). */
.coleteonline-courier-mark--logo {
  background: #fff;
  border: 1px solid #e2e4e7;
  padding: 1px;
}
.coleteonline-courier-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Shipped state — service name label */
.coleteonline-shipped-service-name {
  color: #50575e;
  font-size: 12px;
  margin-left: 4px;
}

/* Service section group headers */
.coleteonline-couriers-offers tr.bg-gray-100 td {
  padding: 10px 14px;
  font-weight: 600;
  font-size: 13px;
  color: #1d2327;
  background: #fbfbfc;
  border-top: 1px solid #dcdcde;
}

.coleteonline-couriers-offers tr.bg-gray-100:first-child td {
  border-top: none;
}

/* Service section headers */
.coleteonline-section-header-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  flex-wrap: wrap;
  min-height: 36px;
}

.coleteonline-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: #50575e;
  flex-shrink: 0;
  margin-top: 1px;
}

.coleteonline-section-header-cell strong {
  white-space: nowrap;
}

.coleteonline-section-desc {
  font-weight: 400;
  font-size: 12px;
  color: #787c82;
}

.coleteonline-section-map-btn {
  margin-left: auto;
  flex-shrink: 0;
}

.coleteonline-section-map-btn .coleteonline-open-point-picker-admin {
  font-size: 12px;
  padding: 5px 12px;
  height: auto;
}

/* Service row main cell — radio + courier logo + name on one line.
   The radio lives in the same cell as the courier it selects (a <td> with
   display:flex breaks the table column model, and a separate radio column
   absorbs the colspan-2 excess). This cell takes all leftover width so the
   price column shrinks to its content. */
.coleteonline-service-main-cell {
  width: 100%;
  vertical-align: middle;
  white-space: nowrap;
}

.coleteonline-service-main-cell input[type="radio"] {
  margin: 0 10px 0 2px;
  vertical-align: middle;
}

.coleteonline-service-main-cell .coleteonline-courier-mark {
  margin-right: 8px;
  vertical-align: middle;
}

.coleteonline-service-main-cell strong {
  vertical-align: middle;
}

/* Locker dropdown labels */
.coleteonline-locker-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #50575e;
  margin-bottom: 6px;
  margin-top: 10px;
}

.coleteonline-locker-label svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Service count in heading */
.coleteonline-services-count {
  font-weight: 400;
  color: #787c82;
}

/* Fixed layout so long locker-dropdown options can't widen the table past
   its container (otherwise the price column gets pushed off-screen). */
.coleteonline-couriers-offers {
  width: 100%;
  table-layout: fixed;
}
.coleteonline-couriers-offers col.coleteonline-col-price {
  width: 110px;
}
.coleteonline-couriers-offers select,
.coleteonline-couriers-offers .full-width {
  max-width: 100%;
  box-sizing: border-box;
}
/* truncate over-long courier names rather than overflow */
.coleteonline-service-main-cell {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Service rows */
.coleteonline-couriers-offers tbody tr {
  transition: background 0.1s;
}

.coleteonline-couriers-offers tbody tr:not(.bg-gray-100) {
  border-top: 1px solid #f0f0f1;
}

/* Locker-select continuation rows belong to the courier row above them — no internal
   border and no top gap, so the courier + its locker read as one block (block
   separators stay on each block's first/courier row). */
.coleteonline-couriers-offers tbody tr.coleteonline-offer-cont {
  border-top: none;
}

.coleteonline-couriers-offers tbody tr.coleteonline-offer-cont td {
  padding-top: 0;
}

.coleteonline-couriers-offers tbody tr.coleteonline-offer-cont .coleteonline-locker-label {
  margin-top: 8px;
}

/* Collapsing the table removed the default 2px border-spacing that used to separate
   every row. Give each courier (block-starting) row a touch of top padding back so
   distinct services breathe like before — without re-introducing a white line. */
.coleteonline-couriers-offers tbody tr[data-service-id]:not(.coleteonline-offer-cont) > td {
  padding-top: 6px;
}

.coleteonline-couriers-offers tbody tr:not(.bg-gray-100):hover {
  background: #f6f7f7;
}

.coleteonline-couriers-offers tbody tr.coleteonline-offer-alt:hover {
  background: #e2e5ea;
}

.coleteonline-couriers-offers tbody tr.coleteonline-service-selected {
  background: #f0f6fc;
  box-shadow: inset 3px 0 0 #1d4ed8;
}

/* Service row price — 2-line layout */
.coleteonline-service-price-cell {
  text-align: right;
  white-space: nowrap;
  width: 1%;
}
.coleteonline-service-price-cell .price-main {
  font-weight: 700;
  font-size: 13px;
  color: #1d2327;
}
.coleteonline-service-price-cell .price-novat {
  font-size: 10px;
  color: #787c82;
  margin-top: 2px;
}

/* ── 5. Footer bar ─────────────────────────────────────────────────── */
.coleteonline-order-footer {
  border-top: 1px solid #dcdcde;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  background: #fbfbfc;
  flex-wrap: wrap;
}

.coleteonline-footer-summary {
  flex: 1;
  font-size: 13px;
  color: #50575e;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.coleteonline-footer-summary:empty {
  display: none;
}

.coleteonline-footer-summary strong {
  color: #1d2327;
}

.coleteonline-footer-label {
  color: #787c82;
  font-size: 12px;
}

.coleteonline-footer-price {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 11px;
  background: #e7f0f7;
  color: #135e96;
  border: 1px solid #b8d4ea;
}

/* ── Balance indicator ─────────────────────────────────────────────── */
/* Sits as a full-width row above the summary + button inside the footer.
   Only the projected ("after this order") chip is coloured; the current
   balance chip stays neutral. */
.coleteonline-balance-indicator {
  flex: 1 1 100%;
  order: -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 12px;
  padding: 8px 10px;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  background: #fff;
}

/* The "current → after order" part, kept together so it wraps as a unit. */
.coleteonline-balance-line {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  flex: 1 1 auto;
  min-width: 0;
}

/* A label + its value chip, kept on the same line. */
.coleteonline-balance-pair {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.coleteonline-balance-label {
  color: #787c82;
}

.coleteonline-balance-current,
.coleteonline-balance-projected {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 12px;
  background: #f0f0f1;
  color: #1d2327;
  border: 1px solid #dcdcde;
}

.coleteonline-balance-arrow {
  color: #787c82;
  font-weight: 600;
}

.coleteonline-balance-topup {
  margin-left: auto;
  white-space: nowrap;
  font-weight: 600;
}

.coleteonline-balance-message {
  flex: 1 1 100%;
  margin-top: 2px;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 4px;
  border-left: 4px solid #dc3545;
  background: #fff5f5;
  color: #b32d2e;
}

.coleteonline-balance-message-topup {
  font-weight: 600;
  white-space: nowrap;
  color: #b32d2e;
  text-decoration: underline;
}

.coleteonline-balance-green .coleteonline-balance-projected {
  background: #edfaef;
  color: #00692c;
  border-color: #b8e6c1;
}

.coleteonline-balance-orange .coleteonline-balance-projected {
  background: #fff3e0;
  color: #c45500;
  border-color: #ffe0b2;
}

.coleteonline-balance-red .coleteonline-balance-projected {
  background: #fff5f5;
  color: #dc3545;
  border-color: #f1adad;
}

/* Testing-mode warning — full-width amber banner under the balance, shown by
   JS only when testing mode is active. */
.coleteonline-testing-warning {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1.4;
  padding: 8px 10px;
  border: 1px solid #f0c33c;
  border-left: 4px solid #dba617;
  border-radius: 4px;
  background: #fcf9e8;
  color: #674e00;
}

.coleteonline-testing-warning-icon {
  flex-shrink: 0;
  color: #b88a00;
}

/* ── 6. Shipped state ──────────────────────────────────────────────── */
.order.coleteonline-order-shipped {
  border-color: #c8e6c9;
}

.coleteonline-shipped-card {
  padding: 16px;
}

.coleteonline-shipped-meta {
  display: block;
  font-size: 12px;
  color: #50575e;
  font-weight: 400;
  margin-top: 2px;
}

.coleteonline-shipped-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  background: #f0f7e9;
  border: 1px solid #c8e0b3;
  border-radius: 4px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.coleteonline-shipped-summary-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.coleteonline-shipped-summary-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* AWB list */
.coleteonline-awb-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.coleteonline-awb-section-head .coleteonline-address-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #50575e;
  margin: 0;
}

.coleteonline-do-download-awb::before {
  content: "↓ ";
}

.coleteonline-download-error {
  color: #b32d2e;
  font-size: 12px;
  margin-left: 8px;
}

.coleteonline-awb-list {
  display: flex;
  flex-direction: column;
  border: 1px solid #dcdcde;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

.coleteonline-awb-row {
  display: grid;
  grid-template-columns: 32px minmax(0,1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-top: 1px solid #dcdcde;
}

.coleteonline-awb-row:first-child {
  border-top: none;
}

.coleteonline-awb-row-icon {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: #eff6ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1d4ed8;
  font-size: 14px;
}

.coleteonline-awb-id {
  font-size: 13px;
  font-weight: 600;
  color: #1d2327;
  letter-spacing: 0.02em;
}

.coleteonline-awb-meta {
  font-size: 11px;
  color: #787c82;
  margin-top: 3px;
}

.coleteonline-awb-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.coleteonline-format-label {
  font-size: 11px;
  color: #50575e;
  font-weight: 600;
  text-transform: uppercase;
}

.coleteonline-format-select {
  padding: 2px 6px;
  border: 1px solid #c3c4c7;
  border-radius: 3px;
  font-size: 12px;
  line-height: 1.4;
  background: #fff;
}

.coleteonline-shipped-footer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
}

/* Status badges */
.coleteonline-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}
.coleteonline-badge-green {
  background: #edfaef;
  color: #00692c;
  border: 1px solid #b8e6c1;
}
.coleteonline-badge-blue {
  background: #e7f0f7;
  color: #135e96;
  border: 1px solid #b8d4ea;
}

/* ── 7. Container query breakpoints ───────────────────────────────── */
@container metabox (max-width: 1100px) {
  .coleteonline-address-strip {
    grid-template-columns: 1fr 1fr;
  }
  .coleteonline-address-strip > .coleteonline-options-card {
    grid-column: 1 / -1;
  }
  .coleteonline-options-card .table {
    grid-template-columns: repeat(4, 1fr);
  }
  .coleteonline-options-card .table tr:nth-child(3) {
    grid-column: 1 / -1;
  }
}

@container metabox (max-width: 860px) {
  .coleteonline-address-strip {
    grid-template-columns: 1fr;
  }
  .coleteonline-address-strip > .coleteonline-options-card {
    grid-column: auto;
  }
  .coleteonline-options-card .table {
    grid-template-columns: 1fr 1fr;
  }
}

@container metabox (max-width: 640px) {
  .coleteonline-packages-section {
    padding: 10px;
  }
  .coleteonline-services-section {
    padding: 10px;
  }
  .coleteonline-packages-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .coleteonline-services-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .coleteonline-packages-section .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -10px;
    padding: 0 10px;
  }
  .coleteonline-couriers-offers td {
    padding: 6px 8px;
  }
  .coleteonline-service-price-cell {
    font-size: 12px;
  }
  .coleteonline-service-price-cell .price-main {
    font-size: 12px;
  }
  /* Mobile package card layout — explicit grid, no overlap */
  .coleteonline-package-card .product-row {
    display: grid;
    grid-template-columns: 36px 1fr 1fr 1fr;
    gap: 8px 10px;
    padding: 10px;
    border-bottom: 1px solid #f0f0f1;
    align-items: center;
  }
  .coleteonline-package-card .product-row td {
    display: block;
    padding: 0;
    border: none;
    text-align: left;
    white-space: normal;
  }
  .coleteonline-package-card .product-row .coleteonline-thumb {
    grid-row: 1;
    grid-column: 1;
    width: 36px;
  }
  .coleteonline-package-card .product-row .coleteonline-product-name {
    grid-row: 1;
    grid-column: 2 / 4;
    min-width: 0;
    max-width: none;
    overflow: visible;
  }
  /* package selector on its own row, with an inline label (the column
     header is hidden on mobile) */
  .coleteonline-package-card .product-row .coleteonline-package-select {
    display: block;
    grid-row: 2;
    grid-column: 1 / 5;
  }
  .coleteonline-package-card .product-row .coleteonline-package-select::before {
    content: "Colet ";
    font-size: 10px;
    font-weight: 600;
    color: #787c82;
    text-transform: uppercase;
    margin-right: 4px;
  }
  /* remove-item button (last cell) sits top-right */
  .coleteonline-package-card .product-row > td:last-child {
    grid-row: 1;
    grid-column: 4;
    justify-self: end;
  }
  /* dimensions on row 3/4 as labelled chips */
  .coleteonline-package-card .product-row .coleteonline-package-weight,
  .coleteonline-package-card .product-row .coleteonline-package-dimensions {
    grid-row: 3;
    font-size: 12px;
    color: #50575e;
    white-space: nowrap;
  }
  .coleteonline-package-card .product-row .coleteonline-package-weight { grid-column: 1 / 3; }
  .coleteonline-package-card .product-row .coleteonline-package-dimensions.width { grid-column: 3; }
  .coleteonline-package-card .product-row .coleteonline-package-dimensions.length { grid-column: 4; }
  .coleteonline-package-card .product-row .coleteonline-package-dimensions.height { grid-row: 4; grid-column: 1 / 3; }
  .coleteonline-package-card .product-row .coleteonline-package-weight::before { content: "GREUTATE "; font-size: 10px; font-weight: 600; color: #787c82; text-transform: uppercase; }
  .coleteonline-package-card .product-row .coleteonline-package-dimensions.width::before { content: "L "; font-size: 10px; font-weight: 600; color: #787c82; }
  .coleteonline-package-card .product-row .coleteonline-package-dimensions.length::before { content: "l "; font-size: 10px; font-weight: 600; color: #787c82; }
  .coleteonline-package-card .product-row .coleteonline-package-dimensions.height::before { content: "î "; font-size: 10px; font-weight: 600; color: #787c82; }
  .coleteonline-package-col-labels {
    display: none;
  }
  /* Mobile total row */
  .coleteonline-package-card .total-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 10px;
  }
  .coleteonline-package-card .total-row td {
    display: block;
    padding: 0;
    border: none;
  }
  .coleteonline-package-card .total-row td:first-child {
    width: 100%;
    margin-bottom: 4px;
  }
  .coleteonline-package-card .total-row td::before { font-size: 10px; font-weight: 600; color: #787c82; text-transform: uppercase; display: block; }
  .coleteonline-package-card .total-row td:nth-child(2)::before { content: "GREUTATE"; }
  .coleteonline-package-card .total-row td:nth-child(3)::before { content: "L"; }
  .coleteonline-package-card .total-row td:nth-child(4)::before { content: "l"; }
  .coleteonline-package-card .total-row td:nth-child(5)::before { content: "î"; }
  .coleteonline-package-card .total-row td:last-child:empty { display: none; }
  /* Mobile service rows — allow courier name to wrap, keep price at right */
  .coleteonline-service-main-cell {
    white-space: normal;
  }
  .coleteonline-service-price-cell .price-novat {
    font-size: 9px;
  }
}

@container metabox (max-width: 460px) {
  .coleteonline-address-strip {
    padding: 10px;
    gap: 10px;
  }
  .coleteonline-options-card .table {
    grid-template-columns: 1fr;
  }
  .coleteonline-options-card .table tr:nth-child(3) {
    grid-column: auto;
  }
  .coleteonline-order-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .coleteonline-balance-indicator {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .coleteonline-balance-line {
    justify-content: center;
  }
  /* Pairs stack vertically on mobile, so the horizontal arrow between them
     reads as orphaned — the labels already convey the relationship. */
  .coleteonline-balance-arrow {
    display: none !important;
  }
  .coleteonline-balance-topup {
    margin-left: 0;
    align-self: center;
  }
  .coleteonline-awb-row {
    grid-template-columns: 32px 1fr;
    gap: 8px;
  }
  .coleteonline-awb-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .coleteonline-shipped-summary {
    flex-direction: column;
    align-items: flex-start;
  }
  .coleteonline-footer-summary {
    justify-content: center;
  }
  .coleteonline-order-footer .btn,
  .coleteonline-order-footer .button {
    width: 100%;
    text-align: center;
  }
}

/* ── 8. @supports fallback ────────────────────────────────────────── */
@supports not (container-type: inline-size) {
  @media (max-width: 1200px) {
    .coleteonline-address-strip {
      grid-template-columns: 1fr 1fr;
    }
    .coleteonline-address-strip > .coleteonline-options-card {
      grid-column: 1 / -1;
    }
    .coleteonline-options-card .table {
      grid-template-columns: repeat(4, 1fr);
    }
  }
  @media (max-width: 900px) {
    .coleteonline-address-strip {
      grid-template-columns: 1fr;
    }
    .coleteonline-address-strip > .coleteonline-options-card {
      grid-column: auto;
    }
    .coleteonline-options-card .table {
      grid-template-columns: 1fr 1fr;
    }
  }
  @media (max-width: 640px) {
    .coleteonline-packages-section { padding: 10px; }
    .coleteonline-services-section { padding: 10px; }
  }
  @media (max-width: 460px) {
    .coleteonline-options-card .table {
      grid-template-columns: 1fr;
    }
    .coleteonline-options-card .table tr:nth-child(3) {
      grid-column: auto;
    }
  }
}
