/* GenTe — Checkout Page Styles */
@import url('./style.css');

/* ==========================================================================
   1. Checkout Section & Header
   ========================================================================== */
.checkout-section {
  padding: clamp(2.5rem, 5vw, 5rem) 0 5rem;
  min-height: 85vh;
  position: relative;
  overflow-x: hidden;
  width: 100%;
}

.checkout-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto clamp(1.5rem, 3vw, 3rem);
  padding: 0 0.5rem;
}

.checkout-header .eyebrow {
  margin-bottom: 0.5rem;
  display: inline-block;
}

.checkout-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.checkout-header p {
  color: var(--muted);
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  line-height: 1.6;
}

/* Breadcrumb */
.checkout-breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.checkout-breadcrumb a {
  color: var(--purple-accent);
  transition: color 0.2s ease;
}

.checkout-breadcrumb a:hover {
  color: var(--purple-vivid);
  text-decoration: underline;
}

.checkout-breadcrumb i,
.checkout-breadcrumb svg {
  width: 14px;
  height: 14px;
  opacity: 0.5;
  flex-shrink: 0;
}

/* ==========================================================================
   2. Main Layout Grid
   ========================================================================== */
.checkout-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 2rem;
  align-items: start;
  width: 100%;
  max-width: 100%;
}

@media (max-width: 992px) {
  .checkout-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* Glass Card Containers */
.checkout-card {
  padding: clamp(1.25rem, 3vw, 2.25rem);
  border-radius: var(--radius);
  position: relative;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.card-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.card-title-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  background: var(--purple-soft);
  border: 1px solid var(--border);
  color: var(--purple-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-title-icon i,
.card-title-icon svg {
  width: 1.2rem;
  height: 1.2rem;
}

.card-title-wrap h2 {
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  font-weight: 600;
  margin: 0;
  color: var(--fg);
}

/* ==========================================================================
   3. Form Layout & Inputs
   ========================================================================== */
.checkout-form {
  width: 100%;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  width: 100%;
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.form-group {
  margin-bottom: 1.25rem;
  position: relative;
  text-align: left;
  width: 100%;
}

.form-group label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.45rem;
}

.form-group label span.req {
  color: #ff6b81;
  margin-left: 2px;
}

.input-with-icon {
  position: relative;
  display: block;
  width: 100%;
}

.input-with-icon i,
.input-with-icon svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.1rem;
  height: 1.1rem;
  color: var(--muted);
  pointer-events: none;
  transition: color 0.25s ease;
  z-index: 2;
}

.input-with-icon.textarea-icon i,
.input-with-icon.textarea-icon svg {
  top: 1.1rem;
  transform: none;
}

.form-control {
  width: 100%;
  max-width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 0.65rem;
  border: 1px solid var(--border);
  background: rgba(8, 6, 18, 0.65);
  color: var(--fg);
  font-size: 0.93rem;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
  box-sizing: border-box;
}

.input-with-icon .form-control {
  padding-left: 2.85rem;
}

.form-control::placeholder {
  color: rgba(184, 168, 216, 0.45);
}

.form-control:focus {
  border-color: var(--purple-vivid);
  box-shadow: 0 0 0 3px rgba(180, 156, 255, 0.25);
  background: rgba(13, 9, 32, 0.85);
}

.input-with-icon .form-control:focus + i,
.input-with-icon .form-control:focus ~ i,
.input-with-icon .form-control:focus + svg,
.input-with-icon .form-control:focus ~ svg {
  color: var(--purple-accent);
}

/* Error States */
.form-group.has-error .form-control {
  border-color: #ff4757 !important;
  box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.2) !important;
  background: rgba(255, 71, 87, 0.05) !important;
}

.form-group.has-error .input-with-icon i,
.form-group.has-error .input-with-icon svg {
  color: #ff4757 !important;
}

.error-message {
  display: none;
  align-items: center;
  gap: 0.35rem;
  color: #ff6b81;
  font-size: 0.78rem;
  font-weight: 500;
  margin-top: 0.4rem;
  word-break: break-word;
}

.form-group.has-error .error-message {
  display: flex;
}

.error-message i,
.error-message svg {
  width: 0.85rem;
  height: 0.85rem;
  flex-shrink: 0;
}

/* ==========================================================================
   4. Order Summary Section
   ========================================================================== */
.summary-card {
  position: sticky;
  top: 100px;
}

@media (max-width: 992px) {
  .summary-card {
    position: static;
    top: auto;
  }
}

.summary-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 0.25rem;
  margin-bottom: 1.25rem;
  width: 100%;
}

