.wp-block-edwiser-bridge-orders {
  // CSS reset
  *,
  *::before,
  *::after {
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
  }

  * {
    margin: 0;
  }

  img,
  picture,
  video,
  canvas,
  svg {
    display: block;
    max-width: 100%;
  }

  input,
  button,
  textarea,
  select {
    font: inherit;
  }

  p,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    overflow-wrap: break-word;
    margin: 0;
  }

  p {
    text-wrap: pretty;
  }
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    text-wrap: balance;
  }

  background: none !important;
  width: 100%;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 auto !important;
  font-size: 1rem;
  line-height: 1.5rem;

  // Mantine Skeleton
  .mantine-Skeleton-root {
    --mantine-scale: 1;
    height: var(--skeleton-height, auto);
    width: var(--skeleton-width, 100%);
    border-radius: 4px;
    position: relative;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);

    &:where([data-animate])::after {
      animation: skeleton-fade 1500ms linear infinite;
    }

    &:where([data-visible]) {
      overflow: hidden;

      &::before {
        position: absolute;
        content: '';
        inset: 0;
        z-index: 10;
        background-color: #fff !important;
      }

      &::after {
        position: absolute;
        content: '';
        inset: 0;
        z-index: 11;
        background-color: #dee2e6 !important;
      }
    }
  }

  @keyframes skeleton-fade {
    0%,
    100% {
      opacity: 0.4;
    }

    50% {
      opacity: 1;
    }
  }

  // Mantine Input
  .mantine-TextInput-root {
    position: relative;
  }

  .mantine-TextInput-section {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: #abbebe;
  }

  .mantine-TextInput-section[data-position='left'] {
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
  }

  .mantine-TextInput-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    line-height: 20px;
    color: #283b3c;
    margin-bottom: 6px;

    .optional-label {
      font-weight: 400;
      font-size: 12px;
      line-height: 16px;
      color: #819596;
    }
  }

  .mantine-TextInput-input {
    width: 100%;
    height: 36px;
    border: 1px solid #d6eaeb !important;
    border-radius: 4px !important;
    background: #fff;
    color: #283b3c;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    padding-inline: 12px;
    box-shadow: none;

    &::placeholder {
      font-size: 14px;
      font-weight: 400;
      line-height: 20px;
      color: #819596;
    }

    &:focus {
      outline: 1px solid #008b91 !important;
    }

    &[data-error='true'] {
      border: 1px solid #dd1405 !important;
      color: #dd1405;

      &::placeholder {
        color: #dd1405;
      }

      &:focus {
        outline: none !important;
        color: #dd1405;
      }
    }
  }

  .mantine-TextInput-error {
    font-weight: 600;
    font-size: 12px;
    line-height: 16px;
    color: #dd1405;
  }

  // Mantine Select
  .mantine-Select-wrapper {
    position: relative;
  }

  .mantine-Select-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    line-height: 20px;
    color: #283b3c;
    margin-bottom: 6px;

    .optional-label {
      font-weight: 400;
      font-size: 12px;
      line-height: 16px;
      color: #819596;
    }
  }

  .mantine-Select-section {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: #abbebe;
  }

  .mantine-Select-section[data-position='left'] {
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
  }

  .mantine-Select-section[data-position='right'] {
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
  }

  .mantine-Select-input {
    width: 100%;
    height: 36px;
    border: 1px solid #d6eaeb !important;
    border-radius: 4px;
    background: #fff;
    color: #283b3c;
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
    padding-inline: 12px;
    box-shadow: none;
    cursor: pointer;

    &:focus {
      outline: 1px solid #008b91;
    }

    &[data-error='true'] {
      border: 1px solid #dd1405 !important;
      color: #dd1405;

      &::placeholder {
        color: #dd1405;
      }

      &:focus {
        outline: none;
        color: #dd1405;
      }
    }
  }

  .mantine-Select-error {
    font-weight: 600;
    font-size: 12px;
    line-height: 16px;
    color: #dd1405;
  }

  .mantine-Select-input::placeholder {
    font-weight: 400;
    font-size: 0.875rem;
    color: #819596;
  }

  .mantine-Select-dropdown {
    --mantine-scale: 1;
    position: absolute;
    background: #ffffff;
    border: 1px solid #d9e7e8;
    padding: 0.25rem;
    border-radius: 0.25rem;
    margin: 0 !important;
  }

  .mantine-ScrollArea-root {
    --scrollarea-scrollbar-size: calc(0.75rem * var(--mantine-scale));
    position: relative;
    overflow: hidden;
  }

  .mantine-ScrollArea-viewport {
    padding-inline-end: 0.25rem;
    padding-inline-start: unset;
    scrollbar-width: none;
    overscroll-behavior: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    height: 100%;
  }

  .mantine-Select-option {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-weight: 400;
    font-size: 0.875rem;
    color: #385b5c;
    word-break: break-word;
    border-radius: 0.25rem;
    background-color: transparent;
    padding: 0.375rem 0.625rem;

    &[aria-selected='true'] {
      font-weight: 600;
      color: #162324;

      svg {
        opacity: 0.4;
        width: 0.8em;
        min-width: 0.8em;
        height: 0.8em;
      }
    }

    &:hover {
      background-color: #ecf3f3;
    }
  }

  .mantine-ScrollArea-scrollbar {
    user-select: none;
    touch-action: none;
    box-sizing: border-box;
    transition:
      background-color 150ms ease,
      opacity 150ms ease;
    padding: calc(0.25rem / 5);
    display: flex;
    background-color: transparent;
    flex-direction: row;

    &:where([data-orientation='horizontal']) {
      height: 0.25rem;
      flex-direction: column;
      bottom: 0;
      inset-inline-start: 0;
      inset-inline-end: 0px;
    }

    &:where([data-orientation='vertical']) {
      width: 0.25rem;
      top: 0;
      bottom: 0px;
      inset-inline-end: 0;
    }

    &:where([data-hidden], [data-state='hidden']) {
      display: none;
    }
  }

  .mantine-ScrollArea-thumb {
    background-color: rgba(0, 0, 0, 0.4);
    flex: 1;
    border-radius: 0.25rem;
    position: relative;
    transition: background-color 150ms ease;
    overflow: hidden;
    opacity: var(--thumb-opacity);
  }

  // Mantine pagination
  .mantine-Pagination-root {
    .mantine-Group-root {
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
      justify-content: flex-start;
      align-items: center;
      gap: 0.5rem;
    }

    .mantine-Pagination-control {
      display: flex;
      align-items: center;
      justify-content: center;
      border: calc(0.0625rem * 1) solid !important;
      cursor: pointer !important;
      height: 2rem;
      min-width: 2rem;
      font-size: 0.875rem;
      line-height: 1;
      border-radius: 0.25rem;
      border-color: #d6eaeb !important;
      color: #283b3c;
      background-color: transparent;
      cursor: pointer;
      border: 0;
      padding: 0;
      appearance: none;
      text-align: left;
      text-decoration: none;
      color: inherit;
      touch-action: manipulation;
      -webkit-tap-highlight-color: transparent;
      box-shadow: none;

      &:focus {
        outline: 1px solid #008b91;
      }

      &:hover {
        background-color: #ecf3f3;
      }

      &:disabled {
        border-color: #d6eaeb;
        cursor: not-allowed !important;
        opacity: 0.4 !important;
      }

      svg {
        width: 18px !important;
        height: 18px !important;
      }
    }

    .mantine-Pagination-control[data-active='true'] {
      border-color: #008b91 !important;
      background: #d6eaeb;
      color: #008b91;
      font-weight: 700;
    }

    .mantine-Pagination-dots {
      color: #283b3c;

      svg {
        width: 18px !important;
        height: 18px !important;
      }
    }
  }

  // Mantine tabs
  .mantine-Tabs-list {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    flex-direction: row;
    gap: 0;
    padding: 0 !important;
    border-bottom: 1px solid #d9e7e8 !important;

    &::before {
      content: '';
      position: absolute;
      border-style: solid;
      bottom: 0;
      inset-inline-start: 0;
      inset-inline-end: 0;
      border-width: 1px;
      border-color: #d9e7e8 !important;
    }
  }

  .mantine-Tabs-tab {
    font-weight: 600;
    font-size: 0.875rem;
    color: #273e3f;
    border-radius: 0.25rem 0.25rem 0 0;
    border-width: 0 0 0.125rem 0;
    border-style: solid;
    border-color: transparent;
    background-color: transparent;
    position: relative;
    padding: 0.625rem 1rem;
    white-space: nowrap;
    z-index: 0;
    display: flex;
    align-items: center;
    line-height: 1;
    user-select: none;
    flex-grow: unset;
    justify-content: center;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    box-shadow: none;

    &[aria-selected='true'] {
      color: #008b91;
      border-bottom-width: 3px !important;
      border-bottom-color: #008b91;
      background: transparent !important;

      &:hover {
        border-bottom-color: #008b91 !important;
        background: transparent !important;
      }
    }

    &:focus {
      outline: none;
      background-color: transparent;
    }

    &:hover {
      border-color: transparent !important;
      background-color: transparent;
      color: #008b91;
    }
  }

  .mantine-Tabs-panel {
    padding: 0 !important;
    padding-top: 2em !important;
  }

  // Tab - Orders
  .eb-user-account__orders {
    width: 100%;
    max-width: 1190px !important;
    margin: 0 auto !important;

    .eb-orders__title {
      font-size: 32px;
      line-height: 42px;
      font-weight: 700;
      color: #283b3c;
    }

    .eb-orders__filter {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: space-between;
      gap: 1em;

      .mantine-Select-root {
        width: 100%;
      }

      .mantine-Select-input {
        padding-left: 40px;
      }

      .mantine-TextInput-root {
        width: 100%;
      }

      .mantine-TextInput-input {
        padding-left: 46px;
      }
    }

    .eb-orders__table-wrapper {
      border: 1px solid #dbdbdb;
      border-radius: 0.5rem;
      overflow-x: auto;
      margin-top: 16px;
      width: 100%;
    }

    .eb-orders__table {
      width: 100%;
      border: 0;
      border-collapse: collapse;
      // table-layout: fixed;

      th,
      td {
        border: 0;
        background: transparent;
      }

      .eb-orders__table-header-item--order-id,
      .eb-orders__table-row-item--order-id,
      .eb-orders__table-footer-item--order-id {
        width: 130px;
      }

      .eb-orders__table-header-item--course,
      .eb-orders__table-row-item--course,
      .eb-orders__table-footer-item--course {
        width: 355px;
      }

      .eb-orders__table-header-item--date,
      .eb-orders__table-row-item--date,
      .eb-orders__table-footer-item--date {
        width: 170px;
      }

      .eb-orders__table-header-item--status,
      .eb-orders__table-row-item--status,
      .eb-orders__table-footer-item--status {
        width: 150px;
        text-transform: capitalize;
      }

      .eb-orders__table-header-item--actions,
      .eb-orders__table-row-item--actions,
      .eb-orders__table-footer-item--actions {
        width: 220px;
      }

      .eb-orders__table-row-item--actions {
        .row-actions {
          display: flex;
          align-items: center;
          gap: 8px;
          color: unset;
          font-size: unset;
          padding: 0;
          position: static;
        }

        .row-actions a,
        .row-actions button {
          display: inline-block;
          text-decoration: none;
          color: #f75d25 !important;
          font-weight: 500;
          padding: 4px 12px;
          border-radius: 4px;
          background-color: hsl(16, 93%, 56%, 0.1) !important;
          height: 30px;
          border: none;
          cursor: pointer;
          font-size: inherit;

          &:hover {
            background-color: hsl(16, 93%, 56%) !important;
            color: #fff !important;
          }
        }
      }

      .eb-orders__table-row-item--total .eb-orders__total-with-refund {
        .eb-orders__original-total {
          color: #819596;
          text-decoration: line-through;
        }

        .eb-orders__net-total {
          color: #283b3c;
          font-weight: 700;
        }
      }

      .eb-orders__table-header {
        background: #d6eaeb;
      }

      .eb-orders__table-footer {
        border-top: 1px solid #dbdbdb;
      }

      .eb-orders__table-header-item {
        padding: 10px;
        padding-right: 20px;
        text-align: left;
        cursor: pointer;
        user-select: none;
        font-weight: 700;
        font-size: 14px;
        line-height: 20px;
        color: #283b3c;
      }

      .eb-orders__table-footer-item {
        padding: 10px;
        text-align: left;
        font-weight: 700;
        font-size: 14px;
        line-height: 20px;
        color: #283b3c;
      }

      .eb-orders__table-header-item-icon {
        display: flex;
        flex-direction: column;

        div {
          font-size: 10px;
          line-height: 0.9;
        }
      }

      .eb-orders__table-header-item-content,
      .eb-orders__table-footer-item-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
      }

      .eb-orders__table-row {
        border-top: 1px solid #dbdbdb;

        &:nth-child(even) {
          background: #f8fbfc;
        }
      }

      .eb-orders__table-row-item {
        padding: 10px;
        font-weight: 400;
        font-size: 14px;
        line-height: 20px;
        color: #4b5858;
      }

      .eb-orders__course-link {
        text-decoration: none;
        color: #f75d25;
        font-weight: 500;

        &:hover {
          text-decoration: underline;
        }
      }

      .eb-user-order-courses {
        list-style: none;
        padding: 0;
        margin: 0;
      }

      .eb-orders__table-row-item--order-id {
        font-weight: 700;
      }
    }

    .eb-orders__empty-state {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      padding: 60px 20px;
      margin-top: 16px;
      border: 1px solid #dbdbdb;
      border-radius: 0.5rem;

      .eb-orders__empty-state-title {
        font-weight: 700;
        font-size: 18px;
        line-height: 24px;
        color: #283b3c;
        margin-bottom: 12px;
      }

      .eb-orders__empty-state-description {
        font-weight: 400;
        font-size: 14px;
        line-height: 20px;
        color: #819596;
        max-width: 400px;
        margin: 0;
      }
    }

    .eb-orders__pagination {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: space-between;
      gap: 1em;
      margin-top: 16px;

      .eb-orders__pagination-text {
        font-weight: 400;
        font-size: 14px;
        line-height: 20px;
        color: #819596;
      }
    }
  }

  .eb-orders__notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    animation: slideInDown 0.3s ease-out;

    &--success {
      background-color: #d1fae5;
      border: 1px solid #10b981;
      color: #065f46;
    }

    &--error {
      background-color: #fee2e2;
      border: 1px solid #ef4444;
      color: #991b1b;
    }

    &--animated {
      animation: slideInDown 0.3s ease-out;
    }

    .eb-orders__notice-text {
      flex: 1;
      margin: 0;
    }

    .eb-orders__notice-close {
      background: none;
      border: none;
      cursor: pointer;
      padding: 4px;
      margin-left: 12px;
      border-radius: 4px;
      color: inherit;
      opacity: 0.7;
      transition: opacity 0.2s ease;

      &:hover {
        opacity: 1;
        background-color: rgba(0, 0, 0, 0.1);
      }

      svg {
        width: 16px;
        height: 16px;
      }
    }
  }

  .eb-order-details {
    .eb-order-details__header {
      & > * + * {
        margin-top: 24px;
      }

      .eb-order-details__meta {
        font-size: 14px;
        line-height: 20px;
        font-weight: 400;
        color: #4b5858;
        padding: 12px 16px;
        border-left: 3px solid #f75d25;
        background: #f8fbfc;
      }
    }

    .eb-order-details__back-button {
      display: flex;
      align-items: center;
      gap: 8px;
      color: #f75d25;
      font-size: 14px;
      line-height: 20px;
      font-weight: 500;
      padding: 8px 12px;
      border-radius: 4px;
      background-color: hsl(16, 93%, 56%, 0.1);
      border: none;
      cursor: pointer;

      &:hover {
        background-color: hsl(16, 93%, 56%);
        color: #fff;
      }

      svg {
        width: 18px;
        height: 18px;
      }
    }

    .eb-order-details__error {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 12px;
      padding: 48px 16px;
      text-align: center;
      width: 100%;
      height: 450px;
      border: 1px solid #dbdbdb;
      border-radius: 8px;

      h4 {
        font-size: 20px;
        font-weight: 700;
        color: #283b3c;
      }

      p {
        font-size: 16px;
        font-weight: 400;
        color: #819596;
        margin-bottom: 16px;
      }
    }

    .eb-order-details__woocommerce-content {
      margin-top: 32px;

      .woocommerce-order-details__title {
        font-size: 24px;
        line-height: 32px;
        font-weight: 700;
        color: #283b3c;
        margin-bottom: 32px;
      }

      .woocommerce-table,
      .woocommerce-column address,
      .woocommerce-MyAccount-subscriptions {
        table-layout: fixed;
        width: 100% !important;
        border: 1px solid #e5e5e5 !important;
        border-collapse: collapse !important;
        color: #283b3c !important;
        margin-top: 0 !important;
        font-size: 14px !important;
        line-height: 20px !important;
        font-weight: 400 !important;
        padding: 20px !important;
        background-color: transparent !important;

        thead {
          background: #d6eaeb !important;

          tr th {
            font-size: 16px !important;
            line-height: 24px !important;
            font-weight: 600 !important;
          }
        }

        th,
        td {
          border: 1px solid #e5e5e5 !important;
          background: transparent !important;
          padding: 0.75rem 1rem !important;

          ul {
            padding: 0 !important;
            margin-top: 12px !important;
          }

          a {
            font-weight: 500;
            color: #f75d25 !important;
            text-decoration: none !important;

            &:hover {
              text-decoration: underline !important;
            }
          }
        }

        tr th {
          font-weight: 700 !important;
        }

        .subscription-actions {
          border: none !important;
          a {
            background: #f75d25 !important;
            color: #fff !important;
            padding: 8px 12px !important;
            border-radius: 0.25rem !important;
            font-weight: 600 !important;
            font-size: 14px !important;
            line-height: 20px !important;
            text-decoration: none !important;

            &:hover {
              background: hsl(16, 93%, 56%, 0.8) !important;
              text-decoration: none !important;
            }
          }
        }

        .order-actions-button {
          background: #f75d25 !important;
          color: #fff !important;
          padding: 8px 20px !important;
          border-radius: 0.25rem !important;
          font-weight: 600 !important;
          font-size: 14px !important;
          line-height: 20px !important;
          text-decoration: none !important;

          &:hover {
            background: hsl(16, 93%, 56%, 0.8) !important;
            text-decoration: none !important;
          }

          &.cancel {
            margin-left: 8px;
          }
        }

        .woocommerce-Price-amount:not(.includes_tax .woocommerce-Price-amount) {
          font-weight: 700 !important;
        }
      }

      .woocommerce-columns--addresses {
        display: grid;
        grid-template-columns: 1fr;
        gap: 24px;

        .woocommerce-column {
          display: flex;
          flex-direction: column;
          gap: 0px;
        }

        address {
          flex-grow: 1;
          width: 100% !important;
          border: 1px solid #e5e5e5 !important;
          border-radius: 0 0 0.25rem 0.25rem !important;
          color: #283b3c !important;
          margin-top: 0 !important;
          font-size: 14px !important;
          line-height: 24px !important;
          font-weight: 400 !important;
          padding: 20px !important;
          background-color: transparent !important;
        }

        .woocommerce-column__title {
          background: #d6eaeb !important;
          color: #283b3c;
          font-size: 16px !important;
          font-weight: 600 !important;
          line-height: 24px !important;
          padding: 12px 16px !important;
          border-radius: 0.25rem 0.25rem 0 0 !important;
          border: none !important;
          margin-bottom: 0 !important;
        }
      }

      .woocommerce-customer-details {
        display: flex;
        flex-direction: column;
        gap: 0px;

        .woocommerce-column__title {
          background: #d6eaeb !important;
          color: #283b3c;
          font-size: 16px !important;
          font-weight: 600 !important;
          line-height: 24px !important;
          padding: 12px 16px !important;
          border-radius: 0.25rem 0.25rem 0 0 !important;
          border: none !important;
          margin-bottom: 0 !important;
        }

        address {
          flex-grow: 1;
          width: 100% !important;
          border: 1px solid #e5e5e5 !important;
          border-radius: 0 0 0.25rem 0.25rem !important;
          color: #283b3c !important;
          margin-top: 0 !important;
          font-size: 14px !important;
          line-height: 24px !important;
          font-weight: 400 !important;
          padding: 20px !important;
          background-color: transparent !important;
        }
      }

      .order-again {
        a {
          background: #f75d25 !important;
          color: #fff !important;
          padding: 0.5rem 1.5rem !important;
          border-radius: 0.25rem !important;
          font-weight: 600 !important;
          font-size: 14px !important;
          line-height: 20px !important;
          text-decoration: none !important;

          &:hover {
            background: hsl(16, 93%, 56%, 0.8) !important;
          }
        }
      }
    }
  }

  @media (min-width: 768px) {
    .eb-user-account__orders {
      .eb-orders__filter {
        flex-direction: row;

        .mantine-Select-root {
          max-width: 160px;
        }

        .mantine-TextInput-root {
          max-width: 280px;
        }
      }

      .eb-orders__pagination {
        flex-direction: row;
      }
    }
  }

  @media (min-width: 1024px) {
    .eb-order-details {
      .eb-order-details__woocommerce-content {
        .woocommerce-columns--addresses {
          grid-template-columns: repeat(2, 1fr);
        }
      }
    }
  }

  @keyframes slideInDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
