@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  font-weight: 400;

  --primary: #3B82F6;
  --primary-light: #60A5FA;
  --primary-dark: #1D4ED8;
  --secondary: #64748B;
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --error-light: #F87171;
  --text-primary: #1F2937;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8FAFC;
  --bg-tertiary: #F1F5F9;
  --border: #E5E7EB;
  --border-light: #F3F4F6;
  --border-focus: #3B82F6;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Wishlist page style variables - defaults from Controls.php */
  --wishlist-heading-title-size: 28px;
  --wishlist-heading-title-color: #000000;
  --wishlist-heading-text-size: 14px;
  --wishlist-heading-text-color: #000000;
  --wishlist-table-column-text-size: 14px;
  --wishlist-table-row-text-size: 14px;
  --wishlist-button-text-size: 14px;
  --wishlist-button-text-color: #FFFFFF;
  --wishlist-button-background-color: #3B82F6;

  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#saveto-wishlist-app {
  .stwlite-tw-wishlist-title {
    font-size: var(--wishlist-heading-title-size, 28px);
    font-weight: 700;
    color: var(--wishlist-heading-title-color, #000);
    margin-bottom: 10px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    @media (max-width: 480px) {
      font-size: 1.75rem;
    }
  }

  .stwlite-tw-subtitle {
    font-size: var(--wishlist-heading-text-size, 16px);
    color: var(--wishlist-heading-text-color, #000);
    margin-bottom: 1rem;
    font-weight: 300;
    text-align: center;

    @media (max-width: 480px) {
      font-size: 1rem;
    }
  }

  .saveto-wishlist-container {
    margin: 25px 0;
    display: flex;
    justify-content: center;

    &.stwlite-tw-item-wishlist {
      justify-content: space-between;
      align-items: center;

      .stwlite-tw-wishlist-item-links {
        display: flex;
        align-items: center;
        gap: 1rem;

        a {
          display: flex;
          align-items: center;
          gap: 0.5rem;
          font-size: 14px;
          font-weight: 500;
          cursor: pointer;
          transition: all 0.2s ease;
          white-space: nowrap;
          color: var(--text-secondary);

          &:hover {
            color: var(--primary);
          }

          &:active {
            transform: translateY(0);
          }

          &:focus {
            outline: 2px solid var(--primary-light);
            outline-offset: 2px;
          }

          svg {
            width: 16px;
            height: 16px;
          }
        }

        button {
          display: flex;
          align-items: center;
          gap: 0.5rem;
          font-size: 14px;
          font-weight: 500;
          cursor: pointer;
          transition: all 0.2s ease;
          white-space: nowrap;
          color: var(--text-secondary);

          &:hover {
            color: var(--primary);
          }

          &:active {
            transform: translateY(0);
          }

          &:focus {
            outline: 2px solid var(--primary-light);
            outline-offset: 2px;
          }

          svg {
            width: 16px;
            height: 16px;
          }
        }

        .stwlite-tw-wishlist-add-item-btn {
          padding: 0.5rem 1rem;
          border-radius: 0.25rem;
          font-size: var(--wishlist-button-text-size, 14px);
          font-weight: 500;
          text-transform: uppercase;
          white-space: nowrap;
          text-decoration: none !important;
          background: var(--wishlist-button-background-color, var(--primary));
          color: var(--wishlist-button-text-color, var(--bg-primary));
          cursor: pointer;
          transition: all 0.2s ease;

          &:hover {
            background: var(--primary-light);
            color: var(--wishlist-button-text-color, var(--bg-primary));
          }

          &:focus {
            outline: none;
          }
        }
      }

      .stwlite-tw-wishlist-item-pro-top-links {
        display: flex;
        align-items: center;
        gap: 0.5rem;
      }

      @media (max-width: 768px) {
        flex-direction: column;
        gap: 1rem;
      }
    }

    .stwlite-tw-search-wrapper {
      position: relative;
      width: 100%;
      max-width: 280px;
      transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

      .stwlite-tw-search-icon {
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
        width: 20px;
        height: 20px;
        color: var(--text-secondary);
        transition: color 0.3s ease;
        pointer-events: none;
        z-index: 2;
      }

      .stwlite-tw-clear-button {
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%) scale(0);
        width: 22px;
        height: 22px;
        border: none;
        background: var(--bg-tertiary);
        color: var(--text-secondary);
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        opacity: 0;
        font-size: 16px;
        line-height: 1;
        padding: 0;

        // Keeps the tap target at the accessible minimum even though the
        // visual circle above is smaller than 24px. The left edge is held back
        // so the hit area does not swallow clicks meant to place the caret in
        // the input's text.
        &::after {
          content: '';
          position: absolute;
          inset: -6px -6px -6px -2px;
        }

        &:hover {
          background: var(--text-secondary);
          transform: translateY(-50%) scale(1.1);
          color: #fff;
        }

        &:active {
          transform: translateY(-50%) scale(0.95);
        }
      }

      &.stwlite-tw-has-content {
        .stwlite-tw-clear-button {
          transform: translateY(-50%) scale(1);
          opacity: 1;
        }
      }

      &:focus-within {
        max-width: 400px;

        .stwlite-tw-search-icon {
          color: var(--primary);
        }
      }

      .stwlite-tw-search-input {
        width: 100%;
        height: 40px;
        padding: 0 3rem 0 3.5rem;
        background: var(--bg-primary);
        border: 2px solid var(--border);
        border-radius: 28px;
        font-size: 14px;
        font-weight: 400;
        color: var(--text-primary);
        outline: none;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: var(--shadow-sm);

        &::placeholder {
          color: var(--text-secondary);
          font-weight: 400;
        }

        &:hover {
          border-color: var(--primary-light);
          box-shadow: var(--shadow-md);
        }

        &:focus {
          border-color: var(--border-focus);
          box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), var(--shadow-lg);
          transform: translateY(-1px);
        }
      }

      @media (max-width: 768px) {
        max-width: none;
      }
    }
  }

  .stwlite-tw-table-wrapper {
    position: relative;

    &.stwlite-tw-is-loading {
      // Keep the previous rows in place so the container height does not
      // collapse while the next result set is being fetched.
      > *:not(.stwlite-tw-table-loading-overlay) {
        opacity: 0.5;
        pointer-events: none;
      }
    }

    .stwlite-tw-table-loading-overlay {
      position: absolute;
      inset: 0;
      z-index: 4;
      display: flex;
      align-items: center;
      justify-content: center;
      // Themed so the overlay follows a dark page style instead of washing it
      // out with a hardcoded white. The rgba line is the fallback for browsers
      // without color-mix().
      background: rgba(255, 255, 255, 0.6);
      background: color-mix(in srgb, var(--bg-primary) 60%, transparent);
      color: var(--text-secondary);
    }

    .stwlite-tw-table-container {
      background: var(--bg-primary);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-sm);
      border: 1px solid var(--border-light);
      margin-bottom: 1.5rem;
      overflow-x: scroll;

      .stwlite-tw-data-table {
        width: 100%;
        border-collapse: collapse;
        font-size: var(--wishlist-table-row-text-size, 14px);

        > thead {
          background: var(--bg-tertiary);

          th {
            padding: 1rem;
            text-align: left;
            font-weight: 600;
            color: var(--text-primary);
            border-bottom: 1px solid var(--border);
            white-space: nowrap;
            font-size: var(--wishlist-table-column-text-size, 14px);

            &.sortable {
              cursor: pointer;
              user-select: none;
              position: relative;
              transition: background-color 0.2s ease;

              &:hover {
                background: var(--border-light);
              }

              .stwlite-tw-sort-header-button {
                display: inline-flex;
                align-items: center;
                width: 100%;
                padding: 0;
                margin: 0;
                border: 0;
                background: transparent;
                color: inherit;
                font: inherit;
                text-align: inherit;
                cursor: pointer;
              }

              .stwlite-tw-sort-icon {
                width: 16px;
                height: 16px;
                margin-left: 0.5rem;
                opacity: 0.5;
                transition: all 0.2s ease;
                transform: rotate(0deg);
              }

              &.sort-asc {
                .stwlite-tw-sort-icon {
                  opacity: 1;
                  color: var(--primary);
                  transform: rotate(180deg);
                }
              }

              &.sort-desc {
                .stwlite-tw-sort-icon {
                  opacity: 1;
                  color: var(--primary);
                  transform: rotate(0deg);
                }
              }
            }

          }
        }

        > tbody > tr > td {
          padding: 1rem;
          border-bottom: 1px solid var(--border-light);
          color: var(--text-secondary);
          vertical-align: middle;
          font-size: 14px;

          .stwlite-tw-wishlist-item-variation-select {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            width: 100%;
            max-width: 100px;
            padding: 0.5rem;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            background-color: var(--bg-primary);
            color: var(--text-secondary);
            font-size: 14px;
            cursor: pointer;
            transition: all 0.2s ease;

            &:hover {
              border-color: var(--primary-light);
            }

            &:focus {
              border-color: var(--border-focus);
              box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1), var(--shadow-lg);
              transform: translateY(-1px);
            }

            option {
              background-color: var(--bg-primary);
              color: var(--text-secondary);
              font-size: 14px;
            }

            label {
              font-size: 14px;
              font-weight: 600;
              color: var(--text-primary);
              margin-bottom: 0.5rem;
            }
          }
        }

        > tbody {
          > tr {
            transition: background-color 0.2s ease;

            &:hover {
              background: var(--bg-secondary);
            }

            &:last-child {
              > td {
                border-bottom: none;
              }
            }
          }
        }

        @media (max-width: 768px) {
          min-width: 600px;
        }
      }

      @media (max-width: 768px) {
        overflow-x: auto;
      }
    }

    .stwlite-tw-table-footer {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 1rem;
      flex-wrap: wrap;

      .stwlite-tw-table-info {
        font-size: 14px;
        color: var(--text-secondary);
      }

      @media (max-width: 768px) {
        flex-direction: column;
        text-align: center;
      }
    }
  }

  @media (max-width: 480px) {
    padding: 1rem 0.5rem;
  }
}

