.pisell-sale-detail-line-item-swipe {
  border-radius: var(--pisell-line-item-radius);
  border: 1px solid var(--pisell-line-item-border-color);
  box-shadow: var(--pisell-line-item-shadow);
  overflow: hidden;
}

.pisell-sale-detail-line-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 4px;
  overflow: hidden;
  background: var(--pisell-line-item-bg);
  color: var(--pisell-line-item-text-primary);
  user-select: none;
  cursor: pointer;

  &__booking-header {
    position: relative;
    margin: -4px -8px 0 -4px;
    padding: 8px 124px 8px 8px;
    background: var(
      --pisell-line-item-booking-bg,
      var(--pisell-line-item-header-bg)
    );
    color: var(
      --pisell-line-item-booking-text,
      var(--pisell-line-item-header-text)
    );
    min-height: 48px;
  }

  &__booking-header-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }

  &__booking-headline {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    min-width: 0;
    color: var(
      --pisell-line-item-booking-text,
      var(--pisell-line-item-header-text)
    );
    font-size: 14px;
    font-weight: 800;
  }

  &__booking-id {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
    flex-shrink: 0;
  }

  &__booking-time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: -0.02em;
  }

  &__booking-header-actions {
    position: absolute;
    top: 10px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }

  &__status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 104px;
    min-height: 34px;
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    background: var(--pisell-line-item-status-bg);
    color: var(--pisell-line-item-status-text);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;

    &:disabled {
      cursor: default;
      opacity: 1;
    }
  }

  &__header-delete,
  &__delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    padding: 10px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #667085;
    cursor: pointer;
    flex-shrink: 0;

    > span {
      color: currentColor;
      font-size: 20px;
    }
  }

  &__booking-title {
    margin-top: 4px;
    overflow: hidden;
    color: var(
      --pisell-line-item-booking-sub-text,
      var(--pisell-line-item-header-sub-text)
    );
    font-size: 14px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &__booking-body {
    padding: 6px 4px;
    background: var(--pisell-line-item-bg);
  }

  &__booking-inline-time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    color: var(--pisell-line-item-text-secondary);
    font-size: 14px;
    font-weight: 700;
  }

  &__booking-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
  }

  &__booking-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--pisell-line-item-text-secondary);
    font-size: 13px;
    font-weight: 800;

    > span:last-child {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    &--muted {
      color: var(--pisell-line-item-text-muted);
    }
  }

  &__booking-resources {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
  }

  &__booking-resource {
    display: flex;
    flex: 0 0 calc((100% - 8px) / 2);
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }

  &__booking-resource-form,
  &__booking-resource-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &__booking-resource-form {
    color: var(--pisell-line-item-text-secondary);
    font-size: 14px;
    font-weight: 800;
  }

  &__booking-resource-name {
    font-size: 12px;
    font-weight: 700;
  }

  &__booking-for {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
  }

  &__booking-for-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--pisell-line-item-text-secondary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.2px;
  }

  &__booking-for-value {
    font-size: 12px;
    font-weight: 800;
  }

  &__holders {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  &__holder {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    color: var(--pisell-line-item-text-secondary);
    font-size: 12px;
    font-weight: 700;

    &--unassigned {
      color: var(--pisell-line-item-danger-color);
    }
  }

  &--product,
  &__related-product,
  &__add-time-products,
  &__add-time-product-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    border-top: none;

    > .pisell-sale-detail-line-item__delete-btn {
      position: absolute;
      top: 0;
      right: 0;
      z-index: 1;
    }
  }

  &__related-product {
    padding: 4px 4px 0;
    border-top: 1px solid var(--pisell-line-item-divider-color);
  }

  &__add-time-products {
    padding: 4px;
  }

  &__add-time-products-title {
    color: var(--pisell-line-item-text-secondary);
    font-size: 12px;
    font-weight: 800;
  }

  &__add-time-product-info {
    padding: 4px;
    border: 1px solid var(--pisell-line-item-divider-color);
    border-radius: 8px;
    background: var(--pisell-line-item-product-bg);
  }

  &__add-time-products-show-all {
    align-self: flex-start;
    padding: 2px 0;
    border: none;
    background: transparent;
    color: var(--pisell-line-item-action-text);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
  }

  &--a5,
  &--a9 {
    &.pisell-sale-detail-line-item--product
      > .pisell-sale-detail-line-item__basic-info,
    .pisell-sale-detail-line-item__related-product
      > .pisell-sale-detail-line-item__basic-info {
      padding-right: 42px;
    }
  }

  &__basic-info {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
    min-height: 48px;
    position: relative;

    &--a2 {
      align-items: center;
    }

    &--a5,
    &--a9 {
      align-items: flex-start;
    }
  }

  &__product-image,
  &__product-image-text {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    flex-shrink: 0;
    object-fit: cover;
    background: var(--pisell-line-item-image-bg);
  }

  &__product-image-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--pisell-line-item-text-secondary);
    font-size: 20px;
    font-weight: 500;
  }

  &__product-info {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0;
    min-width: 0;
  }

  &__product-basic-row,
  &__product-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
  }

  &__product-basic-row {
    flex-direction: column;
    gap: 0;

    &--bundle {
      flex: 1;
      flex-direction: row;
      align-items: center;
      justify-content: space-between;

      .pisell-sale-detail-line-item__product-price {
        width: max-content;
      }
    }
  }

  &__product-title-row {
    flex: 1;
  }

  &__product-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    color: var(--pisell-line-item-text-primary);
    font-size: 14px;
    font-weight: 600;
    padding-right: 20px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &__product-price {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    color: var(--pisell-line-item-price-color);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
  }

  &__product-original-price,
  &__product-origin-total {
    color: var(--pisell-line-item-original-price-color);
    font-size: 12px;
    font-weight: 400;
    text-decoration: line-through;
  }

  &__product-amount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    color: var(--pisell-line-item-price-color);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
  }

  &__edit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--pisell-line-item-text-muted);
    cursor: pointer;
    flex-shrink: 0;

    &:disabled {
      cursor: not-allowed;
      opacity: 0.55;
    }
  }

  &__quantity {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 12px;
    background: #7f56da;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);

    &--with-image {
      position: absolute;
      top: -4px;
      left: -4px;
      z-index: 1;
      min-width: 24px;
      height: 24px;
    }

    &--without-image {
      align-self: flex-start;
      margin-top: -4px;
      margin-left: -4px;
    }
  }

  &__swipe-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #fff;
    padding: 10px 0;

    > span:last-child {
      font-size: 12px;
      font-weight: 500;
    }
  }

  &__swipe-delete-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
  }

  &__specs {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
  }

  &__spec {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    color: var(--pisell-line-item-text-muted);
    font-size: 14px;
    font-weight: 400;
  }

  &__spec-price,
  &__spec-more {
    flex-shrink: 0;
    color: var(--pisell-line-item-text-secondary);
  }

  &__product-bundle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px;
    border-right: none;
    border-bottom: none;
    border-left: none;
    border-radius: 0;
    background: transparent;
  }

  &__product-bundle-title {
    color: var(--pisell-line-item-text-primary);
    font-size: 12px;
    font-weight: 600;
  }

  &__product-bundle-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  &__product-bundle-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--pisell-line-item-divider-color);
    border-radius: 8px;
    background: var(--pisell-line-item-product-bg);

    .pisell-sale-detail-line-item__product-image,
    .pisell-sale-detail-line-item__product-image-text {
      width: 48px;
      height: 48px;
    }
  }

  &__bundle-item-info {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
    min-height: 48px;
    position: relative;
  }

  &__bundle-item-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0;
    min-width: 0;

    .pisell-sale-detail-line-item__specs {
      padding-left: 12px;
    }
  }

  &__bundle-item-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
  }

  &__bundle-item-title {
    min-width: 0;
    overflow: hidden;
    color: var(--pisell-line-item-text-primary);
    font-size: 14px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &__bundle-item-price {
    color: var(--pisell-line-item-price-color);
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
  }

  &__amount-footer,
  &__note,
  &__discount-reason {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 4px;
    border-top: 1px solid var(--pisell-line-item-divider-color);
    color: var(--pisell-line-item-text-secondary);
    font-size: 14px;
    font-weight: 600;
  }

  &__amount-total {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--pisell-line-item-price-color);
    font-size: 14px;
    font-weight: 600;
  }

  &__amount-original {
    color: var(--pisell-line-item-original-price-color);
    font-size: 12px;
    font-weight: 400;
    text-decoration: line-through;
  }

  &__note-text {
    min-width: 0;
    color: var(--pisell-line-item-text-primary);
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  &__note-btn {
    border: none;
    background: transparent;
    color: #1570ef;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
  }

  &__promotions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  &__promotion {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 22px;
    padding: 0 8px;
    border: 1px solid #ffa39e;
    border-radius: 4px;
    background: #fff1f0;
    color: #f5222d;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
  }

  &__line-action {
    display: flex;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid var(--pisell-line-item-divider-color);

    button {
      min-height: 36px;
      padding: 7px 14px;
      border: none;
      border-radius: 10px;
      background: var(--pisell-line-item-action-bg);
      color: var(--pisell-line-item-action-text);
      font-size: 14px;
      font-weight: 800;
      cursor: pointer;
    }
  }

  &__booking-edit-action {
    display: flex;
    gap: 8px;
    padding: 8px 4px 4px;
  }

  &__booking-edit-btn {
    display: inline-flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--pisell-line-item-border-color);
    border-radius: 10px;
    background: var(--pisell-line-item-bg);
    color: var(--pisell-line-item-action-text);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }

  &__booking-add-time-btn {
    display: inline-flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(147, 197, 253, 0.45);
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
  }

  &__booking-add-time-icon {
    font-size: 16px;
  }

  &__gift {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    min-width: 0;
    padding: 8px;
    border: none;
    border-radius: 8px;
    background: rgba(242, 244, 247, 0.12);
    color: var(--pisell-line-item-text-secondary);
    cursor: pointer;
  }

  &__gift-label,
  &__gift-content,
  &__gift-total {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: 13px;
    font-weight: 400;
  }

  &__gift-content {
    flex: 1;
    overflow: hidden;
  }

  &__gift-images {
    display: inline-flex;
    align-items: center;
  }

  &__gift-image {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: -6px;
    border: 1px solid var(--pisell-line-item-product-bg);
    border-radius: 999px;
    overflow: hidden;
    background: var(--pisell-line-item-image-bg);

    &:first-child {
      margin-left: 0;
    }

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }

  &__right-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 8px;
    border-top: 1px solid var(--pisell-line-item-divider-color);
    background: var(--pisell-line-item-section-bg);
  }

  &__right-action {
    display: inline-flex;
    align-items: center;
    min-width: 0;
  }
}
