/*
 * GeSmart - Order Detail UI
 * Layout compatto dettaglio ordine cliente
 */

/* GeSmart Order Header UI v4 */

.gs-order-summary {
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid #e5e7e9;
  border-radius: 5px;
  background: #fff;
}

.gs-order-summary__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gs-order-summary__identity {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}

.gs-order-summary__eyebrow {
  font-size: 10px;
  font-weight: 700;
  color: #777;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.gs-order-summary__reference {
  font-size: 16px;
  color: #222;
}

.gs-order-summary__date {
  font-size: 12px;
  color: #666;
}

.gs-order-summary__reorder {
  white-space: nowrap;
}

.gs-order-summary__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid #eee;
}

.gs-order-summary__meta-item {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 12px;
}

.gs-order-summary__meta-label {
  color: #777;
  font-weight: 600;
}

.gs-order-summary__meta-item--link a {
  font-size: 12px;
}

.gs-order-summary__notes {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid #eee;
  font-size: 11px;
  color: #666;
}


/* Stato ordine */

.gs-order-history {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 8px;
  padding: 7px 12px;
  border: 1px solid #e5e7e9;
  border-radius: 5px;
  background: #fafafa;
}

.gs-order-history__current {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gs-order-history__label {
  font-size: 11px;
  font-weight: 700;
  color: #555;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.gs-order-history__current-state {
  margin: 0;
}

.gs-order-history__details {
  position: relative;
  font-size: 12px;
}

.gs-order-history__details summary {
  cursor: pointer;
  color: #555;
  font-weight: 600;
  user-select: none;
}

.gs-order-history__details[open] {
  width: 100%;
}

.gs-order-history__list {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid #e4e4e4;
}

.gs-order-history__line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 3px 0;
}

.gs-order-history__date {
  width: 95px;
  font-size: 11px;
  color: #777;
}


/* Tracking */

.gs-order-follow-up {
  margin-bottom: 8px;
  padding: 6px 10px;
  border: 1px solid #d9e9f3;
  border-radius: 4px;
  background: #f5fbff;
  font-size: 12px;
}


/* Indirizzi */

.gs-order-addresses {
  display: flex;
  margin: 0 -5px 9px;
}

.gs-order-addresses > div {
  padding-left: 5px;
  padding-right: 5px;
}

.gs-order-address-card {
  height: 100%;
  padding: 8px 10px;
  border: 1px solid #e5e7e9;
  border-radius: 5px;
  background: #fff;
}

.gs-order-address-card h4 {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
}

.gs-order-address-card address {
  margin: 0;
  font-size: 12px;
  line-height: 1.25;
}


/* Mobile */

@media (max-width: 767px) {

  .gs-order-summary__top,
  .gs-order-history {
    align-items: flex-start;
  }

  .gs-order-summary__meta {
    display: block;
  }

  .gs-order-summary__meta-item {
    margin-top: 4px;
  }

  .gs-order-addresses {
    display: block;
    margin-left: 0;
    margin-right: 0;
  }

  .gs-order-addresses > div {
    padding: 0;
    margin-bottom: 7px;
  }

}


/* Stampa */

@media print {

  .gs-order-summary,
  .gs-order-history,
  .gs-order-address-card {
    padding: 5px 7px !important;
  }

  .gs-order-summary__actions,
  .gs-order-history__details,
  .gs-order-follow-up {
    display: none !important;
  }

  .gs-order-summary__meta {
    margin-top: 4px;
    padding-top: 4px;
  }

  .gs-order-address-card address {
    font-size: 10px;
    line-height: 1.15;
  }

  .gs-order-address-card h4 {
    font-size: 10px;
  }

  .gs-order-addresses {
    margin-bottom: 5px;
  }

}

/* ============================================================
   GESMARTSYNCORDER 1.0.63 - LOGISTICA ORDINI
   CSS comune: storico, dettaglio, documenti e gestione ordine
   ============================================================ */

/* ============================================================
   GeSmart - stati logistici ordine Front Office
   ============================================================ */

/* Riga ordine: merce appartata */
.gs-order-fulfillment--committed .gs-order-fulfillment__status {
  color: #8a5a00;
  background: #fff4cc;
}