/* Buttons */
.stwlite-tw-table-btn {
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  font-size: var(--wishlist-button-text-size, 14px);
  font-weight: 500;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none !important;

  &.stwlite-tw-table-btn-add-to-cart-button {
    background: var(--wishlist-button-background-color, var(--primary));
    color: var(--wishlist-button-text-color, var(--bg-primary));

    &:hover {
      background: var(--primary-light);
    }

    &:disabled,
    &[disabled] {
      opacity: 0.5;
      cursor: not-allowed;
      pointer-events: auto;
    }
  }

  &.stwlite-tw-table-btn-delete-product-button {
    background: var(--error);
    color: var(--bg-primary);

    &:hover {
      background: var(--error-light);
    }
  }
}

/* Quantity stepper */
.stwlite-tw-quantity-stepper {
  display: inline-flex;
  align-items: stretch;

  .stwlite-tw-quantity-input {
    width: 50px;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 0;
    text-align: center;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-primary);
    outline: none;
    background: var(--bg-primary);
    transition: all 0.2s ease;
    -moz-appearance: textfield;
    margin: 0 -1px;
    position: relative;

    &::-webkit-outer-spin-button,
    &::-webkit-inner-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }

    &:hover {
      border-color: var(--primary-light);
      z-index: 1;
    }

    &:focus {
      border-color: var(--border-focus);
      box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
      z-index: 1;
    }
  }

  .stwlite-tw-quantity-stepper-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 0 0.5rem;
    border: 1px solid var(--border);
    border-radius: 0;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;

    &:hover:not(:disabled) {
      border-color: var(--primary-light);
      background: var(--bg-secondary);
      z-index: 1;
    }

    &:focus {
      outline: none;
      border-color: var(--border-focus);
      box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
      z-index: 1;
    }

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

  // Touch-friendly tap targets on coarse pointers (WCAG 2.5.5 AAA: 44×44).
  @media (pointer: coarse), (max-width: 768px) {
    .stwlite-tw-quantity-stepper-btn {
      min-width: 44px;
      min-height: 44px;
    }

    .stwlite-tw-quantity-input {
      min-height: 44px;
    }
  }
}

