/* Fujimac cart and checkout flow styles. Loaded after the main storefront CSS. */
:root {
  --fujimac-red: #cd1719;
  --fujimac-blue: #00407d;
}

.cart-page-header,
.checkout-page-header {
  margin-bottom: 18px;
}

.list-header.cart-page-header,
.list-header.checkout-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  border: 1px solid #e7edf4;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #f4f8fc 100%);
  box-shadow: 0 14px 34px rgba(0, 64, 125, 0.06);
}

.cart-page-header h1,
.checkout-page-header h1 {
  margin: 0 0 6px;
  color: var(--fujimac-blue);
  font-size: clamp(36px, 5vw, 54px);
  line-height: 1;
}

.cart-page-header p,
.checkout-page-header p {
  max-width: 640px;
  margin: 0;
  color: #536170;
  line-height: 1.45;
}

.cart-graphic,
.payment-graphic {
  flex: 0 0 auto;
  width: 138px;
  height: 84px;
  border-radius: 18px;
  background: linear-gradient(135deg, #102f4a, #1c6695);
  position: relative;
  box-shadow: inset 0 14px 24px rgba(255,255,255,0.16), 0 16px 28px rgba(0,64,125,0.16);
}

.payment-graphic { background: linear-gradient(135deg, #cd1719, #8d1517); }
.cart-graphic span,
.payment-graphic span { position: absolute; display: block; border-radius: 999px; background: rgba(255,255,255,0.82); }
.cart-graphic span:nth-child(1) { width: 72px; height: 40px; left: 30px; top: 18px; border-radius: 10px; background: transparent; border: 4px solid rgba(255,255,255,0.84); }
.cart-graphic span:nth-child(2) { width: 13px; height: 13px; left: 38px; bottom: 12px; }
.cart-graphic span:nth-child(3) { width: 13px; height: 13px; right: 34px; bottom: 12px; }
.card-chip { width: 28px; height: 22px; left: 22px; top: 24px; border-radius: 6px; background: #f6d58a !important; }
.card-line { width: 78px; height: 7px; right: 20px; top: 30px; }
.card-line.short { width: 52px; top: 52px; opacity: 0.7; }

.cart-note,
.checkout-error {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 8px;
  line-height: 1.45;
}
.cart-note { border: 1px solid #f0d4d4; background: #fff7f7; color: #7a1b1d; }
.checkout-error { border: 1px solid #efb4b4; background: #fff1f1; color: #8f1d1d; font-weight: 700; }

.cart-layout,
.checkout-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 18px;
  align-items: start;
}

.cart-items-panel,
.cart-summary-card,
.cart-empty-state,
.checkout-form-panel {
  border: 1px solid #dfe6ee;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.cart-items-panel,
.cart-summary-card,
.checkout-form-panel {
  padding: 18px;
}

.cart-summary,
.checkout-summary {
  position: sticky;
  top: 92px;
  align-self: start;
}

.cart-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.cart-panel-head h2 { margin: 0; color: #12263a; font-size: 18px; }
.cart-panel-head span { color: #687586; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }

.cart-item-list { display: grid; gap: 10px; }
.cart-item {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 112px minmax(116px, auto);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid #edf1f6;
  border-radius: 8px;
  background: #fbfcfe;
}
.cart-item-thumb { display: grid; place-items: center; width: 86px; height: 72px; border: 1px solid #e3eaf2; border-radius: 8px; background: #fff; overflow: hidden; }
.cart-item-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.cart-item-main { min-width: 0; display: grid; gap: 5px; }
.cart-item-title { color: #12263a; font-weight: 700; line-height: 1.25; text-decoration: none; }
.cart-item-title:hover { color: var(--fujimac-blue); text-decoration: underline; }
.cart-item-sku,
.cart-item-price,
.cart-line-total span,
.cart-line-total small { color: #687586; font-size: 12px; }
.cart-qty-control { display: grid; gap: 5px; color: #4b5a67; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.cart-qty-control input { width: 100%; min-height: 42px; border: 1px solid #cfd9e4; border-radius: 6px; background: #fff; color: #12263a; padding: 8px 10px; font: inherit; font-size: 16px; text-align: center; }
.cart-line-total { display: grid; gap: 3px; justify-items: end; text-align: right; }
.cart-line-total strong { color: #12263a; font-size: 15px; }
.cart-update-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid #edf1f6; }
.cart-update-row span { color: #687586; font-size: 13px; }

.btn.btn-secondary,
.cart-update-btn,
.checkout-back-link {
  border: 1px solid #cfd9e4 !important;
  background: #ffffff !important;
  color: var(--fujimac-blue) !important;
}
.btn.btn-secondary:hover,
.cart-update-btn:hover,
.checkout-back-link:hover { border-color: var(--fujimac-blue) !important; background: #f5f9fc !important; }

.cart-summary-card { display: grid; gap: 14px; }
.cart-totals { display: grid; gap: 0; margin: 0; }
.cart-totals div { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-top: 1px solid #edf1f6; }
.cart-totals div:first-child { border-top: 0; }
.cart-totals dt { color: #536170; }
.cart-totals dd { margin: 0; color: #12263a; font-weight: 700; text-align: right; }
.cart-totals dd span { display: block; margin-top: 2px; color: #687586; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.cart-totals .cart-grand-total { margin-top: 4px; padding-top: 15px; border-top: 2px solid #dbe5ee; }
.cart-grand-total dt,
.cart-grand-total dd { color: var(--fujimac-blue); font-size: 18px; }
.cart-summary-copy { display: grid; gap: 8px; padding: 12px; border: 1px solid #e4ebf2; border-radius: 8px; background: #f7fafc; }
.cart-summary-copy p { margin: 0; color: #536170; font-size: 13px; line-height: 1.45; }
.cart-summary-copy a { color: var(--fujimac-blue); font-weight: 700; }
.cart-reassurance { display: grid; gap: 7px; }
.cart-reassurance span { position: relative; padding-left: 18px; color: #536170; font-size: 12px; }
.cart-reassurance span::before { content: ""; position: absolute; left: 0; top: 0.45em; width: 7px; height: 7px; border-radius: 50%; background: var(--fujimac-blue); }
.cart-checkout-btn,
.checkout-place-btn { display: flex; justify-content: center; margin-top: 0; padding: 13px 16px; background: var(--fujimac-red) !important; color: #fff !important; font-size: 12px; }
.cart-checkout-btn { width: 100%; }
.cart-checkout-btn:hover,
.checkout-place-btn:hover { background: #a91315 !important; }
.cart-empty-state { display: grid; place-items: center; min-height: 300px; padding: 34px 22px; text-align: center; }
.cart-empty-state h2 { margin: 6px 0 8px; color: #12263a; font-size: clamp(28px, 5vw, 42px); }
.cart-empty-state p { max-width: 430px; margin: 0 auto 14px; color: #536170; line-height: 1.5; }

.checkout-form-panel { display: grid; gap: 18px; }
.checkout-step { display: grid !important; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: start; padding-top: 4px; }
.checkout-step + .checkout-step { padding-top: 16px; border-top: 1px solid #edf1f6; }
.checkout-step-marker { display: grid !important; place-items: center; width: 30px; height: 30px; border-radius: 999px; background: var(--fujimac-blue); color: #fff; font-size: 13px; font-weight: 700; line-height: 1; }
.checkout-step h2 { margin: 0 0 4px; color: #12263a; font-size: 18px; }
.checkout-step p { margin: 0; color: #536170; font-size: 13px; line-height: 1.45; }
.checkout-field-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.checkout-field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.checkout-field { display: grid !important; gap: 6px; min-width: 0; color: #2d3743; font-size: 13px; font-weight: 700; }
.checkout-field span { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.checkout-field strong { color: #8f1d1d; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.checkout-field small,
.checkout-help { color: #687586; font-size: 12px; font-weight: 500; line-height: 1.4; }
.checkout-field input,
.checkout-field textarea,
.checkout-field select,
.checkout-address-select { width: 100%; min-height: 44px; border: 1px solid #cfd9e4; border-radius: 6px; background-color: #fff; color: #12263a; padding: 10px 12px; font: inherit; font-size: 15px; box-sizing: border-box; }
.checkout-field textarea { min-height: 118px; resize: vertical; line-height: 1.45; }
.checkout-field select,
.checkout-address-select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #536170 50%), linear-gradient(135deg, #536170 50%, transparent 50%); background-position: calc(100% - 18px) 19px, calc(100% - 12px) 19px; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-right: 34px; }
.checkout-address-lookup { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.checkout-address-lookup .btn { min-height: 44px; margin-top: 0; white-space: nowrap; }
.checkout-action-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid #edf1f6; }
.checkout-back-link { margin-top: 0; }
.checkout-place-btn { min-width: min(220px, 100%); border: 0 !important; }
.checkout-summary-items { display: grid; gap: 10px; margin: 0; padding: 0 0 12px; list-style: none; border-bottom: 1px solid #edf1f6; }
.checkout-summary-items li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.checkout-summary-items strong,
.checkout-summary-items span { display: block; }
.checkout-summary-items strong { color: #12263a; font-size: 13px; line-height: 1.3; }
.checkout-summary-items span { color: #687586; font-size: 12px; text-align: right; }
.checkout-summary-items div span { margin-top: 3px; text-align: left; }
.checkout-field input:focus,
.checkout-field textarea:focus,
.checkout-field select:focus,
.checkout-address-select:focus,
.checkout-back-link:focus,
.checkout-place-btn:focus,
.cart-qty-control input:focus { outline: 3px solid rgba(0, 64, 125, 0.18); outline-offset: 2px; border-color: var(--fujimac-blue); }

@media (max-width: 820px) {
  .list-header.cart-page-header,
  .list-header.checkout-page-header { display: grid; padding: 20px; }
  .cart-layout,
  .checkout-layout,
  .checkout-field-grid.two { grid-template-columns: 1fr; }
  .cart-summary,
  .checkout-summary { position: static; }
  .cart-item { grid-template-columns: 76px minmax(0, 1fr); align-items: start; }
  .cart-item-thumb { width: 76px; height: 68px; }
  .cart-qty-control,
  .cart-line-total { grid-column: 1 / -1; }
  .cart-line-total { justify-items: start; text-align: left; padding-top: 10px; border-top: 1px solid #edf1f6; }
  .cart-qty-control { grid-template-columns: auto minmax(92px, 130px); align-items: center; justify-content: space-between; }
  .cart-update-row,
  .checkout-action-row { align-items: stretch; }
  .cart-update-row button,
  .cart-update-row span,
  .checkout-action-row .btn { width: 100%; text-align: center; }
  .checkout-address-lookup,
  .checkout-summary-items li { grid-template-columns: 1fr; }
  .checkout-summary-items span { text-align: left; }
}

.checkout-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 14px;
  padding: 11px 12px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 12px;
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
}
.checkout-checkbox-row input {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  accent-color: #b91c1c;
  flex: 0 0 auto;
}
.checkout-shipping-fields {
  display: grid;
  gap: 14px;
}
.checkout-shipping-fields[hidden] {
  display: none !important;
}
.checkout-postcode-field {
  max-width: 320px;
}

.payment-handoff-shell {
  max-width: 960px;
  margin: 0 auto;
}
.payment-handoff-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 28px;
  align-items: center;
  padding: 30px;
  border: 1px solid #dfe6ee;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}
.payment-confirm-card {
  grid-template-columns: 1fr;
  max-width: 720px;
  margin: 0 auto;
}
.payment-handoff-copy h1 {
  margin: 4px 0 10px;
  color: var(--fujimac-blue);
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1;
}
.payment-handoff-lead {
  max-width: 620px;
  margin: 0 0 18px;
  color: #536170;
  font-size: 16px;
  line-height: 1.55;
}
.payment-handoff-summary {
  display: grid;
  gap: 0;
  max-width: 520px;
  margin: 0 0 20px;
  border: 1px solid #e4ebf2;
  border-radius: 10px;
  overflow: hidden;
}
.payment-handoff-summary div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-top: 1px solid #e4ebf2;
  background: #fbfcfe;
}
.payment-handoff-summary div:first-child { border-top: 0; }
.payment-handoff-summary dt { color: #536170; font-weight: 700; }
.payment-handoff-summary dd { margin: 0; color: #12263a; font-weight: 800; text-align: right; }
.payment-handoff-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.payment-launch-btn {
  background: var(--fujimac-red) !important;
  color: #fff !important;
  padding: 13px 18px !important;
}
.payment-handoff-note {
  max-width: 580px;
  margin: 14px 0 0;
  color: #687586;
  font-size: 13px;
  line-height: 1.45;
}
.payment-handoff-visual {
  position: relative;
  min-height: 220px;
  border-radius: 18px;
  background: linear-gradient(145deg, #f8fbff, #eef5fb);
  border: 1px solid #e4ebf2;
  overflow: hidden;
}
.payment-card-shape {
  position: absolute;
  left: 34px;
  top: 48px;
  width: 190px;
  height: 116px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--fujimac-blue), #0d6ba5);
  box-shadow: 0 18px 34px rgba(0, 64, 125, 0.20);
}
.payment-lock-shape {
  position: absolute;
  left: 74px;
  top: 78px;
  width: 38px;
  height: 34px;
  border-radius: 8px;
  background: #fff;
}
.payment-lock-shape::before {
  content: "";
  position: absolute;
  left: 8px;
  top: -18px;
  width: 22px;
  height: 22px;
  border: 5px solid #fff;
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
}
.payment-line-shape {
  position: absolute;
  right: 44px;
  bottom: 62px;
  width: 96px;
  height: 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.82);
}
@media (max-width: 820px) {
  .payment-handoff-card { grid-template-columns: 1fr; padding: 22px; }
  .payment-handoff-visual { display: none; }
  .payment-handoff-actions .btn { width: 100%; text-align: center; }
}

/* Payment provider handoff */
.payment-transition-shell {
  max-width: 880px;
  margin: 0 auto;
}

.payment-transition-card {
  display: grid;
  gap: 18px;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid #dfe6ee;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.payment-status-column {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.payment-status-column h1 {
  margin: 0 0 8px;
  color: var(--fujimac-blue);
  font-size: clamp(32px, 5vw, 50px);
  line-height: 1;
}

.payment-transition-lead {
  max-width: 620px;
  margin: 0;
  color: #536170;
  font-size: 16px;
  line-height: 1.5;
}

.payment-spinner {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  border: 5px solid #e6edf5;
  border-top-color: var(--fujimac-red);
  animation: fujimac-payment-spin 0.9s linear infinite;
}

@keyframes fujimac-payment-spin {
  to { transform: rotate(360deg); }
}

.payment-summary-panel,
.payment-action-panel {
  border: 1px solid #e3eaf2;
  border-radius: 10px;
  background: #fff;
  padding: 18px;
}

.payment-summary-list div:first-child {
  border-top: 0;
}

.payment-trust-copy,
.payment-action-panel p {
  margin: 12px 0 0;
  color: #536170;
  font-size: 13px;
  line-height: 1.45;
}

.payment-action-panel {
  display: grid;
  gap: 12px;
}

.payment-action-panel p {
  margin: 0;
}

.payment-continue-btn {
  display: flex;
  justify-content: center;
  padding: 14px 18px;
  background: var(--fujimac-red) !important;
  color: #fff !important;
  font-size: 13px;
}

.payment-continue-btn:hover {
  background: #a91315 !important;
}

.payment-back-link {
  justify-self: center;
  margin-top: 0;
}

@media (max-width: 680px) {
  .payment-status-column {
    grid-template-columns: 1fr;
  }

  .payment-spinner {
    width: 46px;
    height: 46px;
  }

  .payment-back-link,
  .payment-continue-btn {
    width: 100%;
    text-align: center;
  }
}
