@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Vollkorn:wght@400;500;600&display=swap');

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #fff;
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
}

.checkout-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
}

.section-wrapper {
  background: #fff;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border: 1px solid #e0e0e0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  background: #f8f9fa;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  border-bottom: 1px solid #e0e0e0;
}

.section-header span {
  font-size: 1rem;
  font-weight: 500;
  color: #1a1a1a;
}

.section-content {
  padding: 1.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-control {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 0.9375rem;
  color: #333;
  background: #fff;
}

.form-control:focus {
  outline: none;
  border-color: #0066cc;
}

.form-control::placeholder {
  color: #757575;
}

.address-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.product-details-section {
  margin-bottom: 2rem;
}

.product-item {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.product-image {
  flex: 0 0 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  border-radius: 12px;
}

.product-info {
  flex: 1;
}

.product-name {
  font-size: 1.5rem;
  font-weight: 500;
  color: #333;
  margin-bottom: 1.5rem;
}

.product-variants {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
  margin-top: 0.5rem;
}

.variant-option {
  position: relative;
  padding: 0;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  background: white;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  overflow: hidden;
}

.variant-option.selected {
  border-color: #00bcd4;
  background: #e0f7fa;
}

.variant-banner {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 500;
  color: white;
  background: #00bcd4;
  margin: 0;
}

.variant-content {
  padding: 10px;
  background: #f8f8f8;
  text-align: center;
}

.variant-option.selected .variant-content {
  background: #e0f7fa;
}

.variant-name {
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 0.75rem;
  font-family: 'Vollkorn', serif;
  text-align: center;
}

.variant-battery {
  font-size: 1rem;
  color: #666;
  margin-bottom: 0.75rem;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.variant-price {
  font-size: 1.125rem;
  font-weight: 700;
  color: #333;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.quantity-section,
.subscription-section,
.addons-section {
  margin-bottom: 1rem;
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.quantity-label,
.subscription-label,
.addons-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #1a1a1a;
  padding-left: 0.5rem;
}

.subscription-select {
  width: 100%;
  padding: 12px 0.75rem;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: white;
  font-size: 0.9rem;
  color: #333;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  min-height: 44px;
}

.subscription-select:focus {
  outline: none;
  border-color: #0066cc;
}

.subscription-note {
  font-size: 0.8rem;
  color: #666;
  text-align: center;
  font-style: italic;
}

.quantity-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: white;
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.quantity-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #f8f9fa;
  border-radius: 6px;
  cursor: pointer;
  font-size: 18px;
  color: #333;
  transition: all 0.2s ease;
}

.quantity-btn:hover {
  background: #e9ecef;
}

.quantity-input {
  width: 40px;
  text-align: center;
  border: none;
  background: none;
  font-size: 18px;
  color: #333;
  padding: 0;
  font-weight: 500;
}

.quantity-input::-webkit-inner-spin-button,
.quantity-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.checkbox-group {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: white;
  transition: all 0.2s ease;
}

.checkbox-label:hover {
  border-color: #00bcd4;
  background: #f8f8f8;
}

.checkbox-label input[type='checkbox'] {
  margin: 0.25rem 1rem 0 0;
  width: 18px;
  height: 18px;
}

.addon-content {
  flex: 1;
}

.addon-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.addon-name {
  font-weight: 500;
  color: #333;
  font-size: 0.9rem;
}

.addon-price {
  color: #666;
  font-size: 0.9rem;
}

.addon-description {
  font-size: 0.875rem;
  color: #666;
  margin-top: 0.25rem;
}

.discount-section input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 0.9375rem;
  margin-bottom: 0.75rem;
}

.discount-section button {
  width: 100%;
  padding: 0.875rem 1rem;
  background: #f5f5f5;
  border: none;
  border-radius: 4px;
  color: #1a1a1a;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.discount-section button:hover {
  background: #e9ecef;
}

.summary-section {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  color: #1a1a1a;
  font-size: 0.9375rem;
}

.summary-row.total {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e0e0e0;
  font-size: 1.125rem;
  font-weight: 600;
}

.currency-section {
  margin: 0.5rem 0;
  text-align: left;
  padding: 0.5rem 0;
  border-bottom: 1px solid #e0e0e0;
}

.currency-label {
  display: inline;
  margin-right: 8px;
  font-size: 0.9rem;
  color: #666;
}

.currency-select {
  width: auto;
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  background-color: white;
  cursor: pointer;
}

.btn-submit {
  width: 100%;
  height: 49px;
  padding: 17px 34px 17px 34px;
  background: rgb(225, 52, 30);
  color: rgb(255, 255, 255);
  border: 0.666667px solid rgb(225, 52, 30);
  border-radius: 50px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 14px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s linear;
  -webkit-font-smoothing: antialiased;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto;
  text-align: center;
}

.btn-submit .btn-lock {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  font-size: 1.2em;
}

.btn-submit:hover {
  background: rgb(200, 45, 25);
  transform: translateY(-1px);
}

.btn-submit:disabled {
  background: rgb(225, 52, 30, 0.5);
  cursor: not-allowed;
  transform: none;
}

.payment-security {
  text-align: center;
  margin-top: 1rem;
  padding: 0.75rem;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
}

.payment-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.card-icon-svg {
  width: 48px;
  height: 48px;
}

.card-icon-svg,
.payment-icons svg {
  width: 48px !important;
  height: 30px !important;
  transition: transform 0.2s ease;
  border-radius: 2px;
  overflow: hidden;
}

.card-icon-svg:hover {
  transform: scale(1.05);
}

.card-icon.generic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 20px;
  padding: 2px 6px;
  font-size: 0.75rem;
  border-radius: 3px;
  border: 1px solid #ddd;
  background: #666;
  color: white;
  text-align: center;
  transition: transform 0.2s ease;
}

.card-icon.generic:hover {
  transform: scale(1.05);
}

.payment-security-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25em;
}

