:root {
  --bg-page: #f5f5f7;
  --bg-panel: #ffffff;
  --bg-summary: #f9fafb;
  --border-color: #e5e7eb;
  --text-main: #111827;
  --text-muted: #6b7280;
  --accent: #111827;
  --accent-hover: #000000;
  --radius: 8px;
  --shadow-soft: 0 10px 25px rgba(15, 23, 42, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #f9fafb, #e5e7eb);
  color: var(--text-main);
}

.checkout-page {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 32px 16px;
}

.checkout-container {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr);
  gap: 32px;
  max-width: 1100px;
  width: 100%;
}

.checkout-left {
  background: var(--bg-panel);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-soft);
}

.checkout-title {
  margin: 0 0 24px;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.checkout-section + .checkout-section {
  margin-top: 24px;
}

.checkout-section h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.section-help {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.field-label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.field-label input {
  margin-top: 4px;
}

.field-input {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  background-color: #f9fafb;
}

.field-input:focus {
  border-color: #111827;
  box-shadow: 0 0 0 1px #11182710;
  background-color: #ffffff;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.field-row .field-label:first-child:nth-last-child(2),
.field-row .field-label:first-child:nth-last-child(2) ~ .field-label {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.checkbox-inline input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.shipping-option {
  display: flex;
  align-items: center;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  background: #f9fafb;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.shipping-option input[type="radio"] {
  margin-right: 10px;
}

.shipping-option:hover {
  border-color: #d1d5db;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(17, 24, 39, 0.04);
}

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

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

.card-element-container {
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background-color: #f9fafb;
  margin-bottom: 10px;
}

.payment-method-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--border-color);
  border-radius: 6px 6px 0 0;
  padding: 10px 12px;
  background: #f3f4f6;
  border-bottom: none;
}

.payment-method-name {
  font-size: 14px;
  font-weight: 500;
}

.payment-brand-logos {
  display: flex;
  gap: 6px;
}

.brand-dot {
  width: 20px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
}

.brand-dot.visa {
  background: linear-gradient(135deg, #1a3d8f, #235ad4);
}

.brand-dot.mc {
  background: radial-gradient(circle at 30% 50%, #eb001b 0, #eb001b 40%, transparent 45%),
    radial-gradient(circle at 70% 50%, #f79e1b 0, #f79e1b 40%, transparent 45%),
    #ff5f00;
}

.brand-dot.amex {
  background: linear-gradient(135deg, #2e77bb, #3aa1e0);
}

.brand-dot.disc {
  background: linear-gradient(135deg, #f47216, #fbbf24);
}

.billing-address {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.billing-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 500;
}

.billing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.card-errors {
  color: #b91c1c;
  font-size: 13px;
  min-height: 18px;
}

.pay-button {
  width: 100%;
  margin-top: 8px;
  padding: 12px 16px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #ffffff;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.05s, box-shadow 0.15s;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.pay-button:hover {
  background: var(--accent-hover);
}

.pay-button:active {
  transform: translateY(1px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.14);
}

.pay-button:disabled {
  opacity: 0.7;
  cursor: default;
  box-shadow: none;
}

.payment-message {
  margin-top: 12px;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 6px;
}

.payment-message.success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.payment-message.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.hidden {
  display: none;
}

.checkout-right {
  background: var(--bg-summary);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow-soft);
}

.checkout-right h2 {
  margin-top: 0;
  margin-bottom: 16px;
}

.order-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 14px;
}

.order-item-thumb-wrap {
  position: relative;
  flex: 0 0 auto;
  width: 68px;
  height: 68px;
  border-radius: 12px;
  overflow: hidden;
  background: #f3f4f6;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.order-item-qty-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #374151;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 22px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.order-item-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  vertical-align: middle;
}

.order-item-thumb-placeholder {
  width: 100%;
  height: 100%;
  min-height: 68px;
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.order-item-main {
  flex: 1;
  min-width: 0;
}

.order-item-name {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

.order-item-subtext {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.4;
}

.order-item-price {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
  padding-top: 2px;
}

.order-item-price-free {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.order-item-price-amount {
  font-weight: 600;
}

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

.order-summary-row.total {
  font-size: 16px;
}

.order-summary-row--subtotal .order-summary-amount--bold {
  font-weight: 700;
}

.order-summary-row--shipping .order-summary-amount--muted {
  color: var(--text-muted);
  font-weight: 400;
}

.order-summary-row--total {
  font-weight: 700;
  font-size: 17px;
  margin-top: 2px;
}

.order-summary-row--total .order-summary-amount--total {
  font-weight: 700;
  font-size: 17px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.order-summary-divider {
  border-top: 1px solid var(--border-color);
  margin: 12px 0;
}

.order-summary-currency {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

.discount-code-row {
  align-items: flex-start;
}

.discount-code-wrap {
  width: 100%;
}

.discount-code-label {
  margin: 0 0 6px 0;
}

.discount-input-group {
  display: flex;
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
  background: #f9fafb;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.discount-input-group:focus-within {
  border-color: #111827;
  box-shadow: 0 0 0 1px #11182710;
  background: #ffffff;
}

.discount-code-input {
  border: none;
  border-radius: 0;
  background: transparent;
}

.discount-code-input:focus {
  box-shadow: none;
  background: transparent;
}

.discount-apply-btn {
  height: 42px;
  min-width: 96px;
  padding: 0 16px;
  border: none;
  border-left: 1px solid #d1d5db;
  border-radius: 0;
  background: linear-gradient(180deg, #ffffff 0%, #f3f4f6 100%);
  color: #111827;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
  box-shadow: 0 2px 6px rgba(17, 24, 39, 0.06);
}

.discount-apply-btn:hover {
  background: #ffffff;
}

.discount-apply-btn:hover:not(:disabled) {
  background: #ffffff;
  box-shadow: inset 0 0 0 9999px rgba(17, 24, 39, 0.03);
}

.discount-apply-btn:active {
  box-shadow: inset 0 0 0 9999px rgba(17, 24, 39, 0.06);
}

.discount-apply-btn:focus-visible {
  outline: 2px solid #111827;
  outline-offset: 2px;
}

.discount-apply-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.discount-input-group--shopify {
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #fff;
}

.discount-input-group--shopify .discount-code-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  font-size: 14px;
}

.discount-apply-btn--solid {
  min-width: 100px;
  height: auto;
  align-self: stretch;
  border-left: 1px solid #111827 !important;
  border-radius: 0 9px 9px 0 !important;
  background: #111827 !important;
  color: #fff !important;
  font-weight: 700;
  box-shadow: none !important;
}

.discount-apply-btn--solid:hover:not(:disabled) {
  background: #000 !important;
  color: #fff !important;
}

@media (max-width: 880px) {
  .checkout-container {
    grid-template-columns: minmax(0, 1fr);
  }

  .checkout-right {
    order: -1;
  }
}

@media (max-width: 600px) {
  .checkout-left,
  .checkout-right {
    padding: 20px 16px;
  }

  .checkout-page {
    padding: 16px 8px;
  }
}

.order-item-recurring {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

