:root {
  --page-bg: #ffedf1;
  --page-bg-2: #fff5f7;
  --card: #ffffff;
  --border-soft: #f5d0dc;
  --border-grey: #e8e4ea;
  --title-coral: #ff6b4a;
  --title-coral-mid: #ff7a5c;
  --text: #2f2a35;
  --muted: #6b6570;
  --link-blue: #2563eb;
  --link-blue-soft: #3b82f6;
  --orange-red: #ff5a3d;
  --orange-mid: #ff8a5c;
  --green: #0ea572;
  --green-dark: #0a8f62;
  --danger: #e11d48;
  --zalo-blue: #0068ff;
  --shadow-card: 0 10px 36px rgba(255, 120, 140, 0.18);
  --shadow-card-soft: 0 4px 20px rgba(0, 0, 0, 0.04);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Nunito", ui-rounded, system-ui, -apple-system, sans-serif;
  font-weight: 600;
  color: var(--text);
  background: linear-gradient(180deg, var(--page-bg) 0%, var(--page-bg-2) 45%, #fff 100%);
  line-height: 1.45;
  min-height: 100vh;
}

.page {
  min-height: 100vh;
  padding: 22px 16px 48px;
}

.shell {
  max-width: 420px;
  margin: 0 auto;
}

.server-warn {
  max-width: 420px;
  margin: 0 auto 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  color: #9a3412;
  background: #ffedd5;
  border: 1px solid #fdba74;
}

.server-warn.hidden {
  display: none !important;
}

.hero-header {
  text-align: center;
  margin-bottom: 22px;
}

.hero-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.hero-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: linear-gradient(145deg, #ffb15a, var(--title-coral));
  color: #fff;
  box-shadow: 0 10px 28px rgba(255, 107, 74, 0.4);
}

.hero-title {
  margin: 0;
  font-size: clamp(1.55rem, 4.8vw, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--title-coral);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.hero-tag {
  display: inline-block;
  margin: 12px 0 0;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #5c5260;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card-soft);
  max-width: 100%;
  word-break: break-all;
}

.surface-card {
  background: var(--card);
  border: 1px solid rgba(255, 200, 210, 0.65);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 20px 20px 22px;
  margin-bottom: 18px;
}

.surface-card.result-card {
  border: 2px solid rgba(255, 140, 100, 0.55);
  box-shadow: 0 8px 32px rgba(255, 120, 90, 0.12);
}

.card-title {
  margin: 0 0 16px;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--title-coral);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title-icon {
  display: inline-flex;
  color: var(--title-coral-mid);
  flex-shrink: 0;
}

.card-title-icon.soft {
  font-style: normal;
}

.paste-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 16px;
}

.text-input {
  flex: 1;
  min-width: 0;
  border-radius: var(--radius-md);
  border: 1px solid #e5dbe0;
  padding: 15px 16px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--text);
  outline: none;
  background: #fffefb;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.text-input:focus {
  border-color: var(--title-coral-mid);
  box-shadow: 0 0 0 4px rgba(255, 122, 92, 0.18);
}

.text-input::placeholder {
  color: #a8a0ae;
  font-weight: 500;
}

