@import './skuPresentation.less';

.vm-customer-canvas .vm-collect-screen .vm-voucher-sku-list {
  margin-top: 20px;
  fieldset.vm-voucher-sku-group {
    .vm-sku-group-frame();
  }
  .vm-voucher-sku-group + .vm-voucher-sku-group {
    margin-top: 24px;
  }
  .vm-voucher-sku-group-title {
    .vm-sku-group-heading();
  }
  .vm-voucher-sku-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .vm-voucher-sku-row {
    position: relative;
    isolation: isolate;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: var(--vm-collect-selection-height);
    padding: 12px 16px;
    border: 1px solid #e7e5eb;
    border-radius: 20px;
    background: #fff;
    > :not(.vm-voucher-sku-add):not(.vm-sku-status-overlay) {
      position: relative;
      z-index: 1;
    }
    // Decorative content forwards taps to the card; quantity controls must
    // receive their own events, including when the card cannot add more.
    > :not(.vm-voucher-sku-add):not(.vm-sku-status-overlay):not(.vm-voucher-sku-quantity) {
      pointer-events: none;
    }
    > [role='group'] {
      flex-shrink: 0;
      pointer-events: auto;
    }
    &.is-selected {
      border-color: var(--vm-primary);
      box-shadow: inset 0 0 0 1px var(--vm-primary);
    }
    &.has-status-overlay.is-selected {
      .vm-voucher-sku-quantity {
        z-index: 3;
        border-radius: 16px;
        background: #fff;
      }
    }
  }
  .vm-sku-status-overlay {
    .vm-sku-status-mask();
    .vm-sku-status-stamp {
      width: 160px;
    }
  }
  .vm-voucher-sku-quantity.is-hidden {
    // Keep the control's space when an unavailable, unselected SKU hides it.
    visibility: hidden;
  }
  .vm-voucher-sku-add {
    .vm-sku-add-target();
  }
  .vm-voucher-sku-dot,
  .vm-voucher-sku-image {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--vm-primary-bg);
    border: 1px solid var(--vm-primary-border);
  }
  .vm-voucher-sku-label {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
    h3,
    h4 {
      margin: 0;
      font-size: 28px;
      font-weight: 650;
      line-height: 1.3;
      color: inherit;
    }
    p {
      margin: 6px 0 0;
      color: #625b73;
      font-size: 24px;
      line-height: 1.4;
    }
    .vm-voucher-sku-status {
      margin-top: 4px;
      font-size: 22px;
      line-height: 1.2;
      // The shared row height fits a title and two status lines. Empty messages
      // must not displace the title from the quantity controls' centre line.
      &:empty {
        display: none;
      }
    }
  }
}

@container vending-customer (max-width: 620px) {
  .vm-customer-canvas .vm-collect-screen .vm-voucher-sku-list {
    fieldset.vm-voucher-sku-group {
      padding-inline: 12px;
      padding-bottom: 12px;
    }
    .vm-voucher-sku-row {
      gap: 12px;
      padding: 12px;
      > [role='group'] {
        margin-left: auto;
      }
    }
    .vm-sku-status-overlay .vm-sku-status-stamp {
      width: 144px;
    }
    .vm-voucher-sku-dot,
    .vm-voucher-sku-image {
      display: none;
    }
    .vm-voucher-sku-label {
      h3,
      h4 {
        font-size: 24px;
        line-height: 1.25;
      }
      p {
        font-size: 22px;
      }
      .vm-voucher-sku-status {
        font-size: 20px;
        line-height: 1.15;
      }
    }
  }
}
