/* KTH Shop v1.0.0 — Frontend Styles */

/* ── Variables ── */
:root {
  --kths-green:   #0ea572;
  --kths-green-d: #0a7a54;
  --kths-gold:    #f59e0b;
  --kths-dark:    #0f172a;
  --kths-gray:    #64748b;
  --kths-border:  #e2e8f0;
  --kths-bg:      #f8fafc;
  --kths-card:    #ffffff;
  --kths-radius:  14px;
  --kths-shadow:  0 2px 16px rgba(0,0,0,.07);
}

/* ── Base ── */
.kths-wrap {
  font-family: 'Segoe UI', -apple-system, sans-serif;
  font-size: 17px;
  color: var(--kths-dark);
  max-width: 860px;
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
  line-height: 1.6;
}

/* ── Step panels ── */
.kths-panel        { display: none; animation: kthsFade .3s ease; }
.kths-panel.active { display: block; }
@keyframes kthsFade { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }

/* ── Section header ── */
.kths-section-head {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.kths-step-num {
  width: 46px; height: 46px; min-width: 46px;
  background: var(--kths-green);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800;
  margin-top: 2px;
}
.kths-section-title {
  font-size: 22px; font-weight: 800;
  margin: 0 0 3px; color: var(--kths-dark);
}
.kths-section-sub  { font-size: 15px; color: var(--kths-gray); margin: 0; }

/* ── Product cards ── */
.kths-products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-bottom: .5rem;
}
.kths-loading { padding: 2rem; text-align: center; color: var(--kths-gray); font-size: 16px; }

.kths-product-card {
  border: 2px solid var(--kths-border);
  border-radius: var(--kths-radius);
  padding: 1.75rem 1.5rem;
  cursor: pointer;
  background: var(--kths-card);
  transition: border-color .2s, box-shadow .2s, transform .15s;
  position: relative;
}
.kths-product-card:hover {
  border-color: var(--kths-green);
  box-shadow: 0 6px 24px rgba(14,165,114,.15);
  transform: translateY(-3px);
}
.kths-product-card.selected {
  border-color: var(--kths-green);
  background: #f0fdf8;
}
.kths-product-card.selected::after {
  content: '✓';
  position: absolute; top: 12px; right: 14px;
  width: 26px; height: 26px;
  background: var(--kths-green);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.kths-product-card.featured { border-color: var(--kths-gold); }
.kths-product-card.featured .kths-prod-badge {
  background: var(--kths-gold);
  color: #fff;
  font-size: 12px; font-weight: 700;
  padding: 3px 12px; border-radius: 20px;
  display: inline-block; margin-bottom: 12px;
}

.kths-prod-name   { font-size: 20px; font-weight: 800; margin: 0 0 6px; color: var(--kths-dark); }
.kths-prod-desc   { font-size: 15px; color: var(--kths-gray); margin: 0 0 16px; line-height: 1.6; }
.kths-prod-price  {
  font-size: 28px; font-weight: 800;
  color: var(--kths-green);
  margin: 0 0 16px;
}
.kths-prod-price.free { color: var(--kths-green); }
.kths-prod-price.paid { color: #e11d48; }

.kths-prod-features { list-style: none; padding: 0; margin: 0; }
.kths-prod-features li {
  font-size: 15px; color: #374151;
  padding: 5px 0;
  display: flex; align-items: flex-start; gap: 8px;
  border-bottom: 1px solid #f1f5f9;
}
.kths-prod-features li:last-child { border-bottom: none; }
.kths-prod-features li::before { content: '✓'; color: var(--kths-green); font-weight: 700; flex-shrink: 0; }
.kths-prod-revisions {
  margin-top: 14px; padding: 8px 12px;
  background: #f0fdf8; border-radius: 8px;
  font-size: 14px; color: var(--kths-green); font-weight: 600;
}

.kths-prod-btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 13px 10px;
  background: var(--kths-green);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background .2s, transform .12s, box-shadow .2s;
  box-shadow: 0 3px 10px rgba(14,165,114,.25);
}
.kths-prod-btn:hover {
  background: var(--kths-green-d);
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(14,165,114,.35);
}
.kths-prod-btn:active { transform: scale(.97); }

.kths-prod-btn-gold {
  background: #f59e0b;
  box-shadow: 0 3px 10px rgba(245,158,11,.3);
}
.kths-prod-btn-gold:hover {
  background: #d97706;
  box-shadow: 0 5px 16px rgba(245,158,11,.4);
}

/* ── Selected badge ── */
.kths-selected-svc {
  background: #f0fdf8;
  border: 1.5px solid var(--kths-green);
  border-radius: 10px;
  padding: 12px 18px;
  margin-bottom: 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 16px; font-weight: 600; color: var(--kths-green-d);
}
.kths-price-tag {
  font-size: 18px; font-weight: 800;
  background: var(--kths-green); color: #fff;
  padding: 4px 14px; border-radius: 20px;
}

/* ── Form fields ── */
.kths-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width:560px) { .kths-form-grid { grid-template-columns: 1fr; } }