.payment-security-text > span {
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.trial-note {
  margin-top: 0.25em;
  font-size: 1em;
  color: #222;
  text-align: center;
  width: 100%;
}

.lock-icon {
  flex-shrink: 0;
}

#card-element {
  padding: 0.875rem 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: #fff;
}

#card-element.StripeElement--focus {
  border-color: #0066cc;
}

#card-errors {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.form-control.invalid {
  border-color: #dc3545;
  background-color: #fff8f8;
}

@media (max-width: 1024px) {
  .checkout-container {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 1rem;
  }
  .checkout-sidebar {
    margin-top: 0 !important;
  }
}

@media (max-width: 768px) {
  .address-grid {
    grid-template-columns: 1fr;
  }
  .product-item {
    flex-direction: column;
  }
  .product-image {
    flex: 0 0 auto;
    width: 75%;
    margin: 0 auto;
  }
  .product-info {
    text-align: center;
  }
  .product-variants {
    grid-template-columns: 1fr;
  }
  .variant-option {
    width: 75%;
    margin: 0 auto;
  }
  .product-details-section {
    background: #f8f9fa;
    border-radius: 12px;
    outline: 1px solid #e0e0e0;
  }
  .checkout-sidebar {
    margin-top: 0 !important;
  }
}

.policy-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-top: 2rem;
  padding: 1rem 0;
  border-top: 1px solid #e0e0e0;
}

.policy-links a {
  color: #0000ee;
  text-decoration: none;
  font-size: 0.9rem;
}

.policy-links a:visited {
  color: #551a8b;
}

.policy-links a:hover {
  text-decoration: underline;
}

.checkout-sidebar {
  margin-top: 40px;
}

.step-indicator {
  box-sizing: border-box;
  color: rgb(5, 6, 15);
  display: inline;
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-style: normal;
  font-weight: 700;
  height: auto;
  line-height: 26px;
  overflow-wrap: break-word;
  text-align: center;
  text-size-adjust: 100%;
  width: auto;
  word-break: break-word;
  -webkit-font-smoothing: antialiased;
  margin-bottom: 1.5rem;
}

/* Coupon input and button styling */
/* Accessibility improvements - focus states, screen reader support */
#coupon-code {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 0.9375rem;
  color: #333;
  background: #fff;
  box-sizing: border-box;
  margin-bottom: 0.75rem;
}

#coupon-code:focus {
  outline: none;
  border-color: #0066cc;
}

#coupon-code::placeholder {
  color: #757575;
}

#apply-coupon {
  background: #f5f5f5;
  color: #222;
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 4px 4px;
  transition: background 0.2s;
  margin-bottom: 10px;
}

#apply-coupon:hover:not(:disabled) {
  background: #e5e7eb;
}

/* Coupon message styling */
#coupon-message {
  margin-top: 16px;
  margin-bottom: 16px;
  padding: 12px;
  border-radius: 4px;
  font-size: 1.05em;
  font-weight: 500;
  display: block;
}

.coupon-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #10b981;
}

.coupon-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #f87171;
}

/* Simple loading placeholder */
.loading-placeholder {
  opacity: 0.7;
  font-style: italic;
  color: #666;
  padding: 2px 4px;
  display: inline-block;
  min-width: 60px;
}

/* Trial price after loading is complete */
.trial-price-loaded {
  color: #333;
  font-weight: 500;
  padding: 2px 4px;
  border-radius: 3px;
  display: inline-block;
}

/* ======================================== */
/* ACCESSIBILITY ENHANCEMENTS */
/* ======================================== */

/* Screen reader only content */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Error message styling */
.error-message {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  min-height: 1.25rem;
}

.error-message:empty {
  display: none;
}

/* Enhanced focus states for all interactive elements */
.checkout-container .form-control:focus,
.checkout-container .quantity-input:focus,
.checkout-container .subscription-select:focus,
.checkout-container .currency-select:focus,
.checkout-container #coupon-code:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.checkout-container .btn-submit:focus {
  outline: 2px solid #1f2937;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(31, 41, 55, 0.3);
}

.checkout-container .quantity-btn:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Enhanced variant selection accessibility */
.checkout-container .variant-option:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.variant-option[aria-checked='true'] {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.05);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .checkout-container .form-control:focus,
  .checkout-container .quantity-input:focus,
  .checkout-container .subscription-select:focus,
  .checkout-container .currency-select:focus,
  .checkout-container #coupon-code:focus {
    outline: 3px solid currentColor !important;
    outline-offset: 1px !important;
  }

  .error-message {
    font-weight: bold;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .checkout-container * {
    transition-duration: 0.01ms !important;
  }
}
