/* CRO-Optimized Checkout CSS */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #f5f5f5;
  color: #333;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Page Layout - Shopify Style */
.page-wrapper {
  display: flex;
  min-height: 100vh;
}

.main-column {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  background: #fff;
  padding: 0 4% 0 0;
}

.main-content {
  width: 100%;
  max-width: 470px;
  padding: 40px 0 48px;
}

.sidebar-column {
  flex: 1;
  background: #fafafa;
  border-left: 1px solid #e5e5e5;
  padding: 0 0 0 4%;
}

.sidebar-content {
  width: 100%;
  max-width: 380px;
  padding: 40px 0;
  position: sticky;
  top: 0;
}

/* Header */
.checkout-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.logo img {
  max-height: 45px;
  width: auto;
}

.secure-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #16a34a;
  font-weight: 500;
}

.secure-badge svg {
  stroke: #16a34a;
}

/* Mobile Summary Toggle */
.mobile-summary-toggle {
  display: none;
  background: #fafafa;
  border: 1px solid #e1e1e1;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
  cursor: pointer;
  justify-content: space-between;
  align-items: center;
}

.toggle-left {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #1a73e8;
  font-weight: 500;
}

.toggle-chevron {
  transition: transform 0.2s;
}

.toggle-price {
  font-weight: 700;
  font-size: 18px;
  color: #111;
}

.mobile-summary {
  display: none;
  background: #fafafa;
  border: 1px solid #e1e1e1;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.mobile-summary.active {
  display: block;
}

/* Urgency Banner */
.urgency-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
  border-radius: 10px;
  padding: 14px 20px;
  margin-bottom: 28px;
  font-size: 15px;
  color: #fff;
  font-weight: 500;
}

.urgency-icon {
  display: flex;
  animation: pulse 1.5s infinite;
}

.urgency-icon svg {
  stroke: #fff;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.urgency-banner strong {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: rgba(255,255,255,0.2);
  padding: 2px 8px;
  border-radius: 4px;
}

/* Form Sections */
.form-section {
  margin-bottom: 28px;
}

.form-section h2 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #111;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-section h2::before {
  content: '';
  width: 4px;
  height: 18px;
  background: #1a73e8;
  border-radius: 2px;
}

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

.section-header h2 {
  margin-bottom: 0;
}

.section-link {
  color: #1a73e8;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}

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

/* Form Grid */
.form-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.form-field {
  position: relative;
}

.form-field.full {
  width: 100%;
}

.form-field.half {
  width: calc(50% - 6px);
}

/* Form Inputs */
.form-input {
  width: 100%;
  height: 52px;
  padding: 20px 14px 6px;
  border: 2px solid #e1e1e1;
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
  transition: all 0.2s;
}

.form-input:hover {
  border-color: #c1c1c1;
}

.form-input:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.form-input:focus + .floating-label,
.form-input:not(:placeholder-shown) + .floating-label {
  top: 8px;
  font-size: 11px;
  color: #666;
  font-weight: 500;
}

.floating-label {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  color: #888;
  pointer-events: none;
  transition: all 0.2s;
  background: #fff;
  padding: 0 4px;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

/* Checkbox */
.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #1a73e8;
  cursor: pointer;
}

.checkbox-label {
  font-size: 14px;
  color: #555;
}

/* Shipping Options */
.shipping-options {
  border-radius: 10px;
  overflow: hidden;
}

.shipping-option {
  display: flex;
  align-items: center;
  padding: 18px;
  cursor: pointer;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 2px solid #1a73e8;
  border-radius: 10px;
}

.option-radio {
  width: 22px;
  height: 22px;
  border: 2px solid #1a73e8;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 14px;
  flex-shrink: 0;
}

.radio-dot {
  width: 12px;
  height: 12px;
  background: #1a73e8;
  border-radius: 50%;
}

.option-details {
  flex: 1;
}

.option-name {
  display: block;
  font-weight: 600;
  color: #111;
  font-size: 15px;
}

.option-time {
  font-size: 13px;
  color: #666;
}

.option-price {
  font-weight: 700;
  color: #16a34a;
  font-size: 15px;
}

/* Payment Section */
.payment-subtitle {
  font-size: 13px;
  color: #666;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.payment-subtitle::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #16a34a;
  border-radius: 50%;
}

#checkout-frame {
  width: 100%;
  min-height: 350px;
  background: #fafafa;
  border-radius: 10px;
  overflow: hidden;
}

#checkout-frame iframe {
  width: 100% !important;
  min-height: 350px;
  border: none !important;
}

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: #666;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e1e1e1;
  border-top-color: #1a73e8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 14px;
}

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

/* Trust Section */
.trust-section {
  margin: 28px 0;
  padding: 20px;
  background: #f8fffe;
  border: 1px solid #d1fae5;
  border-radius: 10px;
}

.trust-badges {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 16px;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #166534;
  font-weight: 500;
}

.trust-badge svg {
  stroke: #16a34a;
  flex-shrink: 0;
}

