/* ============================================================
   Truong Thinh Lanyard - Main Stylesheet
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Be Vietnam Pro', 'Segoe UI', Arial, sans-serif;
  background: #f8f8f8;
  color: #2d2d2d;
  font-size: 15px;
  line-height: 1.6;
}
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* --- Header --- */
.site-header {
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.logo-wrap { display: flex; align-items: center; gap: 12px; }
.logo-wrap img { height: 56px; width: auto; }
.logo-text { line-height: 1.2; }
.logo-text .brand { font-size: 17px; font-weight: 700; color: #e53e3e; }
.logo-text .tagline { font-size: 12px; color: #888; }
.header-contacts { display: flex; gap: 18px; flex-wrap: wrap; }
.contact-item { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: #333; }
.contact-item svg { color: #e53e3e; flex-shrink: 0; }
.contact-item a:hover { color: #e53e3e; }

/* --- Hero Banner --- */
.hero {
  background: linear-gradient(135deg, #c53030 0%, #e53e3e 40%, #dd6b20 100%);
  color: #fff;
  text-align: center;
  padding: 52px 20px 48px;
}
.hero h1 { font-size: clamp(22px, 4vw, 36px); font-weight: 800; margin-bottom: 12px; }
.hero p { font-size: 15px; opacity: .9; margin-bottom: 24px; max-width: 560px; margin-left: auto; margin-right: auto; }
.hero-badges { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.hero-badge {
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  display: flex; align-items: center; gap: 5px;
}

/* --- Ticker --- */
.ticker-bar {
  background: linear-gradient(90deg, #e53e3e, #dd6b20);
  color: #fff;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  letter-spacing: .3px;
}

/* --- Main Layout --- */
.main-wrap {
  max-width: 1200px;
  margin: 28px auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .main-wrap { grid-template-columns: 1fr; }
  .preview-sidebar { order: -1; }
}

/* --- Step Card --- */
.step-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  overflow: hidden;
}

/* --- Step Progress --- */
.step-progress {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
  overflow-x: auto;
  gap: 0;
}
.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 60px;
  position: relative;
  cursor: pointer;
}
.step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 14px;
  left: calc(50% + 14px);
  right: calc(-50% + 14px);
  height: 2px;
  background: #e2e8f0;
  z-index: 0;
}
.step-item.done:not(:last-child)::after,
.step-item.active:not(:last-child)::after { background: #e53e3e; }
.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #888;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
  transition: all .2s;
}
.step-item.active .step-num { background: #e53e3e; color: #fff; box-shadow: 0 0 0 4px rgba(229,62,62,.2); }
.step-item.done .step-num { background: #38a169; color: #fff; }
.step-label { font-size: 11px; color: #888; text-align: center; white-space: nowrap; }
.step-item.active .step-label { color: #e53e3e; font-weight: 700; }
.step-item.done .step-label { color: #38a169; }

/* --- Step Content --- */
.step-content { padding: 24px 20px; display: none; }
.step-content.active { display: block; }
.step-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.step-title .step-badge {
  background: #e53e3e; color: #fff;
  width: 26px; height: 26px; border-radius: 50%;
  font-size: 13px; display: flex; align-items: center; justify-content: center;
}
.step-desc { font-size: 13px; color: #888; margin-bottom: 20px; }

/* --- Lanyard Type Cards --- */
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.type-card {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px 16px;
  cursor: pointer;
  transition: all .2s;
  position: relative;
  text-align: center;
}
.type-card:hover { border-color: #e53e3e; transform: translateY(-2px); box-shadow: 0 4px 16px rgba(229,62,62,.12); }
.type-card.selected { border-color: #e53e3e; background: #fff5f5; }
.type-card .badge-pop {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: #e53e3e; color: #fff; font-size: 11px; font-weight: 700;
  padding: 2px 10px; border-radius: 10px; white-space: nowrap;
}
.type-icon { font-size: 36px; margin-bottom: 10px; }
.type-name { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.type-desc { font-size: 12px; color: #666; line-height: 1.5; }
.type-features { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.type-feature { font-size: 12px; color: #38a169; display: flex; align-items: center; gap: 4px; }
.type-card.selected .check-icon { display: block; }
.check-icon {
  display: none;
  position: absolute; top: 8px; right: 8px;
  background: #e53e3e; color: #fff;
  width: 20px; height: 20px; border-radius: 50%;
  font-size: 11px; align-items: center; justify-content: center;
}

/* --- Width Selector --- */
.width-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.width-card {
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 10px;
  cursor: pointer;
  text-align: center;
  transition: all .2s;
}
.width-card:hover { border-color: #e53e3e; }
.width-card.selected { border-color: #e53e3e; background: #fff5f5; }
.width-visual {
  margin: 0 auto 10px;
  background: linear-gradient(90deg, #c53030, #e53e3e, #dd6b20);
  border-radius: 4px;
  height: 40px;
}
.width-label { font-size: 16px; font-weight: 700; color: #e53e3e; }
.width-sublabel { font-size: 11px; color: #888; margin-top: 2px; }

/* --- Color Palette --- */
.color-section-label { font-size: 13px; font-weight: 600; color: #555; margin-bottom: 10px; }
.color-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.color-swatch {
  width: 34px; height: 34px; border-radius: 50%;
  cursor: pointer; border: 3px solid transparent;
  transition: all .15s;
  position: relative;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: #333; transform: scale(1.15); }
.color-swatch.selected::after {
  content: '✓';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}

/* --- Print Color Count --- */
.color-count-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.color-count-btn {
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 6px;
  cursor: pointer;
  text-align: center;
  background: #fff;
  transition: all .2s;
  font-size: 13px;
  font-weight: 600;
  color: #555;
}
.color-count-btn:hover { border-color: #e53e3e; color: #e53e3e; }
.color-count-btn.selected { border-color: #e53e3e; background: #fff5f5; color: #e53e3e; }

/* --- Quantity & Price --- */
.qty-price-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
@media (max-width: 500px) { .qty-price-row { grid-template-columns: 1fr; } }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: #555; margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 10px 14px;
  border: 2px solid #e2e8f0; border-radius: 8px;
  font-size: 15px; font-family: inherit;
  transition: border-color .2s;
  background: #fff;
}
.form-input:focus { outline: none; border-color: #e53e3e; }
.form-textarea { resize: vertical; min-height: 80px; }

/* --- Price Table --- */
.price-table-wrap { background: #fafafa; border-radius: 10px; padding: 14px; margin-top: 16px; }
.price-table-title { font-size: 13px; font-weight: 700; color: #555; margin-bottom: 10px; }
.price-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.price-table th { background: #e53e3e; color: #fff; padding: 7px 10px; text-align: left; }
.price-table td { padding: 7px 10px; border-bottom: 1px solid #eee; }
.price-table tr.active-tier td { background: #fff3cd; font-weight: 700; }
.price-summary {
  margin-top: 14px; padding: 14px;
  background: linear-gradient(135deg, #fff5f5, #fff8f0);
  border: 2px solid #e53e3e; border-radius: 10px;
  text-align: center;
}
.price-summary .unit { font-size: 13px; color: #888; }
.price-summary .total { font-size: 22px; font-weight: 800; color: #e53e3e; }

/* --- Upload Logo --- */
.upload-zone {
  border: 2px dashed #e2e8f0;
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: #fafafa;
}
.upload-zone:hover, .upload-zone.dragover { border-color: #e53e3e; background: #fff5f5; }
.upload-zone .upload-icon { font-size: 36px; margin-bottom: 8px; }
.upload-zone p { font-size: 13px; color: #888; margin-top: 4px; }
.upload-preview {
  margin-top: 12px;
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #f0fff4;
  border: 1px solid #9ae6b4;
  border-radius: 8px;
}
.upload-preview img { width: 48px; height: 48px; object-fit: contain; border-radius: 4px; border: 1px solid #ddd; }
.upload-preview .file-info { flex: 1; font-size: 13px; }
.upload-preview .file-name { font-weight: 600; color: #276749; }
.upload-preview .file-size { color: #888; font-size: 12px; }
.btn-remove-logo { background: none; border: none; color: #e53e3e; cursor: pointer; font-size: 18px; }

/* --- Accessories --- */
.acc-section { margin-bottom: 20px; }
.acc-title { font-size: 14px; font-weight: 700; color: #333; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.acc-card {
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 8px;
  cursor: pointer;
  text-align: center;
  transition: all .2s;
  background: #fff;
  position: relative;
}
.acc-card:hover { border-color: #e53e3e; transform: translateY(-1px); }
.acc-card.selected { border-color: #e53e3e; background: #fff5f5; }
.acc-card .acc-icon { font-size: 26px; margin-bottom: 6px; }
.acc-card .acc-name { font-size: 12px; font-weight: 600; color: #333; line-height: 1.3; margin-top: 6px; }
.acc-card .acc-none { font-size: 11px; color: #888; }
.acc-card .acc-desc { font-size: 10px; color: #888; margin-top: 3px; line-height: 1.3; }
.acc-card .acc-img { width: 70px; height: 70px; object-fit: contain; border-radius: 6px; }

/* --- Logo Position Grid --- */
.logo-pos-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.logo-pos-btn {
  border: 2px solid #e2e8f0; border-radius: 8px; padding: 10px 6px;
  cursor: pointer; font-size: 12px; font-weight: 600; font-family: inherit;
  background: #fff; text-align: center; transition: all .2s; line-height: 1.4;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.logo-pos-btn span { font-size: 10px; color: #888; font-weight: 400; }
.logo-pos-btn:hover { border-color: #e53e3e; }
.logo-pos-btn.selected { border-color: #e53e3e; background: #fff5f5; color: #e53e3e; }
.logo-pos-btn.selected span { color: #c53030; }
@media (max-width: 500px) { .logo-pos-grid { grid-template-columns: 1fr; } }
.vip-color-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.vip-color-btn {
  padding: 6px 14px; border-radius: 20px;
  border: 2px solid #e2e8f0;
  cursor: pointer; font-size: 13px; font-weight: 600;
  background: #fff; transition: all .2s;
}
.vip-color-btn:hover { border-color: #e53e3e; }
.vip-color-btn.selected { border-color: #e53e3e; background: #fff5f5; color: #e53e3e; }

/* --- Order Form --- */
.order-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 500px) { .order-form-grid { grid-template-columns: 1fr; } }
.order-summary {
  background: #fafafa; border-radius: 10px; padding: 16px;
  margin-bottom: 20px; border: 1px solid #eee;
}
.order-summary-title { font-size: 14px; font-weight: 700; color: #555; margin-bottom: 10px; }
.summary-row { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; border-bottom: 1px solid #f0f0f0; }
.summary-row:last-child { border: none; font-weight: 700; font-size: 15px; color: #e53e3e; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 22px; border-radius: 8px;
  font-size: 15px; font-weight: 700; font-family: inherit;
  cursor: pointer; border: none; transition: all .2s;
}
.btn-primary { background: linear-gradient(135deg, #e53e3e, #dd6b20); color: #fff; }
.btn-primary:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(229,62,62,.35); }
.btn-secondary { background: #fff; color: #e53e3e; border: 2px solid #e53e3e; }
.btn-secondary:hover { background: #fff5f5; }
.btn-success { background: linear-gradient(135deg, #38a169, #276749); color: #fff; }
.btn-success:hover { opacity: .9; transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }
.btn-row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }

/* --- Preview Sidebar --- */
.preview-sidebar {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  padding: 20px;
  position: sticky;
  top: 80px;
}
.preview-title { font-size: 15px; font-weight: 700; text-align: center; margin-bottom: 16px; color: #333; }
.preview-svg-wrap { display: flex; justify-content: center; margin-bottom: 12px; }
.preview-info { font-size: 12px; color: #888; text-align: center; line-height: 1.7; }
.preview-info strong { color: #333; }

/* --- Success Screen --- */
.success-screen {
  text-align: center; padding: 40px 20px;
}
.success-icon { font-size: 64px; margin-bottom: 16px; }
.success-title { font-size: 22px; font-weight: 800; color: #38a169; margin-bottom: 8px; }
.success-msg { color: #666; margin-bottom: 24px; font-size: 14px; line-height: 1.6; }

/* --- Footer --- */
.site-footer {
  background: #1a1a2e;
  color: #ccc;
  padding: 36px 20px 20px;
  margin-top: 48px;
}
.footer-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
@media (max-width: 700px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-brand .brand-name { font-size: 18px; font-weight: 800; color: #e53e3e; margin-bottom: 8px; }
.footer-brand p { font-size: 13px; line-height: 1.7; }
.footer-col h4 { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 12px; }
.footer-col ul { list-style: none; }
.footer-col ul li { font-size: 13px; padding: 3px 0; }
.footer-col ul li a:hover { color: #e53e3e; }
.footer-bottom { max-width: 1200px; margin: 24px auto 0; padding-top: 16px; border-top: 1px solid #333; text-align: center; font-size: 12px; color: #666; }

/* --- Loading Spinner --- */
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Toast --- */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  padding: 12px 18px; border-radius: 8px;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  animation: slideIn .3s ease;
  max-width: 320px;
}
.toast.success { background: #38a169; color: #fff; }
.toast.error { background: #e53e3e; color: #fff; }
.toast.info { background: #3182ce; color: #fff; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* --- Sway animation for preview --- */
@keyframes sway {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}

/* --- Responsive --- */
@media (max-width: 600px) {
  .type-grid { grid-template-columns: 1fr; }
  .width-grid { grid-template-columns: repeat(3, 1fr); }
  .acc-grid { grid-template-columns: repeat(3, 1fr); }
  .hero { padding: 36px 16px 32px; }
  .step-label { display: none; }
}