/* Riga ordine: parte appartata, parte ancora residua */
.gs-order-fulfillment--committed_partial .gs-order-fulfillment__status {
  color: #8a5a00;
  background: #fff4cc;
}

/* Stato non attribuibile con certezza */
.gs-order-fulfillment--ambiguous .gs-order-fulfillment__status {
  color: #4f5b66;
  background: #edf1f4;
}

/* Badge stato logistico nello storico ordini */
.gs-history-logistics-badge {
  border: 1px solid transparent;
  font-weight: 600;
}

.gs-history-logistics-badge--pending {
  color: #60656b !important;
  background: #eef0f2 !important;
  border-color: #d8dde1 !important;
}

.gs-history-logistics-badge--committed,
.gs-history-logistics-badge--committed_partial {
  color: #8a5a00 !important;
  background: #fff4cc !important;
  border-color: #e8c96a !important;
}

.gs-history-logistics-badge--partial {
  color: #8a4b00 !important;
  background: #fff0d7 !important;
  border-color: #f0d5a5 !important;
}

.gs-history-logistics-badge--fulfilled {
  color: #ffffff !important;
  background: #3f8f3d !important;
  border-color: #3f8f3d !important;
}

.gs-history-logistics-badge--ambiguous {
  color: #4f5b66 !important;
  background: #edf1f4 !important;
  border-color: #ccd4da !important;
}

/* Stato riga nella vista "Prodotti da evadere" */
.gs-history-product-status {
  font-weight: 600;
}

.gs-history-product-status--pending {
  color: #60656b;
}

.gs-history-product-status--committed,
.gs-history-product-status--committed_partial {
  color: #8a5a00;
}

.gs-history-product-status--partial {
  color: #8a4b00;
}

.gs-history-product-status--fulfilled {
  color: #216e39;
}

.gs-history-product-status--ambiguous {
  color: #4f5b66;
}

/* GeSmart History - contrasto testo badge logistici
   Specificità maggiore delle regole generiche .label/.label-pill. */

.label.label-pill.gs-history-logistics-badge--pending {
  color: #60656b !important;
}

.label.label-pill.gs-history-logistics-badge--committed,
.label.label-pill.gs-history-logistics-badge--committed_partial {
  color: #8a5a00 !important;
}

.label.label-pill.gs-history-logistics-badge--partial {
  color: #8a4b00 !important;
}

.label.label-pill.gs-history-logistics-badge--fulfilled {
  color: #ffffff !important;
}

.label.label-pill.gs-history-logistics-badge--ambiguous {
  color: #4f5b66 !important;
}

/* Protegge anche eventuali elementi interni futuri al badge. */
.label.label-pill.gs-history-logistics-badge--pending *,
.label.label-pill.gs-history-logistics-badge--committed *,
.label.label-pill.gs-history-logistics-badge--committed_partial *,
.label.label-pill.gs-history-logistics-badge--partial *,
.label.label-pill.gs-history-logistics-badge--ambiguous * {
  color: inherit !important;
}

/* ============================================================
   GeSmart - completamento stati logistici ordine
   ============================================================ */

/* Stato singola riga: merce appartata */
.gs-order-status-badge--committed,
.gs-order-status-badge--committed_partial {
  color: #8a5a00 !important;
  background: #fff4cc !important;
  border: 1px solid #e8c96a;
}

/* Stato singola riga: attribuzione non certa */
.gs-order-status-badge--ambiguous {
  color: #4f5b66 !important;
  background: #edf1f4 !important;
  border: 1px solid #ccd4da;
}

/* Badge logistico nell'header del dettaglio ordine */
.gs-order-detail-logistics-badge {
  border: 1px solid transparent;
  font-weight: 600;
}

.gs-order-detail-logistics-badge--pending {
  color: #60656b !important;
  background: #eef0f2 !important;
  border-color: #d8dde1 !important;
}

.gs-order-detail-logistics-badge--committed,
.gs-order-detail-logistics-badge--committed_partial {
  color: #8a5a00 !important;
  background: #fff4cc !important;
  border-color: #e8c96a !important;
}

.gs-order-detail-logistics-badge--partial {
  color: #8a4b00 !important;
  background: #fff0d7 !important;
  border-color: #f0d5a5 !important;
}