/* Reviews Section */
.reviews-section {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid #eee;
}

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

.reviews-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
  color: #111;
}

.reviews-rating {
  font-size: 13px;
  color: #666;
  font-weight: 500;
}

.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.review-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 18px;
}

.review-stars {
  display: flex;
  gap: 2px;
  margin-bottom: 10px;
}

.review-text {
  font-size: 14px;
  color: #333;
  margin-bottom: 12px;
  line-height: 1.6;
  font-style: italic;
}

.review-author {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.author-name {
  font-weight: 600;
  color: #111;
}

.verified {
  color: #16a34a;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.verified::before {
  content: '✓';
  font-weight: 700;
}

/* Footer */
.checkout-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #eee;
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  color: #666;
  text-decoration: none;
  font-size: 12px;
}

.footer-links a:hover {
  color: #1a73e8;
}

/* Sidebar - Product List */
.product-list {
  margin-bottom: 24px;
}

.product-item {
  display: flex;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #eee;
}

.product-item:last-child {
  border-bottom: none;
}

.product-image {
  position: relative;
  width: 70px;
  height: 70px;
  border-radius: 10px;
  border: 1px solid #e1e1e1;
  overflow: hidden;
  background: #fff;
  margin-right: 16px;
  flex-shrink: 0;
}

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

.product-quantity {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #1a73e8;
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.product-info {
  flex: 1;
  min-width: 0;
}

.product-title {
  font-weight: 600;
  color: #111;
  font-size: 14px;
  margin-bottom: 4px;
}

.product-variant {
  font-size: 12px;
  color: #666;
}

.product-price {
  font-weight: 700;
  font-size: 15px;
  color: #111;
  margin-left: 12px;
}

/* Discount Form */
.discount-form {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
}

.discount-input {
  flex: 1;
  height: 48px;
  padding: 0 14px;
  border: 2px solid #e1e1e1;
  border-radius: 10px;
  font-size: 14px;
  transition: all 0.2s;
}

.discount-input:focus {
  outline: none;
  border-color: #1a73e8;
}

.discount-input::placeholder {
  color: #999;
}

.discount-btn {
  padding: 0 24px;
  height: 48px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.discount-btn:hover {
  background: #333;
}

/* Summary Totals */
.summary-totals {
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 14px;
  color: #555;
}

.summary-line.total {
  padding-top: 18px;
  margin-top: 10px;
  border-top: 2px solid #111;
  font-size: 18px;
  color: #111;
}

.shipping-value {
  color: #16a34a;
  font-weight: 600;
}

.discount-value {
  color: #16a34a;
  font-weight: 600;
}

.total-value {
  font-weight: 800;
  font-size: 24px;
}

.total-value small {
  font-size: 14px;
  font-weight: 500;
  color: #666;
  margin-right: 4px;
}

/* Sidebar Trust */
.sidebar-trust {
  margin-top: 28px;
}

.guarantee-box {
  display: flex;
  gap: 14px;
  padding: 18px;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #bbf7d0;
  border-radius: 12px;
}

.guarantee-box svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.guarantee-box strong {
  display: block;
  font-size: 14px;
  color: #166534;
  margin-bottom: 4px;
}

.guarantee-box p {
  font-size: 13px;
  color: #166534;
  margin: 0;
  line-height: 1.4;
}

/* Responsive */
@media (max-width: 1100px) {
  .main-column {
    padding: 0 3% 0 0;
  }

  .main-content {
    max-width: 440px;
  }

  .sidebar-column {
    padding: 0 0 0 3%;
  }

  .sidebar-content {
    max-width: 340px;
  }
}

@media (max-width: 999px) {
  .page-wrapper {
    flex-direction: column;
  }

  .main-column {
    justify-content: center;
    padding: 0;
  }

  .main-content {
    max-width: 100%;
    padding: 20px;
  }

  .sidebar-column {
    display: none;
  }

  .mobile-summary-toggle {
    display: flex;
  }

  .checkout-header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .form-field.half {
    width: 100%;
  }

  .trust-badges {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .reviews-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  .main-content {
    padding: 16px;
  }

  .urgency-banner {
    font-size: 14px;
    padding: 12px 16px;
    border-radius: 8px;
  }

  .form-section h2 {
    font-size: 16px;
  }

  .form-input {
    height: 50px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .shipping-option {
    padding: 14px;
  }

  .trust-section {
    padding: 16px;
  }

  .review-card {
    padding: 14px;
  }

  .footer-links {
    gap: 16px;
  }

  .product-image {
    width: 60px;
    height: 60px;
  }

  .total-value {
    font-size: 22px;
  }
}

/* Animations */
@media (prefers-reduced-motion: no-preference) {
  .form-input,
  .discount-input,
  .discount-btn,
  .shipping-option {
    transition: all 0.2s ease;
  }
}

/* Focus visible for accessibility */
.form-input:focus-visible,
.discount-input:focus-visible,
.checkbox-wrapper input:focus-visible {
  outline: 2px solid #1a73e8;
  outline-offset: 2px;
}
