/* StoreDisplay - Floating Cart & Side Drawer Styles */

// CSS Variables fallback
:root {
  --wcps-cart-drawer-width: 420px;
  --wcps-cart-accent: #0170B9;
  --wcps-cart-btn-color: #0170B9;
  --wcps-cart-btn-text: #ffffff;
}

/* 1. Floating Cart Launcher */
#wcps-floating-cart-launcher {
  position: fixed;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease;
  user-select: none;

  &:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
  }

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

  .wcps-cart-launcher-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;

    i {
      font-size: 1.35rem;
    }
  }

  /* Badge */
  .wcps-cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: #ff3b30;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
    display: inline-block;
    transition: transform 0.2s ease;

    &.has-items {
      animation: wcpsBadgePop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
  }

  /* Position variants */
  &.wcps-cart-pos-bottom-right { bottom: 28px; right: 28px; }
  &.wcps-cart-pos-bottom-left { bottom: 28px; left: 28px; }
  &.wcps-cart-pos-top-right { top: 28px; right: 28px; }
  &.wcps-cart-pos-top-left { top: 28px; left: 28px; }
  &.wcps-cart-pos-middle-right { top: 50%; right: 20px; transform: translateY(-50%); }
  &.wcps-cart-pos-middle-left { top: 50%; left: 20px; transform: translateY(-50%); }

  /* Style variants */
  &.wcps-cart-style-circle { border-radius: 50%; }
  &.wcps-cart-style-square { border-radius: 10px; }
  &.wcps-cart-style-pill { border-radius: 30px; padding: 0 16px; }

  /* Size variants */
  &.wcps-cart-size-small { width: 46px; height: 46px; }
  &.wcps-cart-size-medium { width: 56px; height: 56px; }
  &.wcps-cart-size-large { width: 66px; height: 66px; }

  &.wcps-bounce {
    animation: wcpsLauncherBounce 0.7s ease;
  }
}

@keyframes wcpsBadgePop {
  0% { transform: scale(0.6); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

@keyframes wcpsLauncherBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-12px) scale(1.1); }
  60% { transform: translateY(-4px) scale(1.03); }
}

/* 2. Side Cart Drawer Overlay & Panel */
body.wcps-drawer-active {
  overflow: hidden !important;
}

#wcps-side-cart-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999999;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0.35s ease;

  /* Backdrop */
  .wcps-side-cart-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 1;
  }

  /* Panel */
  .wcps-side-cart-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    max-width: var(--wcps-cart-drawer-width, 420px);
    background: #ffffff;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.2);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2;
  }

  &.wcps-drawer-right .wcps-side-cart-panel {
    right: 0;
    left: auto;
    transform: translateX(100%);
  }

  &.wcps-drawer-left .wcps-side-cart-panel {
    left: 0;
    right: auto;
    transform: translateX(-100%);
  }

  &.is-open {
    visibility: visible;
    pointer-events: auto;

    .wcps-side-cart-backdrop {
      opacity: 1;
      pointer-events: auto;
    }

    .wcps-side-cart-panel {
      transform: translateX(0) !important;
      pointer-events: auto;
    }
  }
}

/* 3. Header */
.wcps-cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #f1f5f9;
  background: #ffffff;

  .wcps-cart-header-title {
    display: flex;
    align-items: center;
    gap: 10px;

    i {
      color: var(--wcps-cart-accent, #0170B9);
      font-size: 1.25rem;
    }

    h3 {
      margin: 0;
      font-size: 1.15rem;
      font-weight: 700;
      color: #0f172a;
    }

    .wcps-header-count {
      color: #64748b;
      font-size: 0.95rem;
      font-weight: 600;
    }
  }

  .wcps-cart-close {
    background: transparent;
    border: none;
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 1.1rem;
    transition: background 0.2s, color 0.2s;

    &:hover {
      background: #f1f5f9;
      color: #0f172a;
    }
  }
}

/* 4. Free Shipping Bar */
.wcps-free-shipping-container {
  padding: 14px 24px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;

  .wcps-shipping-message {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
    text-align: center;

    .wcps-ship-unlocked {
      color: #10b981;
      font-weight: 700;
    }
  }

  .wcps-shipping-progress {
    height: 7px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;

    .wcps-shipping-progress-fill {
      height: 100%;
      background: linear-gradient(90deg, #0170B9, #0ea5e9);
      border-radius: 10px;
      transition: width 0.4s ease;

      &.unlocked {
        background: linear-gradient(90deg, #10b981, #059669);
      }
    }
  }
}

/* 5. Cart Body & Items List */
.wcps-cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;

  &::-webkit-scrollbar {
    width: 5px;
  }
  &::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
  }
}