.gs-order-detail-logistics-badge--fulfilled {
  color: #ffffff !important;
  background: #3f8f3d !important;
  border-color: #3f8f3d !important;
}

.gs-order-detail-logistics-badge--ambiguous {
  color: #4f5b66 !important;
  background: #edf1f4 !important;
  border-color: #ccd4da !important;
}


/* GeSmart Order Detail - contrasto badge logistico.
   Specificità superiore alle regole generiche di .gs-order-history. */

.gs-order-history .label.gs-order-detail-logistics-badge--pending {
  color: #60656b !important;
}

.gs-order-history .label.gs-order-detail-logistics-badge--committed,
.gs-order-history .label.gs-order-detail-logistics-badge--committed_partial {
  color: #8a5a00 !important;
}

.gs-order-history .label.gs-order-detail-logistics-badge--partial {
  color: #8a4b00 !important;
}

.gs-order-history .label.gs-order-detail-logistics-badge--fulfilled {
  color: #ffffff !important;
}

.gs-order-history .label.gs-order-detail-logistics-badge--ambiguous {
  color: #4f5b66 !important;
}

/* ============================================================
   GeSmart - override finali contrasto badge logistici
   Necessari per superare le vecchie regole globali con !important.
   ============================================================ */

/* ------------------------------------------------------------
   STORICO ORDINI
   Supera body#history table .label/.label-pill
   ------------------------------------------------------------ */

body#history table .label.label-pill.gs-history-logistics-badge--pending {
  color: #60656b !important;
}

body#history table .label.label-pill.gs-history-logistics-badge--committed,
body#history table .label.label-pill.gs-history-logistics-badge--committed_partial {
  color: #8a5a00 !important;
}

body#history table .label.label-pill.gs-history-logistics-badge--partial {
  color: #8a4b00 !important;
}

body#history table .label.label-pill.gs-history-logistics-badge--fulfilled {
  color: #ffffff !important;
}

body#history table .label.label-pill.gs-history-logistics-badge--ambiguous {
  color: #4f5b66 !important;
}

/* Eventuali elementi interni al badge history */
body#history table .label.label-pill.gs-history-logistics-badge--pending *,
body#history table .label.label-pill.gs-history-logistics-badge--committed *,
body#history table .label.label-pill.gs-history-logistics-badge--committed_partial *,
body#history table .label.label-pill.gs-history-logistics-badge--partial *,
body#history table .label.label-pill.gs-history-logistics-badge--ambiguous * {
  color: inherit !important;
}

/* ------------------------------------------------------------
   DETTAGLIO ORDINE - BADGE RIGA PRODOTTO
   Supera .gs-order-products-table .gs-order-status-badge
   ------------------------------------------------------------ */

.gs-order-products-table .gs-order-status-badge--pending {
  color: #60656b !important;
  background: #eef0f2 !important;
}

.gs-order-products-table .gs-order-status-badge--committed,
.gs-order-products-table .gs-order-status-badge--committed_partial {
  color: #8a5a00 !important;
  background: #fff4cc !important;
  border-color: #e8c96a !important;
}

.gs-order-products-table .gs-order-status-badge--partial {
  color: #8a4b00 !important;
  background: #fff0d7 !important;
}

.gs-order-products-table .gs-order-status-badge--fulfilled {
  color: #ffffff !important;
  background: #3f8f3d !important;
}

.gs-order-products-table .gs-order-status-badge--ambiguous {
  color: #4f5b66 !important;
  background: #edf1f4 !important;
  border-color: #ccd4da !important;
}

/* Eventuali elementi interni al badge riga */
.gs-order-products-table .gs-order-status-badge--pending *,
.gs-order-products-table .gs-order-status-badge--committed *,
.gs-order-products-table .gs-order-status-badge--committed_partial *,
.gs-order-products-table .gs-order-status-badge--partial *,
.gs-order-products-table .gs-order-status-badge--ambiguous * {
  color: inherit !important;
}

/* ============================================================
   GeSmart - documenti collegati ordine
   ============================================================ */

.gs-order-documents {
  margin: 0 15px 1.5rem 15px;
  padding: 14px 16px;
  border: 1px solid #e1e5e9;
  border-radius: 7px;
  background: #fff;
}