.btn-icon {
  flex: 0 0 52px;
  border: 1px solid var(--border-grey);
  border-radius: var(--radius-md);
  background: #fff;
  cursor: pointer;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-icon:hover {
  background: #fff8fa;
  color: var(--title-coral);
  border-color: var(--border-soft);
}

.btn {
  border: 0;
  border-radius: var(--radius-md);
  padding: 14px 22px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s, filter 0.15s, box-shadow 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:active {
  transform: scale(0.98);
}

.btn-ico {
  flex-shrink: 0;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(95deg, var(--orange-red) 0%, var(--orange-mid) 55%, #ffa06a 100%);
  box-shadow: 0 10px 28px rgba(255, 90, 61, 0.38);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.04);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
  justify-content: center;
  border-radius: 18px;
  padding: 16px 22px;
  font-size: 1.05rem;
}

.btn-icon-inline {
  font-size: 1.15rem;
  line-height: 1;
}

/* Preview kiểu link Zalo: ảnh + strip giá bên trái, tiêu đề + mô tả bên phải */
.product-preview-card {
  margin-bottom: 14px;
  padding: 12px 12px 14px;
  border-radius: 14px;
  border: 1px solid #e8e8e8;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.product-preview-zalo-inner {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.product-preview-zalo-left {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  max-width: 46%;
}

.product-preview-img-wrap {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
  border: 1px solid #ececec;
}

.product-preview-img-wrap.hidden {
  display: none !important;
}

.product-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-preview-img-ph {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  background: linear-gradient(145deg, #fff5f7, #ffe8ee);
  border: 1px solid #f0e0e5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  line-height: 1;
}

.product-preview-img-ph.hidden {
  display: none !important;
}

.product-preview-zalo-strip {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.product-preview-strip-title {
  margin: 0 0 4px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #6b7280;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-preview-strip-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  margin: 0 0 4px;
}

.product-preview-strip-price.hidden {
  display: none !important;
}

.product-preview-strip-before {
  font-size: 0.65rem;
  font-weight: 700;
  color: #9ca3af;
  text-decoration: line-through;
}

.product-preview-strip-before.hidden {
  display: none !important;
}

.product-preview-strip-now {
  font-size: 0.72rem;
  font-weight: 800;
  color: #ee4d2d;
}

.product-preview-strip-now--deal {
  color: #ee2d4a;
}

.product-preview-strip-now.hidden {
  display: none !important;
}

.product-preview-strip-fallback {
  font-size: 0.65rem;
  font-weight: 800;
  color: #2563eb;
  text-decoration: none;
}

.product-preview-strip-fallback:hover {
  text-decoration: underline;
}

.product-preview-strip-fallback.hidden {
  display: none !important;
}

.product-preview-zalo-badge {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 700;
  color: #9ca3af;
  line-height: 1.2;
}

.product-preview-stars {
  color: #ff6b4a;
  letter-spacing: -0.05em;
  margin-right: 2px;
}

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

.product-preview-title {
  margin: 0 0 6px;
  font-size: 0.88rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.35;
  letter-spacing: -0.02em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-preview-desc {
  margin: 0;
  font-size: 0.76rem;
  font-weight: 600;
  color: #6b7280;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-preview-desc.hidden {
  display: none !important;
}

.btn-copy-orange {
  background: linear-gradient(95deg, #ff7733, var(--title-coral));
  color: #fff;
  padding: 10px 16px;
  font-size: 0.92rem;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(255, 107, 74, 0.35);
  border: 0;
  font-weight: 800;
  gap: 6px;
}

.btn-copy-orange:hover {
  filter: brightness(1.05);
}

.result-success-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.check-ok {
  display: inline-flex;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(145deg, #22c55e, var(--green-dark));
  color: #fff;
  font-weight: 800;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(14, 165, 114, 0.35);
}

.result-summary {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--green-dark);
  line-height: 1.35;
}

.link-textarea {
  width: 100%;
  min-height: 100px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 2px dashed #e5dbe8;
  background: #faf8fb;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--link-blue);
  line-height: 1.5;
  resize: vertical;
  outline: none;
}

.link-textarea:focus {
  border-color: #c4b8d4;
  background: #fff;
}

.link-textarea::placeholder {
  color: #a49daa;
  font-weight: 600;
}

.result-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.btn-share {
  background: linear-gradient(180deg, #3b7dff, var(--link-blue));
  color: #fff;
  padding: 12px 8px;
  font-size: 0.82rem;
  border-radius: 14px;
  border: 0;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28);
}

.btn-zalo {
  background: #eaf4ff;
  color: var(--zalo-blue);
  border: 2px solid #b3d4ff;
  padding: 12px 8px;
  font-size: 0.82rem;
  border-radius: 14px;
}

.btn-zalo.is-disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

.guide-steps {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
}

.guide-steps li {
  margin-bottom: 10px;
}

.guide-steps strong {
  font-weight: 800;
}

.footer-cta {
  margin-top: 6px;
  text-align: center;
}

.btn-fb-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px;
  border-radius: 18px;
  border: 2px solid var(--link-blue-soft);
  background: #fff;
  color: var(--link-blue);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.12);
  transition: background 0.15s, transform 0.1s;
}

.fb-ico {
  flex-shrink: 0;
  opacity: 0.95;
}

.btn-fb-outline:hover:not(.disabled) {
  background: #eff6ff;
}

.btn-fb-outline:active:not(.disabled) {
  transform: scale(0.99);
}

.btn-fb-outline.disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

.promo-card {
  margin-top: 14px;
  border-radius: unset;
  padding: 0;
  border: none;
  background: transparent;
}

.promo-wrap {
  text-align: center;
}

.promo-img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 10px;
}

.promo-caption {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.45;
}

.status {
  margin: 0 0 12px;
  font-weight: 700;
  font-size: 0.92rem;
  text-align: center;
}

.status.success { color: var(--green); }
.status.error { color: var(--danger); }

.hidden { display: none !important; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  color: #fff;
  font-weight: 800;
  background: rgba(31, 34, 40, 0.92);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  z-index: 50;
}

.toast.error {
  background: rgba(225, 29, 72, 0.95);
}

@media (max-width: 380px) {
  .result-actions {
    grid-template-columns: 1fr;
  }


  .paste-row {
    flex-direction: column;
  }

  .btn-icon {
    width: 100%;
    min-height: 48px;
  }
}
