/* 全局設定 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
  background: linear-gradient(135deg, #e8e8e8 0%, #f5f5f5 100%);
  color: #2d2d2d;
  min-height: 100vh;
}

.checkout-page {
  padding-bottom: 90px;
}

/* Header 樣式 - 深灰色背景 */
.main-header {
  background: linear-gradient(135deg, #5a5a5a 0%, #4a4a4a 100%);
  color: #ffffff;
  padding: 24px 32px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.logo {
  font-weight: 800;
  font-size: 24px;
  letter-spacing: 2px;
  margin-bottom: 16px;
}

.logo span {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.8;
  letter-spacing: 1px;
  display: block;
  margin-top: 4px;
}

.steps {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  flex-wrap: wrap;
}

.step {
  opacity: 0.6;
  transition: opacity 0.3s;
}

.step.active {
  opacity: 1;
  font-weight: 600;
  color: #ff9b7a;
}

/* 主要容器 */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px;
}

.page-step {
  display: none;
}

.page-step.active {
  display: block;
  animation: fadeIn 0.4s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 標題樣式 */
.container h2 {
  font-size: 28px;
  font-weight: 700;
  color: #2d2d2d;
  margin-bottom: 24px;
  margin-top: 32px;
}

.container h2:first-child {
  margin-top: 0;
}

/* 方案卡片網格 */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

@media (max-width: 768px) {
  .plan-grid {
    grid-template-columns: 1fr;
  }
}

/* 方案卡片 */
.plan-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 32px 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.plan-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.plan-card.featured {
  background: linear-gradient(135deg, #fff5f2 0%, #ffffff 100%);
  border: 2px solid #ff9b7a;
}

.plan-card .badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: linear-gradient(135deg, #ff9b7a 0%, #ff7a5c 100%);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(255,122,92,0.3);
}

.plan-card h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #2d2d2d;
}

.plan-card .price {
  font-size: 32px;
  font-weight: 800;
  color: #ff7a5c;
  margin-bottom: 24px;
}

.plan-card .price span {
  font-size: 16px;
  font-weight: 400;
  color: #888;
}

.plan-card ul {
  list-style: none;
  margin-bottom: 24px;
  flex: 1;
}

.plan-card ul li {
  padding: 10px 0;
  padding-left: 28px;
  position: relative;
  color: #555;
  font-size: 14px;
  line-height: 1.6;
}

.plan-card ul li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #ff7a5c;
  font-weight: bold;
  font-size: 16px;
}

.btn-select {
  width: 100%;
  background: linear-gradient(135deg, #ff9b7a 0%, #ff7a5c 100%);
  color: #ffffff;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(255,122,92,0.25);
}

.btn-select:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255,122,92,0.35);
}

.btn-select:active {
  transform: translateY(0);
}

/* 硬體列表 */
.hardware-list {
  margin-bottom: 48px;
}

.hw-item {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}