/* Tiered pricing table — mirrors the Tiered Pricing Table plugin's default style */
.tiered-pricing-wrapper {
  margin-top: 0.5rem;

  .stwlite-tw-tiered-pricing-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    color: var(--text-secondary);

    tr {
      background: #fff;
    }

    th,
    td {
      padding: 0.25rem 0.5rem;
      text-align: left;
      border: 1px solid var(--border);
    }

    th {
      font-weight: 600;
      color: var(--text-primary);
      background: var(--bg-secondary);
    }

    .tiered-pricing--active td {
      background-color: #3858e9;
      color: #fff;
      transition: all 0.3s ease-in-out;

      .amount,
      .woocommerce-Price-amount {
        color: #fff;
      }
    }
  }
}

/* Dropdown menu styles */
.stwlite-tw-dropdown-menu-container {
  position: relative;

  .stwlite-tw-dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    width: 12rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    padding: 0.25rem 0;

    .stwlite-tw-dropdown-item {
      display: block;
      padding: 0.5rem 1rem;
      font-size: 14px;
      color: var(--text-secondary);
      text-decoration: none;
      transition: all 0.2s ease;

      &:hover {
        background-color: var(--bg-secondary);
        color: var(--text-primary);
      }

      &.stwlite-tw-dropdown-item-danger {
        color: var(--error);

        &:hover {
          background-color: rgba(239, 68, 68, 0.1);
          color: var(--error-light);
        }
      }

      &.stwlite-tw-dropdown-item-link {
        &:hover {
          background-color: var(--bg-secondary);
          color: var(--text-primary);
        }
      }

      .stwlite-tw-dropdown-icon {
        width: 1rem;
        height: 1rem;
        margin-right: 0.5rem;
        flex-shrink: 0;
      }
    }
  }
}

