:root {
  --bg-dark: #0f172a;
  --card-bg: rgba(30, 41, 59, 0.7);
  --border-color: rgba(255, 255, 255, 0.1);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent-color: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.25);
  --success-color: #4ade80;
  --warning-color: #fbbf24;
  --error-color: #f87171;
  --radius-lg: 16px;
  --radius-md: 10px;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, rgba(56, 189, 248, 0.12) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(99, 102, 241, 0.12) 0px, transparent 50%);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 16px;
}

.app-container {
  width: 100%;
  max-width: 480px;
}

.app-header {
  text-align: center;
  margin-bottom: 16px;
}

.logo-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--accent-glow);
  color: var(--accent-color);
  border: 1px solid rgba(56, 189, 248, 0.3);
  margin-bottom: 6px;
}

.app-header h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.checkout-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.order-summary h2 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

.item-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.product-attributes h2 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.required-tag {
  font-size: 11px;
  color: var(--warning-color);
  font-weight: 500;
}

.attribute-group {
  margin-bottom: 10px;
}

.attribute-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 4px;
  display: block;
}

.attribute-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.attr-pill {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
}

.attr-pill:hover {
  background: rgba(30, 41, 59, 0.8);
}

.attr-pill.active {
  border-color: var(--accent-color);
  background: var(--accent-glow);
  color: var(--accent-color);
  box-shadow: 0 0 10px var(--accent-glow);
}

.color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.color-dot.space-gray { background: #64748b; }
.color-dot.silver { background: #e2e8f0; }
.color-dot.midnight { background: #3b82f6; }

.alert-box {
  background: rgba(248, 113, 113, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: var(--error-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 12px;
  margin-top: 8px;
  transition: all 0.3s ease;
}

.alert-box.hidden {
  display: none;
}

.address-text {
  font-size: 11px !important;
  max-width: 220px;
  text-align: right;
  line-height: 1.3;
}

.highlight-text {
  color: var(--accent-color) !important;
  font-weight: 600;
}

.item-info {
  display: flex;
  flex-direction: column;
}

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

.item-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.item-price {
  font-weight: 600;
  font-size: 14px;
}

.plan-selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.plan-option {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.plan-option:hover {
  background: rgba(30, 41, 59, 0.8);
}

.plan-option.active {
  border-color: var(--accent-color);
  background: rgba(56, 189, 248, 0.08);
  box-shadow: 0 0 12px var(--accent-glow);
}

.plan-option input[type="radio"] {
  accent-color: var(--accent-color);
  width: 16px;
  height: 16px;
}

.plan-details {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.plan-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.plan-desc {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.plan-price {
  font-weight: 700;
  font-size: 14px;
  color: var(--accent-color);
}

.divider {
  height: 1px;
  background: var(--border-color);
  margin: 12px 0;
}

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 15px;
}

.total-price {
  font-size: 18px;
  color: var(--accent-color);
}

.payment-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
}

.payment-section h3 {
  font-size: 14px;
  font-weight: 600;
}

.section-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  margin-bottom: 12px;
}

.gpay-wrapper {
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
}

.status-box {
  margin-top: 10px;
  font-size: 12px;
  min-height: 18px;
}

.status-info { color: var(--accent-color); }
.status-success { color: var(--success-color); }
.status-warning { color: var(--warning-color); }
.status-error { color: var(--error-color); }

/* Modal Styling */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  justify-content: center;
  align-items: center;
  padding: 16px;
  z-index: 100;
}

.modal-overlay.visible {
  display: flex;
}

.modal-card {
  background: #1e293b;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-card h3 {
  font-size: 17px;
  font-weight: 700;
}

.modal-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin: 4px 0 12px 0;
}

pre {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  font-family: monospace;
  font-size: 11px;
  color: var(--accent-color);
  overflow-x: auto;
  margin-bottom: 16px;
}

.btn-primary {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--accent-color);
  color: #0f172a;
  border: none;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: opacity 0.2s ease;
  min-height: 42px;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 42px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.review-breakdown {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 16px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.breakdown-row .row-value {
  color: var(--text-primary);
  font-weight: 600;
}

.breakdown-row.final-row {
  margin-bottom: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.final-price {
  font-size: 17px;
  color: var(--success-color);
}

.surcharge-text {
  color: var(--warning-color) !important;
}

.badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(251, 191, 36, 0.15);
  color: var(--warning-color) !important;
  border: 1px solid rgba(251, 191, 36, 0.3);
  letter-spacing: 0.03em;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

/* Mobile Devices (<= 480px) */
@media (max-width: 480px) {
  body {
    padding: 12px 8px;
  }

  .app-container {
    max-width: 100%;
  }

  .app-header {
    margin-bottom: 12px;
  }

  .app-header h1 {
    font-size: 20px;
  }

  .subtitle {
    font-size: 12px;
  }

  .checkout-card {
    padding: 16px;
    border-radius: 12px;
  }

  .attribute-options {
    gap: 6px;
  }

  .attr-pill {
    padding: 8px 12px;
    font-size: 13px;
    min-height: 44px; /* Accessible touch target */
    flex: 1 1 calc(50% - 6px); /* Clean 2-column wrapping */
    justify-content: center;
  }

  .color-pill {
    flex: 1 1 100%; /* Full width for color selection on small phones */
  }

  .plan-option {
    padding: 12px 10px;
    min-height: 44px;
  }

  .plan-name {
    font-size: 13px;
  }

  .plan-price {
    font-size: 14px;
  }

  .total-price {
    font-size: 18px;
  }

  .modal-overlay {
    padding: 10px;
  }

  .modal-card {
    padding: 16px;
    border-radius: 12px;
    max-height: 92vh;
  }

  .modal-actions {
    flex-direction: column;
    gap: 8px;
  }

  .btn-primary,
  .btn-secondary {
    min-height: 44px;
    padding: 12px;
  }

  .address-text {
    max-width: 150px;
    font-size: 10px !important;
  }
}

/* Tablet Devices (481px to 1024px) */
@media (min-width: 481px) and (max-width: 1024px) {
  body {
    padding: 24px 16px;
  }

  .app-container {
    max-width: 500px;
  }

  .checkout-card {
    padding: 22px;
  }

  .attr-pill {
    min-height: 40px;
    padding: 8px 14px;
  }

  .modal-card {
    max-width: 480px;
  }
}

/* Desktop / Laptop Devices (> 1024px) */
@media (min-width: 1025px) {
  body {
    padding: 32px 20px;
  }

  .app-container {
    max-width: 480px;
  }
}