.hw-item:hover {
  transform: translateX(4px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

.hw-info {
  flex: 1;
}

.hw-info strong {
  display: block;
  font-size: 18px;
  color: #2d2d2d;
  margin-bottom: 8px;
}

.hw-info p {
  font-size: 14px;
  color: #777;
  line-height: 1.6;
}

.hw-action {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.hw-action span {
  font-size: 20px;
  font-weight: 700;
  color: #ff7a5c;
  white-space: nowrap;
}

.hw-action button {
  background: #ffffff;
  border: 2px solid #ff7a5c;
  color: #ff7a5c;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.hw-action button:hover {
  background: linear-gradient(135deg, #ff9b7a 0%, #ff7a5c 100%);
  color: #ffffff;
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .hw-item {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .hw-action {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  
  .hw-action button {
    flex: 1;
  }
}

/* 購物車摘要 */
.cart-summary {
  background: linear-gradient(135deg, #f8f8f8 0%, #ffffff 100%);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  margin-top: 32px;
}

.cart-summary h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
  color: #2d2d2d;
}

#cart-items {
  list-style: none;
  margin-bottom: 24px;
  min-height: 60px;
}

#cart-items li {
  padding: 12px 0;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #555;
}

#cart-items li:last-child {
  border-bottom: none;
}

.empty-msg {
  color: #999;
  font-style: italic;
  text-align: center;
  padding: 20px 0;
}

.cart-footer {
  border-top: 2px solid #e8e8e8;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.total-price {
  font-size: 24px;
  font-weight: 800;
  color: #2d2d2d;
}

.total-price span {
  color: #ff7a5c;
}

.btn-next {
  background: linear-gradient(135deg, #ff9b7a 0%, #ff7a5c 100%);
  color: #ffffff;
  border: none;
  padding: 14px 32px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(255,122,92,0.3);
  white-space: nowrap;
}

.btn-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255,122,92,0.4);
}

.btn-next:active {
  transform: translateY(0);
}

@media (max-width: 768px) {
  .cart-footer {
    flex-direction: column;
    align-items: stretch;
  }
  
  .btn-next {
    width: 100%;
  }
}

/* 表單樣式 - Step 2 */
#checkout-form {
  background: #ffffff;
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  max-width: 700px;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #2d2d2d;
}

input[type="text"],
input[type="email"],
select {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e8e8e8;
  border-radius: 12px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
  background: #fafafa;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus {
  border-color: #ff7a5c;
  box-shadow: 0 0 0 4px rgba(255,122,92,0.1);
  background: #ffffff;
}

select {
  cursor: pointer;
}

.actions {
  display: flex;
  gap: 16px;
  margin-top: 32px;
}

.btn-back {
  flex: 1;
  background: #ffffff;
  border: 2px solid #e8e8e8;
  color: #555;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-back:hover {
  border-color: #ccc;
  background: #f8f8f8;
}

.btn-pay {
  flex: 2;
  background: linear-gradient(135deg, #ff9b7a 0%, #ff7a5c 100%);
  color: #ffffff;
  border: none;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(255,122,92,0.3);
}

.btn-pay:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255,122,92,0.4);
}

.btn-pay:active {
  transform: translateY(0);
}

@media (max-width: 768px) {
  .actions {
    flex-direction: column;
  }
  
  .btn-back,
  .btn-pay {
    width: 100%;
  }
}

/* 成功頁面 */
.success-box {
  background: #ffffff;
  border-radius: 24px;
  padding: 60px 40px;
  text-align: center;
  max-width: 500px;
  margin: 80px auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}

.success-box .icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #ff9b7a 0%, #ff7a5c 100%);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  margin: 0 auto 24px;
  box-shadow: 0 8px 24px rgba(255,122,92,0.3);
}

.success-box h2 {
  font-size: 28px;
  color: #2d2d2d;
  margin-bottom: 16px;
}

.success-box p {
  color: #777;
  font-size: 16px;
  margin-bottom: 32px;
  line-height: 1.6;
}

.success-box button {
  background: linear-gradient(135deg, #5a5a5a 0%, #4a4a4a 100%);
  color: #ffffff;
  border: none;
  padding: 14px 32px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.success-box button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

.success-box button:active {
  transform: translateY(0);
}

/* 響應式設計 */
@media (max-width: 1200px) {
  .plan-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .main-header {
    padding: 20px 16px;
  }
  
  .logo {
    font-size: 20px;
  }
  
  .logo span {
    font-size: 11px;
  }
  
  .steps {
    font-size: 12px;
  }
  
  .container {
    padding: 24px 16px;
  }
  
  .container h2 {
    font-size: 24px;
  }
  
  .plan-card {
    padding: 24px 20px;
  }
  
  .cart-summary {
    padding: 24px;
  }
  
  #checkout-form {
    padding: 24px;
  }
  
  .success-box {
    padding: 40px 24px;
    margin: 40px 16px;
  }
  
  .success-box .icon {
    width: 70px;
    height: 70px;
    font-size: 40px;
  }
  
  .success-box h2 {
    font-size: 24px;
  }
}

@media (max-width: 480px) {
  .plan-card .price {
    font-size: 28px;
  }
  
  .hw-info strong {
    font-size: 16px;
  }
  
  .hw-info p {
    font-size: 13px;
  }
  
  .hw-action span {
    font-size: 18px;
  }
}