/* Badges */
.stwlite-tw-role-badge,
.stwlite-tw-status-item-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  margin-right: 0.5rem;

  &.stwlite-tw-status-item-publish {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
  }

  &.stwlite-tw-status-item-draft {
    background: rgba(107, 114, 128, 0.1);
    color: #4B5563;
  }

  &.stwlite-tw-status-item-default {
    background: rgba(245, 158, 11, 0.1);
    color: #F59E0B;
  }

  &.stwlite-tw-status-item-public {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
  }

  &.stwlite-tw-status-item-registry {
    background: rgba(168, 85, 247, 0.1);
    color: #A855F7;
  }
}

/* Pagination */
.stwlite-tw-pagination {
  display: flex;
  align-items: center;
  gap: 0.5rem;

  @media (max-width: 640px) {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
  }

  .stwlite-tw-pagination-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--wishlist-button-background-color, var(--bg-primary));
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--wishlist-button-text-color, var(--text-secondary));
    font-size: var(--wishlist-button-text-size, 14px);
    cursor: pointer;
    transition: all 0.2s ease;
    height: 36px;
    white-space: nowrap;

    &:hover:not(:disabled) {
      background: var(--bg-secondary);
      border-color: var(--primary);
      color: var(--primary);
    }

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

    svg {
      width: 16px;
      height: 16px;
      flex-shrink: 0;
    }

    .stwlite-tw-pagination-btn-text {
      @media (max-width: 480px) {
        display: none;
      }
    }

    @media (max-width: 480px) {
      padding: 0.5rem;
      font-size: 0.75rem;
      min-width: 36px;
      justify-content: center;
    }
  }

  .stwlite-tw-pagination-numbers {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    justify-content: center;

    .stwlite-tw-pagination-number {
      width: 45px;
      height: 36px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--bg-primary);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      color: var(--wishlist-button-text-color, var(--text-secondary));
      font-size: var(--wishlist-button-text-size, 14px);
      cursor: pointer;
      transition: all 0.2s ease;
      flex-shrink: 0;
      text-wrap: nowrap;

      &:hover:not(.active) {
        opacity: 1 !important;
        border-color: var(--primary);
      }

      &.active {
        background: var(--wishlist-button-background-color, var(--primary));
        border-color: var(--wishlist-button-background-color, var(--primary));
        color: var(--wishlist-button-text-color, white);
        opacity: 0.8 !important;
        cursor: not-allowed;
      }

      @media (max-width: 480px) {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
      }
    }

    .stwlite-tw-pagination-ellipsis {
      width: 36px;
      height: 36px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-secondary);
      font-size: 0.875rem;
      user-select: none;
      flex-shrink: 0;

      @media (max-width: 480px) {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
      }
    }
  }

  .stwlite-tw-items-per-page {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;

    label {
      font-size: 14px;
      color: var(--text-secondary);

      @media (max-width: 480px) {
        font-size: 0.875rem;
      }
    }

    select {
      height: 36px;
      max-width: 100px;
      min-width: 60px;
      padding: 5px 8px;
      border-radius: 5px;
      border: 1px solid var(--border-light);
      background-color: var(--bg-primary);
      color: var(--text-secondary);
      font-size: 14px;
      cursor: pointer;

      @media (max-width: 480px) {
        font-size: 0.875rem;
        padding: 4px 6px;
        height: 32px;
      }
    }

    @media (max-width: 640px) {
      width: 100%;
      justify-content: center;
    }
  }
}

