/* ==========================================================================
   ORDER CONFIRMATION & RECEIPT STYLES (CONFIRMATION.CSS)
   Luxury Woodcraft theme with enhanced depth, hierarchy, and desktop layout
   ========================================================================== */

html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

.confirmation-page-wrapper {
  padding: 50px 0 90px;
  background: radial-gradient(circle at 50% 0%, #FAF3EB 0%, var(--color-bg, #FBF9F5) 70%);
  min-height: calc(100vh - 200px);
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  box-sizing: border-box;
}

.confirmation-card {
  max-width: 1000px;
  margin: 0 auto;
  background: #FFFFFF;
  border-radius: 24px;
  box-shadow:
    0 25px 50px -12px rgba(43, 29, 20, 0.12),
    0 10px 25px -5px rgba(43, 29, 20, 0.06),
    0 0 0 1px rgba(142, 90, 53, 0.1);
  padding: 52px 56px;
  position: relative;
  overflow: hidden;
}

/* Decorative luxury top accent bar */
.confirmation-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, #8E5A35 0%, #C08A46 35%, #D4AF37 50%, #C08A46 65%, #8E5A35 100%);
}

/* Hero Status & Success Icon */
.success-icon-wrap {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(135deg, #E8F7EE 0%, #D1F2DE 100%);
  color: #1E8E4F;
  font-size: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  box-shadow:
    0 12px 24px -6px rgba(30, 142, 79, 0.25),
    0 0 0 6px #FFFFFF,
    0 0 0 8px rgba(30, 142, 79, 0.15);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.confirmation-card:hover .success-icon-wrap {
  transform: scale(1.04);
}

.confirmation-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #15803D;
  background: #DCFCE7;
  border: 1px solid rgba(22, 163, 74, 0.25);
  padding: 6px 16px;
  border-radius: 9999px;
  margin-bottom: 14px;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.12);
}

