:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --border: #e1e3e6;
  --border-soft: #f0f1f3;
  --text: #1f2933;
  --muted: #6b7280;
  --blue: #1a73e8;
  --blue-dark: #1558b0;
  --error: #d93025;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.checkout-wrapper {
  min-height: 100vh;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
}

.checkout-header {
  border-bottom: 1px solid var(--border);
  background: #ffffff;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.logo {
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 16px;
}

.trust-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.trust-rating {
  font-weight: 600;
}

.header-right {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.header-right a {
  color: var(--muted);
  text-decoration: none;
}

.header-right a:hover {
  text-decoration: underline;
}

.checkout-main {
  padding: 24px 0 40px;
}

.checkout-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.checkout-forms {
  flex: 1;
}

.order-summary {
  flex: 0 0 auto;
}

/* Panels */
.panel {
  background: var(--card);
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.panel-header {
  padding: 16px 16px 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-header h2 {
  font-size: 18px;
}

.panel-link {
  font-size: 14px;
  color: var(--blue);
  text-decoration: none;
}

.panel-link:hover {
  text-decoration: underline;
}

.panel-subtitle {
  font-size: 13px;
  color: var(--muted);
}

.panel-body {
  padding: 12px 16px 16px 16px;
}

/* Fields */
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.field-label {
  font-size: 13px;
  color: var(--muted);
}

.field input,
.field select {
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 14px;
  background: #fbfbfc;
}

.field input:focus,
.field select:focus {
  outline: 2px solid var(--blue);
  outline-offset: 0;
  border-color: var(--blue);
  background: #ffffff;
}

.field-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field-error {
  font-size: 12px;
  color: var(--error);
  min-height: 14px;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-top: 4px;
}

.checkbox-field input {
  width: 16px;
  height: 16px;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}

.crumb {
  color: var(--muted);
}

.crumb.active {
  color: var(--text);
  font-weight: 600;
}

.crumb-sep {
  margin: 0 4px;
}

/* Shipping method */
.shipping-placeholder {
  font-size: 13px;
  color: var(--muted);
  padding: 10px 12px;
  background: var(--border-soft);
  border-radius: 6px;
}

.shipping-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.shipping-option input {
  width: 16px;
  height: 16px;
}

.shipping-content {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 14px;
}

.shipping-price {
  font-weight: 600;
}

.hidden {
  display: none;
}

/* Payment */
.payment-method {
  border-radius: 8px;
  border: 1px solid var(--border);
}

.payment-method-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.payment-method-body {
  padding: 12px 16px 16px 16px;
}

.card-element {
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  background: #fbfbfc;
}

.card-element.StripeElement--focus {
  border-color: var(--blue);
}

/* Card input fields styling */
#card-number,
#card-expiry,
#card-cvc {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  background: #fbfbfc;
  font-size: 14px;
  font-family: inherit;
}

#card-number:focus,
#card-expiry:focus,
#card-cvc:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.primary-button {
  width: 100%;
  margin-top: 12px;
  background: var(--blue);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.primary-button:hover {
  background: var(--blue-dark);
}

.payment-error {
  margin-top: 8px;
  font-size: 13px;
  color: var(--error);
}

.honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
}

/* Footer */
.checkout-footer {
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 8px;
}

.checkout-footer a {
  color: var(--muted);
  text-decoration: none;
}

.checkout-footer a:hover {
  text-decoration: underline;
}

.secure-badge {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.terms-notice {
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
}

.terms-notice a {
  color: var(--blue);
  text-decoration: none;
}

.terms-notice a:hover {
  text-decoration: underline;
}

/* Order summary */
.order-summary {
  background: #fafbfc;
  border-left: none;
}

.summary-inner {
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 16px;
  background: #ffffff;
}

.summary-item {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.summary-product {
  display: flex;
  align-items: center;
  gap: 12px;
}

.summary-image {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.summary-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.summary-qty {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #111827;
  color: #ffffff;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
}

.summary-info {
  flex: 1;
}

.summary-title {
  font-size: 14px;
  font-weight: 600;
}

.summary-subtitle {
  font-size: 12px;
  color: var(--muted);
}

.summary-price {
  font-weight: 600;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 6px;
}

.savings-row span:last-child {
  color: #15803d;
  font-weight: 600;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
}

.summary-total-amount {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.summary-total-amount .currency {
  font-size: 12px;
  color: var(--muted);
}

/* Responsive */
@media (min-width: 480px) {
  .container {
    padding: 0 24px;
  }
}

@media (min-width: 768px) {
  .checkout-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .field-row {
    flex-direction: row;
  }

  .field-row .field {
    flex: 1;
  }
}

@media (min-width: 1024px) {
  .checkout-main {
    padding: 40px 0 60px;
  }

  .checkout-layout {
    flex-direction: row;
    align-items: flex-start;
    gap: 40px;
  }

  .checkout-forms {
    flex: 0 0 60%;
  }

  .order-summary {
    flex: 0 0 40%;
    border-left: 1px solid var(--border);
  }

  .summary-inner {
    position: sticky;
    top: 24px;
  }
}