.stwlite-tw-table-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;

  .stwlite-tw-social-share {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    margin-left: auto;
  }

  .stwlite-tw-social-share-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;

    svg {
      width: 16px;
      height: 16px;
    }

    &:hover {
      background: var(--bg-secondary);
      border-color: var(--primary);
      color: var(--primary);
    }

    &:focus {
      outline: 2px solid var(--primary);
      outline-offset: 2px;
    }

    &:active {
      transform: translateY(0);
    }

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

.stwlite-tw-wishlist-items-actions {
  display: flex;
  gap: 0.25rem;
  align-items: center;

  .stwlite-tw-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    font-size: 12px;

    &:focus {
      outline: none;
    }

    svg {
      width: 16px;
      height: 16px;
    }

    &.stwlite-tw-view-btn {
      &:hover {
        background: rgba(59, 130, 246, 0.1);
        border-color: var(--primary);
        color: var(--primary);
        transform: translateY(-1px);
      }
    }

    &.stwlite-tw-edit-btn {
      &:hover {
        background: rgba(245, 158, 11, 0.1);
        border-color: #F59E0B;
        color: #F59E0B;
        transform: translateY(-1px);
      }
    }

    &.stwlite-tw-delete-btn {
      &:hover {
        background: rgba(239, 68, 68, 0.1);
        border-color: #EF4444;
        color: #EF4444;
        transform: translateY(-1px);
      }
    }

    &.stwlite-tw-more-actions-btn {
      &:hover {
        background: var(--bg-secondary);
        border-color: var(--primary);
        color: var(--primary);
        transform: translateY(-1px);
      }
    }

    &.stwlite-tw-convert-registry-btn {
      &:hover {
        background: rgba(99, 102, 241, 0.1);
        border-color: #6366F1;
        color: #6366F1;
        transform: translateY(-1px);
      }
    }

    &:active {
      transform: translateY(0);
    }
  }
}

.saveto-wishlist-empty-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem;
  text-align: center;

  h2 {
    font-size: 24px;
    font-weight: 700;
    color: #000;
    margin-bottom: 10px;
    text-align: center;
  }
}

