/* SubAccount sites selector */
.diore-sub-account-sites-select:invalid {
  color: var(--diore-text-light);
}

.diore-sub-account-sites-select option {
  color: var(--diore-text);
}

/* SubAccount order page */
.diore-sub-account-order-products-header,
.diore-sub-account-order-products-row {
  grid-template-columns: 64px minmax(0, 1fr) minmax(0, 160px) minmax(0, 150px) minmax(0, 120px);
}

.diore-sub-account-order-actions {
  justify-content: space-between;
}

.diore-sub-account-order-actions-main {
  display: flex;
  gap: 12px;
  margin-left: auto;
}

.diore-sub-account-order-cart-button,
.diore-sub-account-order-place-button {
  white-space: nowrap;
}

.diore-sub-account-order-shipping-notice {
  margin: 16px 0 0;
  color: var(--diore-text-secondary);
  font-size: var(--diore-font-size-xs);
  line-height: 1.5;
}

/* Expand order list request modal */
.diore-sub-account-order-expand-modal {
  --diore-modal-width: 880px;
  overscroll-behavior: contain;
}

.diore-sub-account-order-expand-modal .diore-modal-panel {
  overflow: visible;
}

.diore-sub-account-order-expand-modal .diore-modal-close {
  width: 40px;
  height: 40px;
}

.diore-sub-account-order-expand-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}

.diore-sub-account-order-expand-fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.diore-sub-account-order-expand-label {
  margin-bottom: 12px;
}

.diore-account-page .diore-sub-account-order-expand-comment-input {
  min-height: 210px;
}

.diore-sub-account-order-expand-selected {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.diore-sub-account-order-expand-selected-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--diore-border);
  color: var(--diore-text);
  background: var(--diore-surface-accent);
  font-weight: 600;
  box-sizing: border-box;
}

.diore-sub-account-order-expand-selected-title {
  min-width: 0;
  overflow-wrap: anywhere;
}

.diore-sub-account-order-expand-selected-count {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--diore-text-inverse);
  background: var(--diore-primary);
  font-size: var(--diore-font-size-sm);
  line-height: 1;
  box-sizing: border-box;
}

.diore-sub-account-order-expand-selected-count[hidden] {
  display: none;
}

.diore-sub-account-order-expand-selected-empty {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  border-top: 0;
  overflow-wrap: anywhere;
}

.diore-sub-account-order-expand-selected-empty[hidden] {
  display: none;
}

.diore-sub-account-order-expand-selected-row {
  grid-template-columns: 56px minmax(0, 1fr) 40px;
}

.diore-sub-account-order-expand-search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 3;
  margin-top: 0;
  border-radius: var(--diore-radius-sm);
  box-shadow: var(--diore-shadow-lg);
}

.diore-sub-account-order-expand-search-results .diore-workgroups-site-products-search-row {
  grid-template-columns: 48px minmax(0, 1fr) 40px;
  gap: 12px;
  padding: 8px 12px;
}

.diore-sub-account-order-expand-modal .diore-table-row .cell-image {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  overflow: hidden;
  border-radius: var(--diore-radius);
  background: var(--diore-surface-muted);
}

.diore-sub-account-order-expand-search-results .diore-table-row .cell-image {
  height: 48px;
}

.diore-sub-account-order-expand-modal .diore-table-row .cell-image img {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: none;
  color: transparent;
  font-size: 0;
}

.diore-sub-account-order-expand-modal .diore-table-row .cell-image img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--diore-surface-muted);
}

.diore-sub-account-order-expand-add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
}

.diore-sub-account-order-expand-article-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--diore-text-light);
  font-size: var(--diore-font-size-3xl);
  line-height: 1;
  cursor: pointer;
  transition: color var(--diore-transition), background-color var(--diore-transition);
}

.diore-sub-account-order-expand-article-remove:hover {
  color: var(--diore-error);
  background: var(--diore-error-soft);
}