.gs-order-documents__title {
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #555d65;
  text-transform: uppercase;
  letter-spacing: .035em;
}

.gs-order-documents__groups {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.gs-order-documents__group {
  flex: 1 1 300px;
  min-width: 0;
}

.gs-order-documents__trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid #d9dee3;
  border-radius: 6px;
  background: #f7f8f9;
  color: #343a40;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.gs-order-documents__trigger::-webkit-details-marker {
  display: none;
}

.gs-order-documents__trigger::marker {
  display: none;
  content: '';
}

.gs-order-documents__trigger:hover {
  background: #f0f3f5;
  border-color: #cbd2d8;
}

.gs-order-documents__icon {
  font-size: 18px;
  color: #59636c;
}

.gs-order-documents__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 999px;
  background: #e9ecef;
  color: #495057;
  font-size: 11px;
  font-weight: 700;
}

.gs-order-documents__group[open] .gs-order-documents__trigger {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.gs-order-documents__list {
  border: 1px solid #d9dee3;
  border-top: 0;
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  overflow: hidden;
}

.gs-order-documents__row {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 9px 11px;
  background: #fff;
  border-top: 1px solid #edf0f2;
}

.gs-order-documents__row:first-child {
  border-top: 0;
}

.gs-order-documents__document-main {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px;
}

.gs-order-documents__type {
  color: #59636c;
  font-size: 12px;
}

.gs-order-documents__number {
  color: #232323;
  font-size: 13px;
}

.gs-order-documents__date {
  color: #6c757d;
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}

@media (max-width: 767px) {
  .gs-order-documents {
    padding: 12px;
  }

  .gs-order-documents__groups {
    display: block;
  }

  .gs-order-documents__group + .gs-order-documents__group {
    margin-top: 8px;
  }

  .gs-order-documents__row {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}

/* ============================================================
   GESMART - MODIFICHE MANUALI RIGHE ORDINE
   ============================================================ */

.gs-order-products-table .gs-order-status-badge--cancelled {
  color: #a12a23 !important;
  background: #fde9e7 !important;
  border-color: #efbbb6 !important;
}

.gs-order-products-table .gs-order-status-badge--modified {
  color: #795600 !important;
  background: #fff4cc !important;
  border-color: #e8c96a !important;
  margin-left: 4px;
}

.gs-order-products-table .gs-order-status-badge--cancelled *,
.gs-order-products-table .gs-order-status-badge--modified * {
  color: inherit !important;
}

.gs-order-management-changes {
  margin: 0 15px 1.5rem 15px;
  padding: 14px 16px;
  border: 1px solid #e1e5e9;
  border-radius: 7px;
  background: #fff;
}

.gs-order-management-changes__title {
  margin-bottom: 10px;
  color: #555d65;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.gs-order-management-changes__list {
  overflow: hidden;
  border: 1px solid #e5e8eb;
  border-radius: 6px;
}

.gs-order-management-changes__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 12px;
  border-top: 1px solid #edf0f2;
  background: #fff;
}

.gs-order-management-changes__row:first-child {
  border-top: 0;
}

.gs-order-management-changes__main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gs-order-management-changes__reference {
  color: #232323;
  font-size: 13px;
}

.gs-order-management-changes__description {
  color: #626a72;
  font-size: 12px;
  line-height: 1.35;
}

.gs-order-management-changes__meta {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.gs-order-management-changes__quantity {
  color: #4f575e;
  font-size: 12px;
  white-space: nowrap;
}

.gs-order-management-changes__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 0 9px;
  border: 1px solid #e8c96a;
  border-radius: 999px;
  background: #fff4cc;
  color: #795600;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 767px) {

  .gs-order-management-changes {
    padding: 12px;
  }

  .gs-order-management-changes__row {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .gs-order-management-changes__meta {
    width: 100%;
    flex-wrap: wrap;
  }

  .gs-order-products-table .gs-order-status-badge--modified {
    margin-left: 0;
  }
}

/* ============================================================
   GESMART 1.0.51 - MODIFICHE PRIMA DEI TOTALI
   ============================================================ */

.gs-order-products-table
.gs-order-management-changes-row > td {
  padding: 12px !important;
  text-align: left !important;
  background: #fff;
}

.gs-order-products-table
.gs-order-management-changes-row
.gs-order-management-changes {
  margin: 0;
}

.gs-order-management-changes--mobile {
  margin: 12px 0 16px 0;
}

@media print {

  body#order-detail
  .gs-order-management-changes-row > td {
    padding: 6px !important;
  }

  body#order-detail
  .gs-order-management-changes {
    margin: 0 !important;
  }
}

/* ============================================================
   GESMART 1.0.52 - RIGHE MODIFICHE COME PRODOTTI
   ============================================================ */

/*
 * Il contenitore identifica già chiaramente che si tratta di
 * modifiche effettuate durante la gestione.
 *
 * Le singole righe non hanno quindi badge aggiuntivi:
 * adottano la stessa gerarchia visiva delle righe ordine.
 */

.gs-order-management-changes__products {
  overflow: hidden;
  border-top: 1px solid #e1e5e9;
}

.gs-order-management-changes__product-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 7px 10px;
  border-top: 1px solid #edf0f2;
  background: #fff;
}

.gs-order-management-changes__product-row:first-child {
  border-top: 0;
}

.gs-order-management-changes__product {
  flex: 1 1 auto;
  min-width: 0;
}

.gs-order-management-changes__product-name {
  display: block;
  color: #232323;
  font-size: inherit;
  font-weight: 700;
  line-height: 1.25;
}

.gs-order-management-changes__product-quantity {
  flex: 0 0 95px;
  min-width: 95px;
  padding-left: 12px;
  text-align: center;
  white-space: nowrap;
  color: #232323;
  font-weight: 600;
}

.gs-order-management-changes__quantity-value {
  font-weight: 700;
}

.gs-order-management-changes__unit {
  margin-left: 2px;
  color: #6c757d;
  font-size: 12px;
  font-weight: 400;
}

/*
 * Neutralizza la vecchia presentazione a card/lista.
 * Le vecchie classi possono restare nel CSS per compatibilità,
 * ma non sono più usate dal markup 1.0.52.
 */
.gs-order-management-changes__products {
  border-right: 1px solid #e1e5e9;
  border-bottom: 1px solid #e1e5e9;
  border-left: 1px solid #e1e5e9;
  border-radius: 0 0 5px 5px;
}

.gs-order-management-changes__title {
  margin-bottom: 0;
  padding: 9px 10px;
  border: 1px solid #e1e5e9;
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  background: #f7f8f9;
}

/*
 * Essendo ora dentro la tabella ordine, eliminiamo il secondo
 * effetto "card dentro card".
 */
.gs-order-products-table
.gs-order-management-changes {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

/* Placeholder immagine con le stesse dimensioni delle righe ordine */
.gs-order-management-changes
.gs-order-product__thumb-placeholder {
  display: block;
}

/* Mobile */
@media (max-width: 767px) {

  .gs-order-management-changes--mobile {
    padding: 0;
    border: 0;
    background: transparent;
  }

  .gs-order-management-changes__product-row {
    min-height: 54px;
    padding: 7px 8px;
    gap: 8px;
  }

  .gs-order-management-changes__product-quantity {
    flex-basis: 65px;
    min-width: 65px;
    padding-left: 5px;
    text-align: right;
  }

}

/* Stampa */
@media print {

  body#order-detail
  .gs-order-management-changes__product-row {
    min-height: 0;
    padding: 4px 5px;
  }

  body#order-detail
  .gs-order-management-changes__product-name {
    font-size: 8.4pt !important;
  }

  body#order-detail
  .gs-order-management-changes__product-quantity {
    font-size: 8.4pt !important;
  }

}

/* ============================================================
   GESMART 1.0.53 - IMMAGINI RIGHE AGGIUNTE
   ============================================================ */

/*
 * Se il mapping GeSmart -> prodotto PrestaShop dispone di cover,
 * utilizziamo la stessa miniatura delle righe ordine.
 *
 * In assenza di cover non viene mostrato alcun placeholder.
 */

.gs-order-management-changes__product
.gs-order-product__thumb {
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  height: 44px;
}

.gs-order-management-changes__product
.gs-order-product__thumb img {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.gs-order-management-changes__product {
  gap: 9px;
}

/* Nessuno spazio artificiale quando l'immagine non esiste */
.gs-order-management-changes__product
.gs-order-product__content:first-child {
  margin-left: 0;
}

@media (max-width: 767px) {

  .gs-order-management-changes__product
  .gs-order-product__thumb {
    flex-basis: 40px;
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  .gs-order-management-changes__product
  .gs-order-product__thumb img {
    width: 40px;
    height: 40px;
  }

}

@media print {

  body#order-detail
  .gs-order-management-changes__product
  .gs-order-product__thumb {
    flex-basis: 34px !important;
    width: 34px !important;
    min-width: 34px !important;
    height: 34px !important;
  }

  body#order-detail
  .gs-order-management-changes__product
  .gs-order-product__thumb img {
    width: 34px !important;
    height: 34px !important;
  }

}

/* ============================================================
   GESMART 1.0.55 - ADDED ROWS COMPLETE
   ============================================================ */

/*
 * Le righe aggiunte in GeSmart ora utilizzano le stesse colonne
 * logistiche e di prezzo delle righe dell'ordine.
 */

.gs-order-management-changes-heading > td {
  padding: 0 !important;
  background: #f7f8f9;
}

.gs-order-management-changes-heading
.gs-order-management-changes__title {
  margin: 0;
  padding: 9px 10px;
  border: 0;
  border-radius: 0;
  background: #f7f8f9;
}

.gs-order-management-changes__table-row > td {
  vertical-align: middle !important;
}

.gs-order-management-changes__table-row
.gs-order-product {
  margin: 0;
}

.gs-order-management-changes__table-row
.gs-order-product__content {
  min-width: 0;
}

.gs-order-management-changes__table-row
.gs-order-product__reference {
  display: block;
  margin-top: 2px;
}

.gs-order-management-changes__return-spacer {
  min-width: 28px;
}

/* Mobile */

.gs-order-management-changes__mobile-item {
  padding: 10px 8px;
  border-right: 1px solid #e1e5e9;
  border-bottom: 1px solid #e1e5e9;
  border-left: 1px solid #e1e5e9;
  background: #fff;
}

.gs-order-management-changes__mobile-item:last-child {
  border-radius: 0 0 5px 5px;
}

.gs-order-management-changes__mobile-stats {
  margin-top: 8px;
}

.gs-order-management-changes__mobile-status {
  margin-top: 8px;
}

.gs-order-management-changes__mobile-prices {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid #edf0f2;
  font-size: 13px;
}

.gs-order-management-changes__mobile-prices span:last-child {
  text-align: right;
}

/* Stampa */

@media print {

  body#order-detail
  .gs-order-management-changes-heading
  > td {
    padding: 0 !important;
  }

  body#order-detail
  .gs-order-management-changes__table-row
  > td {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
  }

}

/* ============================================================
   GESMART 1.0.57 - ARCHIVED ORDER
   ============================================================ */

/*
 * Archiviato = ordine definitivamente chiuso senza implicare
 * che tutta la quantità sia stata realmente evasa.
 */

.gs-order-status-badge--archived {
  color: #fff !important;
  background: #6c757d !important;
  border-color: #6c757d !important;
}

.gs-order-detail-logistics-badge--archived {
  color: #fff !important;
  background: #6c757d !important;
  border-color: #6c757d !important;
}

.label.label-pill.gs-history-logistics-badge--archived {
  color: #fff !important;
  background: #6c757d !important;
  border-color: #6c757d !important;
}

/* ============================================================
   GESMART 1.0.62 - REGISTRO MODIFICHE GESTIONE
   ============================================================ */

.gs-order-management-change-kind {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin-top: 0;
  padding: 2px 8px;
  border: 1px solid #e8c96a;
  border-radius: 999px;
  background: #fff4cc;
  color: #795600;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
}

.gs-order-management-change-kind--quantity_decreased,
.gs-order-management-change-kind--product_removed {
  border-color: #efbbb6;
  background: #fde9e7;
  color: #a12a23;
}

.gs-order-management-change-flow {
  display: inline-flex;
  align-items: center;
  margin-top: 0;
  margin-left: 0;
  vertical-align: middle;
  color: #6c757d;
  font-size: 11px;
  line-height: 1.35;
}

.gs-order-management-change-flow strong {
  color: #4f575e;
  font-weight: 600;
}

/*
 * Descrizione su riga propria.
 * Codice + tipo modifica + quantità sulla riga successiva.
 */
.gs-order-management-changes__product
.gs-order-product__content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 8px;
  row-gap: 3px;
}

.gs-order-management-changes__product-name {
  flex: 0 0 100%;
  width: 100%;
}

.gs-order-management-changes__product
.gs-order-product__reference {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.gs-order-management-changes__product
.gs-order-management-change-kind,
.gs-order-management-changes__product
.gs-order-management-change-flow {
  align-self: center;
}

@media (max-width: 767px) {

  .gs-order-management-change-kind {
    white-space: normal;
  }

}

@media print {

  body#order-detail
  .gs-order-management-change-kind,
  body#order-detail
  .gs-order-management-change-flow {
    font-size: 8pt !important;
  }

}


/* ============================================================
   GESMART 1.0.62 - PRINT ORDER TABLE 8 COLONNE
   Bilanciamento A4 portrait dopo introduzione Appartata
   ============================================================ */

@media print {

  /*
   * Tabella ordine NO-RETURN:
   *
   * Prodotto    43%
   * Ordinata     5.5%
   * Appartata    5.5%
   * Evasa        5.5%
   * Residua      5.5%
   * Stato       15%
   * P. unit.    10%
   * P. totale   10%
   * ----------------
   * Totale     100%
   */

  body#order-detail
  .gs-order-products-table:not(.gs-order-products-table--return) {
    width: 100% !important;
    table-layout: fixed !important;
  }

  /* Prodotto */
  body#order-detail
  .gs-order-products-table:not(.gs-order-products-table--return)
  thead th:nth-child(1),

  body#order-detail
  .gs-order-products-table:not(.gs-order-products-table--return)
  .gs-order-products-table__product-cell {
    width: 43% !important;
  }

  /* Ordinata / Appartata / Evasa / Residua */
  body#order-detail
  .gs-order-products-table:not(.gs-order-products-table--return)
  thead th:nth-child(2),

  body#order-detail
  .gs-order-products-table:not(.gs-order-products-table--return)
  thead th:nth-child(3),

  body#order-detail
  .gs-order-products-table:not(.gs-order-products-table--return)
  thead th:nth-child(4),

  body#order-detail
  .gs-order-products-table:not(.gs-order-products-table--return)
  thead th:nth-child(5),

  body#order-detail
  .gs-order-products-table:not(.gs-order-products-table--return)
  .gs-order-products-table__metric {
    width: 5.5% !important;
  }

  /* Stato */
  body#order-detail
  .gs-order-products-table:not(.gs-order-products-table--return)
  thead th:nth-child(6),

  body#order-detail
  .gs-order-products-table:not(.gs-order-products-table--return)
  .gs-order-products-table__status-cell {
    width: 15% !important;
  }

  /* Prezzo unitario */
  body#order-detail
  .gs-order-products-table:not(.gs-order-products-table--return)
  thead th:nth-child(7),

  body#order-detail
  .gs-order-products-table:not(.gs-order-products-table--return)
  .gs-order-products-table__row
  > td:nth-last-child(2) {
    width: 10% !important;
  }

  /* Prezzo totale */
  body#order-detail
  .gs-order-products-table:not(.gs-order-products-table--return)
  thead th:nth-child(8),

  body#order-detail
  .gs-order-products-table:not(.gs-order-products-table--return)
  .gs-order-products-table__row
  > td:last-child {
    width: 10% !important;
  }


  /* ========================================================
     HEADER
     ======================================================== */

  body#order-detail
  .gs-order-products-table:not(.gs-order-products-table--return)
  thead th {
    padding: 4px 1px !important;
    font-size: 6.2pt !important;
    line-height: 1.05 !important;
    text-align: center !important;
    vertical-align: middle !important;
    white-space: normal !important;
    letter-spacing: -0.1px !important;
  }

  body#order-detail
  .gs-order-products-table:not(.gs-order-products-table--return)
  thead th:first-child {
    padding-left: 4px !important;
    text-align: left !important;
  }


  /* ========================================================
     RIGHE PRODOTTO
     ======================================================== */

  body#order-detail
  .gs-order-products-table:not(.gs-order-products-table--return)
  .gs-order-products-table__row > td {
    padding: 3px 2px !important;
    font-size: 7.3pt !important;
    line-height: 1.08 !important;
    vertical-align: middle !important;
  }

  body#order-detail
  .gs-order-products-table:not(.gs-order-products-table--return)
  .gs-order-product {
    gap: 5px !important;
  }

  body#order-detail
  .gs-order-products-table:not(.gs-order-products-table--return)
  .gs-order-product__thumb {
    width: 30px !important;
    min-width: 30px !important;
    flex-basis: 30px !important;
    height: 30px !important;
  }

  body#order-detail
  .gs-order-products-table:not(.gs-order-products-table--return)
  .gs-order-product__thumb img,

  body#order-detail
  .gs-order-products-table:not(.gs-order-products-table--return)
  .gs-order-product__thumb-placeholder {
    width: 30px !important;
    height: 30px !important;
  }

  body#order-detail
  .gs-order-products-table:not(.gs-order-products-table--return)
  .gs-order-product__content,

  body#order-detail
  .gs-order-products-table:not(.gs-order-products-table--return)
  .gs-order-product__content strong,

  body#order-detail
  .gs-order-products-table:not(.gs-order-products-table--return)
  .gs-order-product__content a {
    font-size: 7.3pt !important;
    line-height: 1.08 !important;
  }

  body#order-detail
  .gs-order-products-table:not(.gs-order-products-table--return)
  .gs-order-product__reference {
    font-size: 6.3pt !important;
    line-height: 1.05 !important;
  }


  /* ========================================================
     COLONNE NUMERICHE
     ======================================================== */

  body#order-detail
  .gs-order-products-table:not(.gs-order-products-table--return)
  .gs-order-products-table__metric {
    padding-left: 1px !important;
    padding-right: 1px !important;
    font-size: 7.3pt !important;
    text-align: center !important;
  }


  /* ========================================================
     STATO
     ======================================================== */

  body#order-detail
  .gs-order-products-table:not(.gs-order-products-table--return)
  .gs-order-products-table__status-cell {
    padding: 2px !important;
    white-space: normal !important;
    text-align: center !important;
  }

  /*
   * Due badge possono andare uno sotto l'altro,
   * ma non devono mai invadere la colonna prezzo.
   */
  body#order-detail
  .gs-order-products-table:not(.gs-order-products-table--return)
  .gs-order-products-table__status-cell
  .gs-order-status-badge {
    display: inline-block !important;
    max-width: 100% !important;
    margin: 1px !important;
    padding: 1px 3px !important;

    font-size: 6.1pt !important;
    line-height: 1.1 !important;

    white-space: nowrap !important;
    vertical-align: middle !important;
  }

  body#order-detail
  .gs-order-products-table:not(.gs-order-products-table--return)
  .gs-order-status-badge--modified {
    margin-left: 1px !important;
  }


  /* ========================================================
     MODIFICHE EFFETTUATE IN GESTIONE
     ======================================================== */

  body#order-detail
  .gs-order-management-changes-heading
  .gs-order-management-changes__title {
    padding: 5px 6px !important;
    font-size: 7.2pt !important;
    line-height: 1.1 !important;
  }

  body#order-detail
  .gs-order-management-changes__product
  .gs-order-product__content {
    column-gap: 4px !important;
    row-gap: 1px !important;
  }

  body#order-detail
  .gs-order-management-changes__product-name {
    font-size: 7.2pt !important;
    line-height: 1.08 !important;
  }

  body#order-detail
  .gs-order-management-change-kind {
    margin: 0 !important;
    padding: 1px 3px !important;

    font-size: 5.8pt !important;
    line-height: 1.1 !important;
  }

  body#order-detail
  .gs-order-management-change-flow {
    margin: 0 !important;

    font-size: 5.8pt !important;
    line-height: 1.1 !important;

    white-space: nowrap !important;
  }

}