.wcps-cart-item {
  display: flex;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid #f1f5f9;
  transition: opacity 0.3s, background 0.2s;

  &.wcps-loading-shade {
    opacity: 0.4;
    pointer-events: none;
  }

  &.wcps-item-removing {
    opacity: 0;
    transform: scale(0.9);
  }

  .wcps-item-thumb {
    width: 68px;
    height: 68px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;

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

  .wcps-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;

    .wcps-item-title-row {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 10px;

      .wcps-item-title {
        margin: 0;
        font-size: 0.95rem;
        font-weight: 600;
        line-height: 1.35;

        a {
          color: #1e293b;
          text-decoration: none;
          &:hover {
            color: var(--wcps-cart-accent, #0170B9);
          }
        }
      }

      .wcps-item-remove {
        background: transparent;
        border: none;
        cursor: pointer;
        color: #94a3b8;
        padding: 4px;
        font-size: 0.85rem;
        transition: color 0.2s;

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

    .wcps-item-meta {
      font-size: 0.8rem;
      color: #64748b;
      margin: 4px 0;
    }

    .wcps-item-bottom {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-top: 8px;

      .wcps-item-qty {
        display: inline-flex;
        align-items: center;
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        overflow: hidden;
        background: #ffffff;

        .wcps-qty-btn {
          width: 28px;
          height: 28px;
          background: #f8fafc;
          border: none;
          cursor: pointer;
          font-weight: 700;
          color: #475569;
          display: flex;
          align-items: center;
          justify-content: center;
          transition: background 0.15s;

          &:hover {
            background: #e2e8f0;
          }
        }

        .wcps-qty-input {
          width: 36px;
          height: 28px;
          border: none;
          text-align: center;
          font-size: 0.85rem;
          font-weight: 600;
          color: #0f172a;
          -moz-appearance: textfield;

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

      .wcps-item-price {
        font-weight: 700;
        font-size: 0.95rem;
        color: #0f172a;
      }
    }
  }
}

/* 6. Upsells in Drawer */
.wcps-cart-upsells {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed #cbd5e1;

  .wcps-upsells-heading {
    font-size: 0.9rem;
    font-weight: 700;
    color: #334155;
    margin: 0 0 12px 0;
  }

  .wcps-upsells-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;

    .wcps-upsell-card {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 8px 10px;
      background: #f8fafc;
      border-radius: 8px;
      border: 1px solid #f1f5f9;

      .wcps-upsell-thumb {
        width: 44px;
        height: 44px;
        border-radius: 6px;
        overflow: hidden;
        flex-shrink: 0;

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

      .wcps-upsell-details {
        flex: 1;
        overflow: hidden;

        .wcps-upsell-title {
          display: block;
          font-size: 0.85rem;
          font-weight: 600;
          color: #1e293b;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
        }

        .wcps-upsell-price {
          font-size: 0.8rem;
          color: var(--wcps-cart-accent, #0170B9);
          font-weight: 700;
        }
      }

      .wcps-btn-upsell-add {
        padding: 5px 12px;
        background: #ffffff;
        border: 1px solid #cbd5e1;
        color: #0f172a;
        font-size: 0.8rem;
        font-weight: 600;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.2s ease;

        &:hover {
          background: var(--wcps-cart-accent, #0170B9);
          color: #ffffff;
          border-color: var(--wcps-cart-accent, #0170B9);
        }
      }
    }
  }
}

/* 7. Empty Cart State */
.wcps-cart-empty {
  padding: 48px 16px;
  text-align: center;

  .wcps-cart-empty-icon {
    font-size: 3.5rem;
    color: #cbd5e1;
    margin-bottom: 16px;
  }

  h4 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #334155;
    margin: 0 0 20px 0;
  }

  .wcps-btn-continue-shopping {
    display: inline-block;
    padding: 10px 24px;
    background: var(--wcps-cart-accent, #0170B9);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 8px;
    text-decoration: none;
    transition: opacity 0.2s;

    &:hover {
      opacity: 0.9;
      color: #ffffff;
    }
  }
}

/* 8. Footer: Subtotal, Coupon & Buttons */
.wcps-cart-footer {
  padding: 18px 24px;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.04);

  .wcps-cart-coupon-box {
    margin-bottom: 14px;

    .wcps-coupon-toggle {
      font-size: 0.82rem;
      font-weight: 600;
      color: #64748b;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 6px;
      user-select: none;
      transition: color 0.15s ease;

      &:hover { color: var(--wcps-cart-accent, #0170B9); }

      i.fa-tag {
        color: var(--wcps-cart-accent, #0170B9);
        font-size: 0.82rem;
      }

      .wcps-toggle-chevron {
        margin-left: auto;
        font-size: 0.7rem;
        color: #94a3b8;
        transition: transform 0.2s ease;
      }

      &.is-active .wcps-toggle-chevron {
        transform: rotate(180deg);
      }
    }

    .wcps-coupon-form {
      display: flex;
      gap: 8px;
      margin-top: 8px;

      .wcps-coupon-input {
        flex: 1;
        padding: 7px 12px;
        border: 1px solid #cbd5e1;
        border-radius: 6px;
        font-size: 0.85rem;
      }

      .wcps-coupon-submit {
        padding: 7px 16px;
        background: #334155;
        color: #ffffff;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        font-size: 0.85rem;
        font-weight: 600;
        &:hover { background: #0f172a; }
      }
    }

    .wcps-coupon-message {
      font-size: 0.8rem;
      margin-top: 6px;
      &.success { color: #10b981; }
      &.error { color: #ef4444; }
    }
    .wcps-suggested-coupons {
      margin-top: 10px;
      padding-top: 10px;
      border-top: 1px dashed #e2e8f0;

      .wcps-suggested-toggle {
        font-size: 0.82rem;
        font-weight: 600;
        color: #64748b;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 6px;
        user-select: none;
        transition: color 0.15s ease;

        &:hover { color: var(--wcps-cart-accent, #0170B9); }

        i.fa-ticket-alt {
          color: var(--wcps-cart-accent, #0170B9);
          font-size: 0.82rem;
        }

        .wcps-toggle-chevron {
          margin-left: auto;
          font-size: 0.7rem;
          color: #94a3b8;
          transition: transform 0.2s ease;
        }

        &.is-active .wcps-toggle-chevron {
          transform: rotate(180deg);
        }
      }

      .wcps-suggested-chips-list {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 8px;
      }

      .wcps-coupon-chip {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: #f8fafc;
        border: 1px dashed var(--wcps-cart-accent, #0170B9);
        border-radius: 6px;
        padding: 5px 10px;
        cursor: pointer;
        transition: all 0.2s ease;
        text-align: left;

        .wcps-chip-badge {
          background: rgba(1, 112, 185, 0.1);
          color: var(--wcps-cart-accent, #0170B9);
          font-size: 0.72rem;
          font-weight: 700;
          padding: 1px 6px;
          border-radius: 4px;
        }

        .wcps-chip-code {
          font-family: monospace;
          font-size: 0.82rem;
          color: #0f172a;
          letter-spacing: 0.5px;
        }

        .wcps-chip-action {
          font-size: 0.72rem;
          font-weight: 600;
          color: var(--wcps-cart-accent, #0170B9);
          margin-left: 2px;
        }

        &:hover:not(.applied) {
          background: #eff6ff;
          border-style: solid;
          transform: translateY(-1px);
          box-shadow: 0 2px 6px rgba(1, 112, 185, 0.15);
        }

        &.applied {
          background: #ecfdf5;
          border-color: #10b981;
          border-style: solid;
          cursor: default;

          .wcps-chip-badge {
            background: rgba(16, 185, 129, 0.15);
            color: #059669;
          }

          .wcps-chip-code {
            color: #065f46;
          }

          .wcps-chip-action {
            color: #059669;
          }
        }
      }
    }
  }

  .wcps-cart-totals {
    margin-bottom: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;

    .wcps-cart-subtotal-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 0.95rem;
      font-weight: 600;
      color: #475569;
    }

    .wcps-cart-discounts-wrapper {
      margin-top: 6px;
      padding-top: 6px;
      border-top: 1px dashed #e2e8f0;

      .wcps-cart-discount-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 0.88rem;
        color: #059669;
        margin-bottom: 4px;

        .wcps-discount-label {
          display: flex;
          align-items: center;
          gap: 6px;
          font-weight: 600;
        }

        .wcps-discount-value {
          font-weight: 700;
          margin-left: auto;
          margin-right: 8px;
        }

        .wcps-btn-remove-coupon {
          background: transparent;
          border: none;
          color: #ef4444;
          font-size: 1.1rem;
          line-height: 1;
          cursor: pointer;
          padding: 0 4px;
          border-radius: 3px;
          transition: background 0.15s;

          &:hover {
            background: #fee2e2;
          }
        }
      }
    }

    .wcps-cart-total-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 8px;
      padding-top: 8px;
      border-top: 1px solid #e2e8f0;
      font-size: 1.12rem;
      font-weight: 700;
      color: #0f172a;

      .wcps-cart-total-amount-wrap {
        display: flex;
        align-items: center;
        gap: 8px;

        del.wcps-cart-original-total {
          font-size: 0.92rem;
          color: #94a3b8;
          text-decoration: line-through;
          font-weight: 500;
        }

        .wcps-cart-final-total {
          color: var(--wcps-cart-accent, #0170B9);
        }
      }
    }

    .wcps-cart-tax-notice {
      margin: 6px 0 0 0;
      font-size: 0.78rem;
      color: #94a3b8;
    }
  }

  .wcps-cart-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;

    .wcps-btn-checkout {
      display: block;
      width: 100%;
      padding: 13px 0;
      text-align: center;
      background: var(--wcps-cart-btn-color, #0170B9);
      color: var(--wcps-cart-btn-text, #ffffff) !important;
      font-size: 1rem;
      font-weight: 700;
      border-radius: 8px;
      text-decoration: none;
      box-shadow: 0 4px 12px rgba(1, 112, 185, 0.25);
      transition: transform 0.2s, box-shadow 0.2s;

      &:hover {
        transform: translateY(-1px);
        box-shadow: 0 6px 16px rgba(1, 112, 185, 0.35);
      }
    }

    button.wcps-btn-checkout,
    button.wcps-btn-complete-order {
      border: none;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;

      &.wcps-btn-loading {
        opacity: 0.8;
        cursor: not-allowed;
      }
    }

    .wcps-btn-view-cart {
      display: block;
      width: 100%;
      padding: 10px 0;
      text-align: center;
      background: #f8fafc;
      border: 1px solid #e2e8f0;
      color: #475569 !important;
      font-size: 0.9rem;
      font-weight: 600;
      border-radius: 8px;
      text-decoration: none;
      transition: background 0.2s;

      &:hover {
        background: #f1f5f9;
        color: #0f172a !important;
      }
    }

    .wcps-btn-scroll-checkout {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 12px 18px;
      text-align: center;
      background: var(--wcps-cart-btn-color, #0170B9);
      color: var(--wcps-cart-btn-text, #ffffff) !important;
      font-size: 0.95rem;
      font-weight: 700;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      transition: opacity 0.2s, transform 0.15s;

      &:hover {
        opacity: 0.92;
        transform: translateY(-1px);
      }
    }
  }
}

/* 7. One-Click Direct Checkout & Auto-Fill in Side Cart */
#wcps-side-cart-drawer.has-one-click-checkout {
  .wcps-side-cart-panel {
    width: min(540px, 100vw) !important;
  }
}

.wcps-embedded-checkout-section {
  margin-top: 20px;
  padding: 18px 0 10px 0;
  border-top: 1px dashed #cbd5e1;

  .wcps-checkout-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;

    i {
      color: var(--wcps-cart-accent, #0170B9);
      font-size: 1.1rem;
    }

    h5 {
      margin: 0;
      font-size: 1.05rem;
      font-weight: 700;
      color: #0f172a;
    }
  }

  .wcps-section-subheading {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 16px 0 10px 0;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;

    i {
      color: var(--wcps-cart-accent, #0170B9);
    }
  }

  /* Auto-Fill Banner */
  .wcps-autofill-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    border: 1px solid #bfdbfe;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;

    .wcps-autofill-info {
      display: flex;
      align-items: center;
      gap: 7px;
      font-size: 0.85rem;
      font-weight: 600;
      color: #1e40af;

      i {
        color: #f59e0b;
        font-size: 1rem;
      }
    }

    .wcps-autofill-actions {
      display: flex;
      align-items: center;
      gap: 6px;

      .wcps-btn-autofill {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: #2563eb;
        color: #ffffff;
        font-size: 0.8rem;
        font-weight: 700;
        padding: 6px 12px;
        border: none;
        border-radius: 6px;
        cursor: pointer;
        transition: background 0.2s, transform 0.15s;

        &:hover {
          background: #1d4ed8;
          transform: translateY(-1px);
        }

        &.applied {
          background: #16a34a;
        }

        &.has-saved-data {
          box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
        }
      }

      .wcps-btn-clear-autofill {
        background: transparent;
        color: #94a3b8;
        border: 1px solid #cbd5e1;
        border-radius: 6px;
        padding: 5px 8px;
        font-size: 0.75rem;
        cursor: pointer;
        transition: color 0.2s, border-color 0.2s;

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

  /* Error notice */
  .wcps-checkout-error-notice {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 12px;
    line-height: 1.4;

    ul {
      margin: 0;
      padding-left: 18px;
    }
  }

  /* Billing Fields Layout */
  .wcps-checkout-billing-fields {
    .woocommerce-billing-fields__field-wrapper {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;

      p.form-row {
        margin: 0;
        padding: 0;
        width: 100%;
        display: flex;
        flex-direction: column;

        &.form-row-first,
        &.form-row-last {
          width: calc(50% - 5px);
        }

        label {
          font-size: 0.8rem;
          font-weight: 600;
          color: #334155;
          margin-bottom: 4px;

          .required {
            color: #ef4444;
            text-decoration: none;
          }
        }

        input.input-text,
        select,
        textarea {
          width: 100%;
          padding: 8px 12px;
          border: 1px solid #cbd5e1;
          border-radius: 6px;
          font-size: 0.88rem;
          color: #1e293b;
          background: #ffffff;
          box-sizing: border-box;
          transition: border-color 0.2s, box-shadow 0.2s;

          &:focus {
            border-color: var(--wcps-cart-accent, #0170B9);
            outline: none;
            box-shadow: 0 0 0 3px rgba(1, 112, 185, 0.15);
          }
        }

        &.woocommerce-invalid,
        &.wcps-field-error {
          label {
            color: #dc2626;
          }

          input.input-text,
          select,
          textarea {
            border-color: #ef4444 !important;
            background-color: #fffbfb;
            box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15) !important;
          }
        }

        .wcps-field-error-text {
          display: block;
          margin-top: 4px;
          font-size: 0.76rem;
          font-weight: 500;
          color: #dc2626;
          line-height: 1.35;
          animation: wcpsSlideError 0.2s ease;
        }
      }
    }
  }

  /* Payment Section & Gateway Cards */
  .wcps-checkout-payment-section {
    margin-top: 14px;

    #order_review {
      table.woocommerce-checkout-review-order-table {
        display: none; // Items and subtotal are already rendered cleanly in the side cart
      }

      #payment {
        background: transparent;
        border: none;
        padding: 0;

        ul.payment_methods {
          list-style: none;
          padding: 0;
          margin: 0 0 14px 0;
          display: flex;
          flex-direction: column;
          gap: 8px;

          li.wc_payment_method {
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 10px 12px;
            transition: border-color 0.2s, background 0.2s;

            &.active,
            &:has(input[type="radio"]:checked) {
              border-color: var(--wcps-cart-accent, #0170B9);
              background: #f0f7fc;
            }

            label {
              display: flex;
              align-items: center;
              gap: 8px;
              font-size: 0.88rem;
              font-weight: 600;
              color: #0f172a;
              cursor: pointer;
              margin: 0;

              img {
                max-height: 24px;
                width: auto;
              }
            }

            .payment_box {
              margin-top: 8px;
              padding: 8px 10px;
              background: #ffffff;
              border-radius: 6px;
              font-size: 0.82rem;
              color: #475569;
              border: 1px solid #e2e8f0;
              line-height: 1.4;

              p {
                margin: 0;
              }
            }
          }
        }

        .place-order {
          padding: 0;
          margin: 0;

          .button#place_order {
            width: 100%;
            padding: 14px 20px;
            background: var(--wcps-cart-btn-color, #0170B9);
            color: var(--wcps-cart-btn-text, #ffffff) !important;
            font-size: 1rem;
            font-weight: 800;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(1, 112, 185, 0.25);
            transition: transform 0.15s, opacity 0.2s;

            &:hover {
              transform: translateY(-2px);
              opacity: 0.95;
              box-shadow: 0 6px 16px rgba(1, 112, 185, 0.35);
            }

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

          .woocommerce-privacy-policy-text {
            font-size: 0.75rem;
            color: #64748b;
            margin-top: 10px;
            line-height: 1.4;

            p {
              margin: 0;
            }
          }
        }
      }
    }

    &.wcps-hide-wc-place-order,
    .wcps-hide-wc-place-order & {
      #place_order,
      button#place_order,
      input#place_order,
      button[name="woocommerce_checkout_place_order"],
      input[name="woocommerce_checkout_place_order"],
      .place-order button,
      .place-order input[type="submit"],
      .form-row.place-order button,
      .form-row.place-order input[type="submit"] {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        font-size: 0 !important;
        line-height: 0 !important;
        opacity: 0 !important;
        pointer-events: none !important;
      }
    }
  }
}

/* Universal Theme-Agnostic Place Order Button Suppression */
#wcps-side-cart-drawer.wcps-hide-wc-place-order,
#wcps-side-cart-drawer[data-button-display="footer_only"],
.wcps-embedded-checkout-section.wcps-hide-wc-place-order,
.wcps-direct-checkout-form.wcps-hide-wc-place-order,
.wcps-direct-checkout-form[data-button-display="footer_only"],
.wcps-checkout-payment-section.wcps-hide-wc-place-order,
.wcps-hide-wc-place-order {
  #place_order,
  button#place_order,
  input#place_order,
  button[name="woocommerce_checkout_place_order"],
  input[name="woocommerce_checkout_place_order"],
  .place-order button,
  .place-order input[type="submit"],
  .form-row.place-order button,
  .form-row.place-order input[type="submit"],
  .woocommerce-checkout-payment .place-order button,
  .woocommerce-checkout-payment .place-order input[type="submit"],
  #payment .place-order button,
  #payment .place-order input[type="submit"] {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    font-size: 0 !important;
    line-height: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
}

/* 6. Custom In-Drawer Modal Dialog */
.wcps-cart-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;

  &.is-visible {
    opacity: 1;
    visibility: visible;

    .wcps-cart-modal-box {
      transform: scale(1) translateY(0);
      opacity: 1;
    }
  }

  .wcps-cart-modal-box {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25), 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 380px;
    width: 100%;
    padding: 28px 24px 22px;
    text-align: center;
    transform: scale(0.92) translateY(12px);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    border: 1px solid #e2e8f0;

    .wcps-cart-modal-icon {
      width: 56px;
      height: 56px;
      margin: 0 auto 16px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 24px;

      &.info {
        background: #e0f2fe;
        color: #0284c7;
      }

      &.warning {
        background: #fef3c7;
        color: #d97706;
      }

      &.success {
        background: #dcfce7;
        color: #16a34a;
      }
    }

    .wcps-cart-modal-title {
      margin: 0 0 10px;
      font-size: 1.15rem;
      font-weight: 700;
      color: #0f172a;
    }

    .wcps-cart-modal-text {
      margin: 0 0 22px;
      font-size: 0.92rem;
      color: #64748b;
      line-height: 1.5;
    }

    .wcps-cart-modal-actions {
      display: flex;
      gap: 10px;
      justify-content: center;

      button {
        flex: 1;
        padding: 10px 16px;
        border-radius: 8px;
        font-weight: 600;
        font-size: 0.9rem;
        cursor: pointer;
        transition: all 0.2s ease;
        border: 1px solid transparent;

        &.wcps-cart-modal-btn-confirm {
          background: var(--wcps-cart-accent, #0170B9);
          color: #ffffff;
          box-shadow: 0 2px 6px rgba(1, 112, 185, 0.25);

          &:hover {
            opacity: 0.92;
            transform: translateY(-1px);
          }
        }

        &.wcps-cart-modal-btn-cancel {
          background: #f1f5f9;
          color: #475569;
          border-color: #e2e8f0;

          &:hover {
            background: #e2e8f0;
            color: #1e293b;
          }
        }
      }
    }
  }
}

/* Mobile responsive */
@media (max-width: 480px) {
  #wcps-side-cart-drawer .wcps-side-cart-panel {
    max-width: 100% !important;
    width: 100% !important;
  }
  #wcps-floating-cart-launcher {
    bottom: 20px !important;
    right: 20px !important;
  }
  .wcps-embedded-checkout-section .wcps-checkout-billing-fields .woocommerce-billing-fields__field-wrapper p.form-row.form-row-first,
  .wcps-embedded-checkout-section .wcps-checkout-billing-fields .woocommerce-billing-fields__field-wrapper p.form-row.form-row-last {
    width: 100% !important;
  }
}

@keyframes wcpsSlideError {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

