/* =====================================================
   THEME VARIABLES & IMPORT
   ===================================================== */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Roboto:wght@400;500;700&display=swap');

:root {
  --primary-blue: #35a2df;
  --hover-blue: #1582bf;
  --dark-blue: #19406A;
  --copy-dark: #626466;
  --light-gray: #999;
  --white: #fff;
  --bg-light: #f7f5f2;
  --border-light: #e2e8f0;
  
  --font-heading: 'Nunito', sans-serif;
  --font-subheading: 'Roboto', sans-serif;
  --font-body: 'Nunito', sans-serif;
}

/* =====================================================
   RESET & BASE
   ===================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--copy-dark);
  background: #fbfbfb;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* =====================================================
   HEADER & BRANDING
   ===================================================== */
.checkout-header {
  background: var(--white);
  border-bottom: 1px solid var(--border-light);
  padding: 24px 0;
  margin-bottom: 40px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.header-container {
  max-width: 1020px;
  margin: 0 auto;
  padding: 0 20px;
}

.checkout-logo {
  max-height: 52px;
  display: inline-block;
  vertical-align: middle;
}

/* =====================================================
   LAYOUT
   ===================================================== */
.checkout-wrapper {
  display: flex;
  gap: 40px;
  max-width: 1020px;
  margin: 0 auto;
  padding: 0 20px 60px;
  align-items: flex-start;
}

/* =====================================================
   LEFT – BILLING DETAILS
   ===================================================== */
.billing-section {
  flex: 1.2;
  min-width: 0;
  background: var(--white);
  padding: 30px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
}

.billing-title {
  font-family: var(--font-subheading);
  font-size: 24px;
  font-weight: 700;
  color: var(--dark-blue);
  margin-bottom: 8px;
}

.billing-hr {
  border: none;
  border-top: 2px solid var(--primary-blue);
  margin-bottom: 26px;
  width: 60px;
}

/* ---- Field group ---- */
.field-group {
  margin-bottom: 20px;
}

.field-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--dark-blue);
  font-weight: 700;
  font-family: var(--font-subheading);
}

.req {
  color: #e11d48;
  margin-left: 2px;
}

/* Two-column layout */
.row-2col {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.row-2col .field-group {
  flex: 1;
  margin-bottom: 0;
}

/* ---- Inputs & Selects ---- */
input[type="text"],
input[type="email"],
input[type="tel"],
select {
  width: 100%;
  height: 44px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 14px;
  font-size: 14px;
  font-family: var(--font-body);
  color: #334155;
  background: var(--white);
  outline: none;
  transition: all 0.2s ease-in-out;
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="tel"]::placeholder {
  color: #94a3b8;
  font-size: 13px;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(53, 162, 223, 0.15);
}

/* ---- Select Wrapper ---- */
.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: "▾";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-size: 14px;
  color: #64748b;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  cursor: pointer;
}

/* ---- Error / Validation Styling ---- */
.error-field {
  border-color: #ef4444 !important;
  background-color: #fef2f2 !important;
}

.error-field:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.error-msg-span {
  display: block;
  font-size: 12px;
  color: #ef4444;
  margin-top: 6px;
  font-weight: 600;
  animation: fadeIn 0.2s ease-in-out;
}

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

/* =====================================================
   RIGHT – YOUR ORDER
   ===================================================== */
.order-section {
  width: 380px;
  flex-shrink: 0;
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 26px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.02);
}

.order-title {
  font-family: var(--font-subheading);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--dark-blue);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-blue);
  margin-bottom: 16px;
  text-transform: uppercase;
}

/* ---- Order table ---- */
.order-table {
  margin-bottom: 20px;
}

.order-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13.5px;
  color: #475569;
}

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

.order-header {
  border-bottom: 2px solid #e2e8f0;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--light-gray);
  text-transform: uppercase;
  padding-bottom: 8px;
}

.product-name {
  color: #334155;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.5;
}

.qty {
  font-weight: 700;
  color: var(--primary-blue);
  margin-left: 4px;
}

.amount {
  font-weight: 700;
  color: var(--dark-blue);
  white-space: nowrap;
}

.total-row {
  padding-top: 16px;
  padding-bottom: 4px;
}

.total-row span:first-child {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark-blue);
}

.total-amount {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-blue);
}

/* ---- Payment box ---- */
.payment-box {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.01);
}

