/* Mattress Palace Trading — Checkout Page Styles */

/* ==========================================================================
   1. Checkout Section & Header
   ========================================================================== */
.checkout-section {
  padding: 2.5rem 0 5rem;
  min-height: 85vh;
  position: relative;
  background: #ffffff;
  width: 100%;
}

.checkout-section .container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

.checkout-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 3rem;
  padding: 0 0.5rem;
}

/* Breadcrumb */
.checkout-breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
  color: #777777;
}

.checkout-breadcrumb a {
  color: #666666;
  text-decoration: none;
  transition: color 0.2s ease;
}

.checkout-breadcrumb a:hover {
  color: #1a1a1a;
  text-decoration: underline;
}

.checkout-breadcrumb i,
.checkout-breadcrumb svg {
  width: 12px;
  height: 12px;
  color: #999999;
  flex-shrink: 0;
}

.checkout-breadcrumb span {
  color: #666666;
}

/* Eyebrow Tag */
.checkout-header .eyebrow {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #a07a52;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
  background: none;
  border: none;
  padding: 0;
}

/* Main Heading */
.checkout-header h1 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(2rem, 3.8vw, 2.75rem);
  font-weight: 700;
  color: #1a201c;
  line-height: 1.2;
  margin: 0 0 1rem;
}

.checkout-header h1 .checkout-title-italic,
.checkout-header h1 .font-display {
  font-family: 'Instrument Serif', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  color: #1a201c;
  background: none;
  -webkit-background-clip: initial;
  -webkit-text-fill-color: initial;
  margin-left: 0.2rem;
}

.checkout-header p {
  color: #59605c;
  font-size: clamp(0.9rem, 1.8vw, 0.98rem);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

.checkout-header p strong {
  color: #222222;
  font-weight: 600;
}

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

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

/* Cards */
.checkout-card {
  background: #ffffff;
  border: 1px solid #ede8e1;
  border-top: 3.5px solid var(--bg-dark, #BE111B);
  /* Brand red bar */
  border-radius: 4px;
  padding: 2.25rem 2.5rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.03);
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 600px) {
  .checkout-card {
    padding: 1.5rem 1.25rem;
  }
}

/* Card Header Title */
.card-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 2rem;
  border-bottom: none;
  padding-bottom: 0;
}

.card-title-icon {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 6px;
  background: #f4eee5;
  border: none;
  color: #8c6d48;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-title-icon i,
.card-title-icon svg {
  width: 18px;
  height: 18px;
}

.card-title-wrap h2 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.55rem;
  font-weight: 400;
  margin: 0;
  color: #1a1a1a;
  letter-spacing: -0.01em;
}

/* ==========================================================================
   3. Form Layout & Inputs
   ========================================================================== */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
}

@media (max-width: 600px) {
  .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 !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  width: 100% !important;
  font-size: 0.84rem;
  font-weight: 600;
  color: #1a201c;
  margin-bottom: 0.45rem;
  text-align: left;
}

.form-group label span.req {
  color: #ea3943 !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  margin-left: auto !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  display: inline-block !important;
}

.form-group label span.opt,
.form-group label span.muted {
  font-size: 0.72rem !important;
  letter-spacing: 0.05em !important;
  color: #8c857b !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  margin-left: auto !important;
  display: inline-block !important;
}

.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: 17px;
  height: 17px;
  color: #766e66;
  pointer-events: none;
  transition: color 0.2s ease;
  z-index: 2;
}

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

.form-control {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.85rem;
  border-radius: 4px;
  border: 1px solid transparent;
  background: #f3ede4;
  /* Warm sand/beige background */
  color: #1a1a1a;
  font-size: 0.9rem;
  height: 46px;
  outline: none;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  font-family: inherit;
}

textarea.form-control {
  height: auto;
  min-height: 85px;
  padding-top: 0.85rem;
  resize: vertical;
}

.form-control::placeholder {
  color: #8e877e;
  font-weight: 400;
}

.form-control:focus {
  background: #f0e8de;
  border-color: #8c6d48;
  box-shadow: 0 0 0 2px rgba(140, 109, 72, 0.12);
}

.input-with-icon .form-control:focus~i,
.input-with-icon .form-control:focus~svg,
.input-with-icon .form-control:focus+i,
.input-with-icon .form-control:focus+svg {
  color: #8c6d48;
}

/* Error States */
.form-group.has-error .form-control {
  border-color: #d32f2f !important;
  background: #fdf2f2 !important;
}

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

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

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

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

/* ==========================================================================
   4. Submit Button ("Complete Order")
   ========================================================================== */
.btn-checkout-primary {
  width: 100%;
  height: 50px;
  padding: 0 1.5rem;
  border-radius: 4px;
  background: var(--grad-red);
  /* Brand red */
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border: none;
  cursor: pointer;
  margin-top: 1.5rem;
  box-shadow: none;
  transition: background 0.2s ease, transform 0.15s ease;
  letter-spacing: 0.01em;
  box-sizing: border-box;
}

.btn-checkout-primary:hover {
  background: var(--grad-red-hover);
  box-shadow: 0 8px 28px rgba(190, 17, 27, 0.22);
}

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

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

/* ==========================================================================
   5. 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;
  margin-bottom: 1.25rem;
  width: 100%;
}

.checkout-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.85rem;
  background: #f8f5ee;
  /* Warm sand item background */
  border: 1px solid #ebe4d8;
  border-radius: 4px;
  width: 100%;
  box-sizing: border-box;
}

.checkout-item-img {
  width: 52px;
  height: 52px;
  border-radius: 4px;
  object-fit: cover;
  background: #ebe5dc;
  border: none;
  flex-shrink: 0;
}

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

.checkout-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1c2826;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.checkout-item-meta {
  font-size: 0.8rem;
  color: #777777;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.checkout-item-qty-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  background: #ede6dc;
  border-radius: 3px;
  color: #6b5842;
  font-weight: 600;
  font-size: 0.75rem;
}

.checkout-item-price {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1c2826;
  text-align: right;
  flex-shrink: 0;
  margin-left: auto;
}

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

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  color: #555555;
}

.summary-row.grand-total {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1c2826;
  border-top: 1px dotted #cccccc;
  /* Dotted line separator */
  padding-top: 1rem;
  margin-top: 0.35rem;
}

.summary-row.grand-total .total-amount {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 1.7rem;
  font-weight: 400;
  color: #1c2826;
}

.badge-free {
  color: #16a34a;
  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;
}

/* Guarantee / Trust Features */
.checkout-guarantee {
  margin-top: 1.25rem;
  padding: 1.1rem 1.25rem;
  background: #ffffff;
  border: 1px solid #ebe5dc;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  box-sizing: border-box;
}

.guarantee-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: #555555;
}

.guarantee-item i,
.guarantee-item svg {
  width: 16px;
  height: 16px;
  color: #BE111B;
  /* Brand red icon */
  flex-shrink: 0;
}

/* 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: #f4eee5;
  color: #8c6d48;
  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: #666666;
  margin-bottom: 1.25rem;
}