.confirmation-title {
  font-size: 2.35rem;
  font-weight: 800;
  color: var(--wood-dark, #2B1D14);
  line-height: 1.25;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.confirmation-subtitle {
  font-size: 1.08rem;
  color: #525866;
  max-width: 680px;
  margin: 0 auto 28px;
  line-height: 1.6;
}

.confirmation-subtitle strong {
  color: var(--wood-dark, #2B1D14);
  background: #FDF4EB;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(142, 90, 53, 0.15);
}

/* Order Number Highlight Card */
.order-number-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: linear-gradient(135deg, #FBF8F4 0%, #F5EDE4 100%);
  border: 1.5px solid rgba(142, 90, 53, 0.22);
  padding: 12px 26px;
  border-radius: 14px;
  margin-bottom: 30px;
  box-shadow:
    0 4px 14px rgba(43, 29, 20, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.order-number-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #64748B;
}

.order-number-val {
  font-family: var(--font-heading, inherit);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--wood-dark, #2B1D14);
  letter-spacing: 0.5px;
}

/* Tracking Access Token Card */
.tracking-code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  max-width: 740px;
  margin: 0 auto 10px;
  box-sizing: border-box;
  padding: 16px 22px;
  background: #FAF8F5;
  border: 1px solid rgba(142, 90, 53, 0.16);
  border-radius: 14px;
  box-shadow: inset 0 2px 4px rgba(43, 29, 20, 0.03);
  text-align: left;
}

.tracking-code-box .order-number-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--wood-accent, #8E5A35);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tracking-code-value {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-all;
  font-family: var(--font-mono, monospace);
  font-size: 0.98rem;
  font-weight: 700;
  color: #334155;
  line-height: 1.5;
  letter-spacing: 0.04em;
}

.tracking-code-copy {
  flex-shrink: 0;
}

.tracking-hint-text {
  font-size: 0.88rem;
  color: #64748B;
  margin-bottom: 34px;
}

/* Interactive Copy Buttons */
.copy-btn {
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #FFFFFF;
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  cursor: pointer;
  color: #374151;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.copy-btn:hover {
  background: #F8FAFC;
  border-color: #9CA3AF;
  color: var(--wood-dark, #2B1D14);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

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

/* Quick Action Buttons Row */
.confirmation-actions-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}

.confirmation-actions-row form {
  display: inline-flex;
}

.confirmation-actions-row .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 24px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 12px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  cursor: pointer;
}

.confirmation-actions-row .btn-whatsapp {
  background: linear-gradient(135deg, #25D366 0%, #1EA952 100%);
  color: #FFFFFF;
  border: 1px solid #1DA851;
  box-shadow: 0 6px 16px -2px rgba(37, 211, 102, 0.35);
}

.confirmation-actions-row .btn-whatsapp:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -3px rgba(37, 211, 102, 0.45);
  filter: brightness(1.05);
  color: #FFFFFF;
}

.confirmation-actions-row .btn-outline {
  background: #FFFFFF;
  color: var(--wood-dark, #2B1D14);
  border: 1.5px solid rgba(43, 29, 20, 0.22);
  box-shadow: 0 4px 12px rgba(43, 29, 20, 0.05);
}

.confirmation-actions-row .btn-outline:hover {
  background: #FAF6F0;
  border-color: var(--wood-dark, #2B1D14);
  color: var(--wood-dark, #2B1D14);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(43, 29, 20, 0.1);
}

/* Order Details Grid Layout (2 equal columns, max-width 1000px, gap 24px) */
.confirmation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
  width: 100%;
  max-width: 1000px;
  margin: 10px auto 36px;
  box-sizing: border-box;
}

.confirmation-grid,
.confirmation-grid * {
  box-sizing: border-box;
  min-width: 0;
}

/* Card Style (Both Cards): White background, 1px solid #eadfd5 border, border-radius 22px, padding clamp(18px, 3vw, 28px), soft brown shadow */
.confirmation-section {
  background: #FFFFFF;
  border: 1px solid #eadfd5;
  border-radius: 22px;
  padding: clamp(18px, 3vw, 28px);
  box-shadow:
    0 10px 25px -5px rgba(43, 29, 20, 0.05),
    0 4px 10px rgba(43, 29, 20, 0.02);
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  transition: box-shadow 0.25s ease;
}

.confirmation-section:hover {
  box-shadow:
    0 14px 30px -4px rgba(43, 29, 20, 0.08),
    0 4px 12px rgba(43, 29, 20, 0.03);
}

/* Card Header: Flex row with small rounded icon tile, h2 title (18px, bold) and 1px bottom border */
.confirmation-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid #eadfd5;
  box-sizing: border-box;
  width: 100%;
}

.confirmation-card-header .header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.confirmation-card-header .header-icon-tile {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 10px;
  background: #FAF3EB;
  color: #8E5A35;
  border: 1px solid rgba(142, 90, 53, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.confirmation-card-header .header-title {
  font-size: 18px;
  font-weight: 700;
  color: #2B1D14;
  margin: 0;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.confirmation-card-header .header-count {
  font-size: 13px;
  font-weight: 500;
  color: #64748B;
  white-space: nowrap;
}

/* ==========================================================================
   DELIVERY ADDRESS CARD (Definition List Grid)
   ========================================================================== */
.delivery-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 18px 20px;
  margin: 0;
  padding: 0;
  width: 100%;
  box-sizing: border-box;
}

.delivery-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  box-sizing: border-box;
}

.delivery-field.full-width {
  grid-column: 1 / -1;
}

.delivery-field-label {
  font-size: 12px;
  font-weight: 600;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin: 0;
  line-height: 1.3;
}

.delivery-field-val {
  font-size: 15px;
  font-weight: 500;
  color: #1E293B;
  margin: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.delivery-field-val.address-val {
  line-height: 1.6;
}

/* Delivery Area Pill: Light brown tint, brown text, fully rounded */
.delivery-area-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: #FAF3EB;
  color: #8E5A35;
  border: 1px solid rgba(142, 90, 53, 0.18);
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  width: fit-content;
  max-width: 100%;
  white-space: nowrap;
}

/* Special Note: Tinted box with 3px brown left border, radius 10px, padding 10px 14px */
.delivery-note-box {
  background: #FAF6F0;
  border-left: 3px solid #8E5A35;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  color: #374151;
  line-height: 1.5;
  margin-top: 2px;
}

/* ==========================================================================
   ORDER SUMMARY CARD (Modern Product List & Totals)
   ========================================================================== */
.confirmation-items-list {
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 6px;
}

.confirmation-item-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid #F1EBE4;
  box-sizing: border-box;
  width: 100%;
}

.confirmation-item-row:last-child {
  border-bottom: 1px solid #eadfd5;
}

/* Column 1: Thumbnail with circular quantity badge */
.confirmation-thumb-wrapper {
  position: relative;
  width: 84px;
  height: 84px;
  min-width: 84px;
  max-width: 84px;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: visible;
  flex-shrink: 0;
}

.confirmation-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(142, 90, 53, 0.14);
  background: #FAF5EE;
  display: block;
}

.confirmation-thumb-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #8E5A35;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px #FFFFFF;
  z-index: 2;
  line-height: 1;
}

/* Column 2: Product Name, Variant Pill, Unit Price */
.confirmation-item-details {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  box-sizing: border-box;
}

.confirmation-product-name {
  font-size: 15px;
  font-weight: 600;
  color: #1E293B;
  margin: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.confirmation-variant-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: #FAF3EB;
  border: 1px solid rgba(142, 90, 53, 0.16);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #8E5A35;
  width: fit-content;
  max-width: 100%;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.confirmation-unit-price {
  font-size: 13px;
  color: #64748B;
  line-height: 1.2;
}

/* Column 3: Line Total */
.confirmation-item-total {
  font-size: 16px;
  font-weight: 700;
  color: #1E293B;
  white-space: nowrap;
  text-align: right;
  align-self: center;
}

/* Totals section: dashed 1px dividers between rows */
.confirmation-totals-list {
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
}

.confirmation-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px dashed #E5DCD3;
  box-sizing: border-box;
  width: 100%;
}

.confirmation-total-row:last-child {
  border-bottom: none;
}

.confirmation-total-row .total-label {
  font-size: 14px;
  font-weight: 500;
  color: #64748B;
}

.confirmation-total-row .total-amount {
  font-size: 15px;
  font-weight: 600;
  color: #1E293B;
  white-space: nowrap;
}

.confirmation-total-row.discount-row .total-label,
.confirmation-total-row.discount-row .total-amount {
  color: #059669;
  font-weight: 600;
}

/* Grand Total Band: Light peach gradient, 4px brown left border */
.confirmation-grand-total-band {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  padding: 16px 18px;
  border-radius: 14px;
  border-left: 4px solid #8E5A35;
  background: linear-gradient(135deg, #FAF4ED 0%, #F5ECE3 100%);
  box-sizing: border-box;
  width: 100%;
}

.grand-total-label {
  font-size: 16px;
  font-weight: 700;
  color: #2B1D14;
  white-space: nowrap;
}

.grand-total-amount {
  font-size: clamp(22px, 5vw, 28px);
  font-weight: 800;
  color: #2B1D14;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

/* Universal rule: amounts must NEVER split from their ৳ currency symbol */
.amount-nowrap,
.amount-nowrap * {
  white-space: nowrap !important;
}

/* Payment Mode Alerts */
.payment-mode-alert {
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border: 1px solid #FCD34D;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 0.88rem;
  color: #92400E;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.08);
}

.payment-mode-alert i {
  font-size: 1.35rem;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Confirmation Footer */
.confirmation-footer {
  margin-top: 38px;
  padding-top: 26px;
  border-top: 1px solid #F1F5F9;
}

.confirmation-footer .btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  font-weight: 600;
  border: 1.5px solid #D1D5DB;
  background: #FFFFFF;
  color: #4B5563;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.confirmation-footer .btn-outline:hover {
  border-color: var(--wood-dark, #2B1D14);
  color: var(--wood-dark, #2B1D14);
  background: #FAF7F2;
  transform: translateY(-1px);
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
  .confirmation-card {
    padding: clamp(28px, 4vw, 44px);
    max-width: 100%;
  }
}

/* Tablet & Mobile Breakpoint (860px and below: single column, address card first) */
@media (max-width: 860px) {
  .confirmation-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 24px;
  }

  .delivery-address-card {
    order: 1;
  }

  .order-summary-card {
    order: 2;
  }
}

@media (max-width: 768px) {
  .confirmation-page-wrapper {
    padding: 24px 0 calc(110px + env(safe-area-inset-bottom, 20px));
  }

  .confirmation-card {
    padding: 24px 16px;
    border-radius: 18px;
  }

  .confirmation-title {
    font-size: 1.55rem;
  }

  .confirmation-subtitle {
    font-size: 0.95rem;
    margin-bottom: 20px;
  }

  .order-number-box {
    flex-direction: column;
    width: 100%;
    padding: 14px 16px;
    gap: 6px;
    margin-bottom: 14px;
  }

  .tracking-code-box {
    flex-direction: column;
    align-items: center;
    padding: 14px 16px;
    gap: 10px;
    margin-bottom: 8px;
  }

  .tracking-code-value {
    text-align: center;
    font-size: 0.95rem;
  }

  .tracking-code-copy {
    align-self: center;
  }

  .confirmation-actions-row {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
  }

  .confirmation-actions-row .btn {
    width: 100%;
  }

  .confirmation-section {
    padding: 18px 16px;
    border-radius: 18px;
  }

  .confirmation-card-header {
    padding-bottom: 14px;
    margin-bottom: 16px;
  }

  .confirmation-card-header .header-title {
    font-size: 16px;
  }

  .confirmation-card-header .header-icon-tile {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 14px;
    border-radius: 8px;
  }
}

/* Ultra-compact Mobile (420px and below) */
@media (max-width: 420px) {
  .confirmation-card {
    padding: 20px 12px;
  }

  .confirmation-section {
    padding: 16px 12px;
    border-radius: 16px;
  }

  /* 2-column item grid with 64px thumbnail and line total under title */
  .confirmation-item-row {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 14px 0;
  }

  .confirmation-thumb-wrapper {
    width: 64px;
    height: 64px;
    min-width: 64px;
    max-width: 64px;
    border-radius: 12px;
  }

  .confirmation-thumb-img {
    border-radius: 12px;
  }

  .confirmation-item-total {
    grid-column: 2;
    text-align: left;
    margin-top: 2px;
  }

  .delivery-fields-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .confirmation-grand-total-band {
    padding: 12px 14px;
    gap: 8px;
  }

  .grand-total-label {
    font-size: 15px;
  }

  .grand-total-amount {
    font-size: 22px;
  }
}