/* Scrollbar styling */
.summary-items-list::-webkit-scrollbar {
  width: 4px;
}
.summary-items-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}
.summary-items-list::-webkit-scrollbar-thumb {
  background: var(--purple-mid);
  border-radius: 4px;
}

.checkout-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.85rem;
  background: rgba(180, 156, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.checkout-item:hover {
  border-color: var(--border-bright);
  transform: translateY(-1px);
}

.checkout-item-img {
  width: 52px;
  height: 52px;
  border-radius: 0.5rem;
  object-fit: cover;
  background: var(--bg-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.checkout-item-details {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.checkout-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.checkout-item-meta {
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.checkout-item-qty-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.12rem 0.4rem;
  background: var(--purple-soft);
  border-radius: 0.35rem;
  color: var(--purple-accent);
  font-weight: 600;
  font-size: 0.73rem;
}

.checkout-item-price {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--purple-accent);
  text-align: right;
  flex-shrink: 0;
  margin-left: 0.25rem;
}

/* Totals Breakdown */
.summary-totals {
  border-top: 1px solid var(--border);
  padding-top: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--muted);
}

.summary-row.grand-total {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fg);
  border-top: 1px dashed var(--border);
  padding-top: 0.85rem;
  margin-top: 0.15rem;
}

.summary-row.grand-total .total-amount {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3vw, 1.6rem);
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge-free {
  color: #2ed573;
  font-weight: 600;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.badge-free i,
.badge-free svg {
  width: 14px;
  height: 14px;
}

/* Trust Features */
.checkout-guarantee {
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  background: rgba(13, 9, 32, 0.5);
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  width: 100%;
}

.guarantee-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.guarantee-item i,
.guarantee-item svg {
  width: 1rem;
  height: 1rem;
  color: var(--purple-accent);
  flex-shrink: 0;
}

/* ==========================================================================
   5. Primary Brand CTA Button ("Complete Order")
   ========================================================================== */
.btn-checkout-primary {
  width: 100%;
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  background: var(--grad-purple);
  color: #080612;
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border: none;
  cursor: pointer;
  margin-top: 1.5rem;
  box-shadow: 0 8px 25px -4px rgba(180, 156, 255, 0.45);
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
  letter-spacing: -0.01em;
  box-sizing: border-box;
}

.btn-checkout-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -4px rgba(180, 156, 255, 0.65);
  filter: brightness(1.08);
}

.btn-checkout-primary:active {
  transform: translateY(0);
}

.btn-checkout-primary i,
.btn-checkout-primary svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

/* ==========================================================================
   6. Empty State
   ========================================================================== */
.checkout-empty-state {
  text-align: center;
  padding: 3rem 1.25rem;
  width: 100%;
}

.checkout-empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--purple-soft);
  border: 1px solid var(--border);
  color: var(--purple-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkout-empty-icon i,
.checkout-empty-icon svg {
  width: 28px;
  height: 28px;
}

.checkout-empty-state h3 {
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
}

.checkout-empty-state p {
  color: var(--muted);
  margin-bottom: 1.25rem;
}

/* Extra Mobile Adjustments */
@media (max-width: 480px) {
  .checkout-section {
    padding-top: 1.75rem;
  }
  .checkout-card {
    padding: 1.15rem 0.85rem;
    border-radius: 0.85rem;
  }
  .btn-checkout-primary {
    font-size: 0.98rem;
    padding: 0.9rem 1rem;
  }
  .checkout-item {
    padding: 0.65rem;
  }
  .checkout-item-img {
    width: 44px;
    height: 44px;
  }
}