.diore-sub-account-order-expand-alert {
  grid-column: 1 / -1;
  border-color: var(--diore-error-soft);
  color: var(--diore-error-dark);
  background: var(--diore-error-soft);
}

.diore-sub-account-order-expand-alert[hidden] {
  display: none;
}

.diore-sub-account-order-expand-alert > i {
  color: var(--diore-error);
}

@media (max-width: 768px) {
  .diore-sub-account-order-products-row {
    grid-template-columns: 56px minmax(0, 1fr);
    row-gap: 8px;
  }

  .diore-sub-account-order-products-row .cell-image {
    grid-row: 1 / -1;
  }

  .diore-sub-account-order-products-row .cell-description,
  .diore-sub-account-order-products-row .cell-price,
  .diore-sub-account-order-products-row .cell-quantity,
  .diore-sub-account-order-products-row .cell-subtotal {
    grid-column: 2;
  }

  .diore-sub-account-order-products-row .cell-price {
    font-size: var(--diore-font-size-sm);
  }

  .diore-sub-account-order-products-row .cell-quantity,
  .diore-sub-account-order-products-row .cell-subtotal {
    grid-row: 3;
  }

  .diore-sub-account-order-products-row .cell-subtotal {
    justify-self: end;
  }

  /* Three buttons in two groups: stack them all instead of the default two-column grid */
  .diore-sub-account-order-actions,
  .diore-sub-account-order-actions-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    margin-left: 0;
  }

  .diore-sub-account-order-expand-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
}

/* Catalogue site cart */
.diore-catalog-site-cart {
  margin-top: 12px;
}

  .diore-catalog-site-cart-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    font-size: 14px;
    font-weight: 700;
  }

  .diore-catalog-site-cart--product-page {
    flex: 1 1 auto;
    margin-top: 0;
  }

    .diore-catalog-site-cart--product-page .diore-catalog-site-cart-button {
      padding: 14px 18px;
    }

.diore-catalog-site-cart-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow-y: auto;
  z-index: 1048;
}

  .diore-catalog-site-cart-modal[hidden] {
    display: none;
  }

  .diore-catalog-site-cart-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
  }

  .diore-catalog-site-cart-modal-panel {
    position: relative;
    max-width: 480px;
    margin: 80px auto;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  }

  .diore-catalog-site-cart-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid #e6e9ed;
  }

    .diore-catalog-site-cart-modal-header h2 {
      margin: 0;
      font-size: 16px;
      color: #3f4f5f;
    }

  .diore-catalog-site-cart-modal-close {
    background: transparent;
    border: 0;
    font-size: 22px;
    color: #8893a0;
    cursor: pointer;
  }

  .diore-catalog-site-cart-modal-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 18px;
  }

  .diore-catalog-site-cart-modal-product {
    margin: 0;
    color: var(--black);
    font-weight: 600;
  }

  .diore-catalog-site-cart-modal-label {
    display: block;
    margin-bottom: 6px;
    color: #3f4f5f;
    font-weight: 600;
  }

  .diore-catalog-site-cart-modal-site,
  .diore-catalog-site-cart-modal-quantity {
    width: 100%;
    padding: 8px 10px;
    color: var(--black);
    background: #fff;
    border: 1px solid #d8dde3;
    border-radius: 3px;
  }

  .diore-catalog-site-cart-modal-quantity {
    max-width: 120px;
  }

  .diore-catalog-site-cart-modal-notice,
  .diore-catalog-site-cart-modal-empty {
    margin: 0;
    color: #526273;
    font-size: 13px;
    line-height: 1.5;
  }

  .diore-catalog-site-cart-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid #e6e9ed;
  }

  .diore-catalog-site-cart-modal-submit:disabled {
    cursor: not-allowed;
    opacity: .55;
  }

@media (max-width: 768px) {
  .diore-catalog-site-cart-modal-panel {
    margin: 24px 16px;
  }

  .diore-catalog-site-cart-modal-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
}