.payment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.payment-label {
  font-size: 13px;
  color: var(--dark-blue);
  font-weight: 700;
  font-family: var(--font-subheading);
}

.card-icons {
  display: flex;
  gap: 4px;
  align-items: center;
}

.card-icon {
  width: 34px;
  height: 22px;
  border-radius: 3px;
  transition: all 0.2s ease-in-out;
}

.card-icon.inactive {
  opacity: 0.25;
  filter: grayscale(100%);
}

.secure-msg {
  font-size: 12px;
  color: var(--light-gray);
  margin-bottom: 16px;
}

/* ---- Card inputs ---- */
.card-field-group {
  margin-bottom: 14px;
}

.card-field-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--dark-blue);
  margin-bottom: 5px;
  font-family: var(--font-subheading);
}

.card-input {
  width: 100%;
  height: 40px;
  border: 1px solid #cbd5e1;
  background: var(--white);
  border-radius: 6px;
  padding: 0 12px;
  font-size: 14px;
  color: #334155;
  outline: none;
  transition: all 0.2s ease-in-out;
  letter-spacing: 0.05em;
}

.card-input::placeholder {
  color: #cbd5e1;
  letter-spacing: 0.05em;
}

.card-input:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(53, 162, 223, 0.15);
}

.card-row-2col {
  display: flex;
  gap: 12px;
}

.card-row-2col .card-field-group {
  flex: 1;
}

/* ---- Place Order button ---- */
.place-order-btn {
  display: block;
  width: 100%;
  height: 48px;
  margin-top: 18px;
  background: var(--primary-blue);
  border: none;
  border-radius: 6px;
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-heading);
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(53, 162, 223, 0.25);
}

.place-order-btn:hover {
  background: var(--hover-blue);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(53, 162, 223, 0.35);
}

.place-order-btn:active {
  background: #0a84cd;
  transform: translateY(0);
}

/* =====================================================
   CONFIRMATION PAGE SPECIFIC STYLES
   ===================================================== */
.confirmation-wrapper {
  max-width: 900px;
  margin: 0 auto;
}

.success-banner {
  text-align: center;
  padding: 16px 0 24px;
}

.success-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
}

.success-title {
  color: #10b981 !important;
  font-size: 26px;
  font-weight: 800;
  font-family: var(--font-heading);
  margin-bottom: 10px;
}

.success-subtitle {
  font-size: 14px;
  color: var(--copy-dark);
  line-height: 1.6;
  max-width: 520px;
  margin: 0 auto;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  background: #f8fafc;
  border: 1px dashed var(--primary-blue);
  border-radius: 8px;
  padding: 18px;
  margin: 20px 0 30px;
}

.info-item {
  display: flex;
  flex-direction: column;
}

.info-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--light-gray);
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  font-family: var(--font-subheading);
}

.info-value {
  font-size: 13.5px;
  color: var(--dark-blue);
  font-weight: 700;
}

.text-bold {
  font-weight: 800;
  color: var(--primary-blue);
}

.section-subtitle {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark-blue);
  margin-bottom: 14px;
  font-family: var(--font-subheading);
}

.details-box {
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px 20px;
  background: var(--white);
  margin-bottom: 26px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.01);
}

.details-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13.5px;
}

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

.details-label {
  color: #64748b;
  font-weight: 600;
}

.details-val {
  color: #1e293b;
  font-weight: 700;
  text-align: right;
  max-width: 70%;
}

.actions-row {
  margin: 30px 0 10px;
}

.back-link {
  font-size: 14px;
  color: var(--primary-blue);
  text-decoration: none;
  font-weight: 700;
  transition: all 0.2s ease-in-out;
}

.back-link:hover {
  color: var(--hover-blue);
  text-decoration: underline;
}

.receipt-footer {
  padding: 18px;
  background: #f8fafc;
  border-top: 1px dashed var(--border-light);
  border-radius: 0 0 12px 12px;
}

.text-center {
  text-align: center;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 767px) {
  .checkout-wrapper {
    flex-direction: column;
    padding: 0 16px 40px;
  }
  .order-section {
    width: 100%;
  }
  .row-2col {
    flex-direction: column;
    gap: 20px;
  }
  .billing-section {
    padding: 20px;
  }
  .details-val {
    max-width: 100%;
  }
}