.saveto-wishlist-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;

  .saveto-wishlist-popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    max-width: calc(100% - 2rem);
    max-height: 90vh;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-primary);
  }

  .saveto-wishlist-popup-content-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .saveto-wishlist-popup-content-form-input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
  }

  .share-email-input {
    width: 80%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
  }

  .share-email-add-btn {
    width: 20%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
  }

  .saveto-wishlist-popup-content-form-textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
  }

  .saveto-wishlist-popup-content-form-select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    height: auto;
  }

  .saveto-wishlist-popup-content-form-multiple-select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    height: auto;
  }

  .saveto-wishlist-popup-content-form-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);

    h3 {
      margin-bottom: 12px;
      font-size: 14px;
      font-weight: 600;
      color: var(--text-primary);
    }

    >div {
      margin-bottom: 1rem;

      &:last-child {
        margin-bottom: 0;
      }
    }

    label {
      display: block;
      margin-bottom: 8px;
      font-size: 13px;
      font-weight: 500;
      color: var(--text-primary);
    }

    .saveto-wishlist-popup-content-form-input {
      flex: 1;
    }

    .stwl-popup-section-item-with-clear {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 8px;
      justify-content: space-between;

      button {
        font-size: 12px;
      }
    }
  }

  .saveto-wishlist-popup-email-input-container {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
  }

  .saveto-wishlist-popup-email-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
  }

  .saveto-wishlist-popup-email-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: #f3f4f6;
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-primary);

    button {
      background: none;
      border: none;
      cursor: pointer;
      padding: 0;
      color: #6b7280;
      font-size: 16px;
      line-height: 1;
      transition: color 0.2s ease;

      &:hover {
        color: #ef4444;
      }
    }
  }

  .stwlite-tw-remove-tag-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #6b7280;
    font-size: 16px;
    line-height: 1;
    transition: color 0.2s ease;

    &:hover {
      color: #ef4444;
    }
  }

  .saveto-wishlist-popup-button-small {
    padding: 8px 16px;
    white-space: nowrap;
  }

  .saveto-wishlist-popup-content-form-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .saveto-wishlist-popup-content-form-checkbox-input {
    width: 16px;
    height: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
  }

  .saveto-wishlist-popup-content-form-button {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);

    background: var(--primary);
    color: var(--bg-primary);

    &:hover {
      background: var(--primary-light);
    }
  }

  .saveto-wishlist-popup-content-form-button-cancel {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);

    background: var(--error);
    color: var(--bg-primary);

    &:hover {
      background: var(--error-light);
    }
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .stwlite-tw-items-per-page {
    justify-content: center;
  }

  .stwlite-tw-data-table > thead > tr > th,
  .stwlite-tw-data-table > tbody > tr > td {
    padding: 0.75rem 0.5rem;
  }

  .stwlite-tw-data-table > tbody > tr > td {
    font-size: var(--wishlist-table-row-text-size, 14px);
  }
}

/* Loading and Empty States */
.stwlite-tw-loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.stwlite-tw-empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

/* Tooltip */
.stwlite-tw-tooltip-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.stwlite-tw-tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #6b7280;
  cursor: help;
  transition: color 0.2s ease;
}

.stwlite-tw-tooltip-icon:hover,
.stwlite-tw-tooltip-icon:focus {
  color: #374151;
  outline: none;
}

.stwlite-tw-tooltip-icon svg {
  width: 100%;
  height: 100%;
}

.stwlite-tw-tooltip-content {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 8px 12px;
  background-color: #1f2937;
  color: #ffffff;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 6px;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 1000;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  width: 200px;
}

.stwlite-tw-tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #1f2937;
}

.stwlite-tw-tooltip-icon:hover+.stwlite-tw-tooltip-content,
.stwlite-tw-tooltip-icon:focus+.stwlite-tw-tooltip-content {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-4px);
}

@media (max-width: 640px) {
  .stwlite-tw-tooltip-content {
    white-space: normal;
    max-width: 200px;
  }
}

/* Copy Text */
.stwlite-tw-copy-text-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background-color: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.stwlite-tw-copy-text-container:hover {
  background-color: #e5e7eb;
}

.stwlite-tw-copy-text-content {
  flex: 1;
  color: #374151;
  word-break: break-all;
}

.stwlite-tw-copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.2s ease, background-color 0.2s ease;
  flex-shrink: 0;
}

.stwlite-tw-copy-button:hover {
  color: #374151;
  background-color: #d1d5db;
}

.stwlite-tw-copy-button:active {
  transform: scale(0.95);
}

.stwlite-tw-copy-button:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.stwlite-tw-copy-button svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s ease;
}

.stwlite-tw-copy-button svg:last-child {
  color: #10b981;
}

/* Focus styles for accessibility */
.stwlite-tw-pagination-btn:focus,
.stwlite-tw-pagination-number:focus,
.stwlite-tw-search-input:focus,
.stwlite-tw-items-per-page select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

[draggable="true"] {
  cursor: move;
}

.drop-above {
  box-shadow: 0 -3px 0 0 #3b82f6 inset;
}

.drop-below {
  box-shadow: 0 3px 0 0 #3b82f6 inset;
}

.saveto-wishlist-public-lists-wrapper {
  margin-top: 60px;

  // Responsive
  @media (max-width: 768px) {
    margin-top: 40px;
  }
}

.stwlite-tw-product-thumbnail {
  width: 50px;
  height: 50px;
  object-fit: cover;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}