.kths-field { margin-bottom: 16px; }
.kths-label {
  display: flex; flex-direction: column; gap: 2px;
  font-size: 15px; font-weight: 600; color: #334155;
  margin-bottom: 7px;
}
.kths-req   { color: #e11d48; margin-left: 2px; }
.kths-opt   { color: #94a3b8; font-weight: 400; font-size: 13px; }
.kths-hint  { font-size: 13px; color: var(--kths-gray); font-weight: 400; }

.kths-input {
  width: 100%; box-sizing: border-box;
  padding: 12px 15px;
  border: 1.5px solid var(--kths-border);
  border-radius: 10px;
  font-size: 17px; color: var(--kths-dark);
  background: #fff; outline: none;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.kths-input:focus {
  border-color: var(--kths-green);
  box-shadow: 0 0 0 4px rgba(14,165,114,.1);
}
.kths-textarea { min-height: 100px; resize: vertical; }
.kths-err {
  display: none; font-size: 13px; color: #e11d48;
  margin-top: 4px; font-weight: 500;
}
.kths-err.show { display: block; }

.kths-divider {
  font-size: 14px; font-weight: 700; color: var(--kths-gray);
  text-transform: uppercase; letter-spacing: .08em;
  border-bottom: 2px solid var(--kths-border);
  padding-bottom: 8px; margin: 1.5rem 0 1.25rem;
}

/* ── Review box ── */
.kths-review-box {
  background: var(--kths-bg);
  border: 1.5px solid var(--kths-border);
  border-radius: var(--kths-radius);
  overflow: hidden;
  margin-bottom: .5rem;
}
.kths-review-header {
  background: var(--kths-green);
  color: #fff;
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.kths-review-header h3 { margin: 0; font-size: 17px; }
.kths-review-header .kths-rv-price {
  font-size: 22px; font-weight: 800;
  background: rgba(255,255,255,.2);
  padding: 4px 16px; border-radius: 20px;
}
.kths-review-body { padding: 18px 20px; }
.kths-review-row {
  display: flex; justify-content: space-between;
  padding: 9px 0; border-bottom: 1px solid var(--kths-border);
  font-size: 16px; gap: 12px;
}
.kths-review-row:last-child { border-bottom: none; }
.kths-review-lbl { color: var(--kths-gray); font-weight: 500; }
.kths-review-val { font-weight: 700; text-align: right; word-break: break-word; max-width: 65%; }

/* ── Success notice ── */
.kths-success-notice {
  background: #f0fdf8;
  border: 1.5px solid var(--kths-green);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin: 1rem auto 0;
  max-width: 520px;
  text-align: left;
  font-size: 15px;
  color: #134e38;
  line-height: 1.8;
}
.kths-success-notice p { margin: 0 0 6px; }
.kths-success-notice p:last-child { margin: 0; }

/* ── Success / order code ── */
.kths-success {
  text-align: center; padding: 2rem 1rem;
}
.kths-success-icon  { font-size: 60px; display: block; margin-bottom: 1rem; }
.kths-success-title { font-size: 24px; font-weight: 800; color: var(--kths-green); margin: 0 0 8px; }
.kths-success-sub   { font-size: 17px; color: var(--kths-gray); margin: 0 0 20px; }
.kths-order-code-box {
  display: inline-block;
  background: #f0fdf8; border: 2px dashed var(--kths-green);
  border-radius: 10px; padding: 14px 28px;
  font-size: 26px; font-weight: 900; letter-spacing: .1em;
  color: var(--kths-green-d); cursor: pointer;
  margin-bottom: 1.25rem;
}

/* ── Buttons ── */
.kths-actions {
  display: flex; justify-content: space-between;
  align-items: center; margin-top: 2rem; gap: 12px;
}
.kths-btn {
  padding: 13px 28px; border-radius: 10px;
  font-size: 17px; font-weight: 700;
  cursor: pointer; border: 2px solid transparent;
  font-family: inherit; line-height: 1;
  transition: all .2s;
}
.kths-btn:active { transform: scale(.97); }
.kths-btn-primary {
  background: var(--kths-green); border-color: var(--kths-green); color: #fff;
  margin-left: auto;
}
.kths-btn-primary:hover:not(:disabled) { background: var(--kths-green-d); border-color: var(--kths-green-d); }
.kths-btn-primary:disabled { background: #cbd5e1; border-color: #cbd5e1; cursor: not-allowed; }
.kths-btn-back {
  background: transparent; border-color: #cbd5e1; color: var(--kths-gray);
}
.kths-btn-back:hover { border-color: #94a3b8; color: var(--kths-dark); }

/* ── Track form ── */
.kths-track-wrap { max-width: 540px; }
.kths-track-form { background: var(--kths-card); border-radius: var(--kths-radius); border: 1.5px solid var(--kths-border); padding: 1.75rem; }
.kths-track-result-card {
  background: var(--kths-bg); border-radius: var(--kths-radius);
  border: 1.5px solid var(--kths-border); overflow: hidden;
}
.kths-track-status-bar {
  padding: 12px 18px; color: #fff; font-size: 16px; font-weight: 700;
}
.kths-track-body { padding: 16px 18px; }
.kths-result-text {
  background: #f0fdf8; border-left: 4px solid var(--kths-green);
  border-radius: 0 8px 8px 0; padding: 14px 18px;
  font-size: 20px; font-weight: 700; color: var(--kths-dark);
  margin-top: 12px; white-space: pre-wrap;
  font-family: 'Segoe UI Emoji', sans-serif;
}

/* ── Shop page header ── */
.kths-shop-header { text-align: center; margin-bottom: 2rem; }
.kths-shop-title  { font-size: 26px; font-weight: 800; margin: 0 0 8px; }
.kths-shop-sub    { font-size: 16px; color: var(--kths-gray); margin: 0; }
.kths-shop-grid   { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.kths-order-grid  { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* ── Step bar (order page) ── */
.kths-stepbar {
  display: flex; align-items: center;
  margin-bottom: 2.5rem; gap: 0;
}
.kths-sb-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; flex-shrink: 0; cursor: default;
}
.kths-sb-num {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #9ca3af;
  transition: all .3s;
}
.kths-sb-lbl { font-size: 12px; color: #9ca3af; font-weight: 500; white-space: nowrap; }
.kths-sb-item.active .kths-sb-num { background: var(--kths-green); border-color: var(--kths-green); color: #fff; }
.kths-sb-item.active .kths-sb-lbl { color: var(--kths-green); font-weight: 700; }
.kths-sb-item.done   .kths-sb-num { background: var(--kths-green-d); border-color: var(--kths-green-d); color: #fff; }
.kths-sb-item.done   .kths-sb-lbl { color: var(--kths-green-d); }
.kths-sb-sep {
  flex: 1; height: 2px; background: #e5e7eb;
  margin: 0 4px; margin-bottom: 22px;
  transition: background .3s;
}
.kths-sb-sep.done { background: var(--kths-green-d); }
@media (max-width: 480px) { .kths-sb-lbl { display: none; } .kths-sb-sep { margin-bottom: 0; } }
