/* ============================================================
   Track Order Page — hto- namespaced styles
   ============================================================ */

.hto-wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 1em 1em 3em;
}

/* ── Form ──────────────────────────────────────────────────── */
.hto-form-card {
    padding: 1em 0;
    margin-bottom: 1em;
    border-bottom: 1px solid #e2e2e2;
}

.hto-form-card__desc {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0 0 1em;
}

.hto-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75em;
    margin-bottom: 1em;
}

.hto-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.375em;
}

.hto-form-field label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
}

.hto-form-field input {
    width: 100%;
    padding: 0.6em 0.75em;
    font-size: 0.9375rem;
    color: #111827;
    background: #fff;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}

.hto-form-field input::placeholder { color: #9ca3af; }

.hto-form-field input:focus {
    border-color: #ED1C24;
    box-shadow: 0 0 0 3px rgba(237,28,36,0.12);
}

.hto-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    width: 100%;
    padding: 0.75em 1em;
    background: #ED1C24;
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}

.hto-submit-btn:hover:not(:disabled) { background: #c91119; }
.hto-submit-btn:disabled,
.hto-submit-btn.is-loading { opacity: 0.65; cursor: not-allowed; }

.hto-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: hto-spin 0.65s linear infinite;
    flex-shrink: 0;
}
@keyframes hto-spin { to { transform: rotate(360deg); } }

/* ── Error ─────────────────────────────────────────────────── */
.hto-error {
    display: none;
    align-items: flex-start;
    gap: 0.5em;
    border-left: 3px solid #dc2626;
    padding: 0.625em 0.75em;
    margin-bottom: 1em;
    color: #b91c1c;
    font-size: 0.875rem;
    line-height: 1.5;
    background: #fef2f2;
}
.hto-error.is-visible { display: flex; }
.hto-error__icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }

/* ── Results ───────────────────────────────────────────────── */
.hto-results { display: none; }
.hto-results.is-visible { display: block; }

/* ── Order meta bar ────────────────────────────────────────── */
.hto-order-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4em;
    padding: 0.75em 0;
    border-bottom: 1px solid #e2e2e2;
    margin-bottom: 0;
}

.hto-order-meta__sep { color: #ccc; }

.hto-order-number {
    font-size: 1rem;
    font-weight: 700;
    color: #111;
    margin: 0;
}

.hto-order-date {
    font-size: 0.875rem;
    color: #6b7280;
}

.hto-status-badge {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    padding: 0.2em 0.6em;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Section base ──────────────────────────────────────────── */
.hto-section {
    padding: 1em 0;
    border-bottom: 1px solid #e2e2e2;
}

.hto-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #999;
    margin: 0 0 0.75em;
}

/* ── Stepper ───────────────────────────────────────────────── */
.hto-stepper {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    margin-bottom: 0.875em;
}

.hto-stepper::before {
    content: '';
    position: absolute;
    top: 14px;
    left: calc(28px / 2);
    right: calc(28px / 2);
    height: 2px;
    background: #e5e7eb;
    z-index: 0;
}

.hto-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375em;
    flex: 1;
    position: relative;
    z-index: 1;
}

.hto-step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e5e7eb;
    border: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.hto-step-dot svg { display: none; width: 13px; height: 13px; }
.hto-step-dot__x  { display: none; }

.hto-step-label {
    font-size: 0.625rem;
    font-weight: 500;
    color: #9ca3af;
    text-align: center;
    line-height: 1.3;
    max-width: 60px;
}

/* Done — blue check (matches reference) */
.hto-step.is-done .hto-step-dot {
    background: #2563eb;
    border-color: #2563eb;
}
.hto-step.is-done .hto-step-dot > svg:first-child { display: block; color: #fff; }
.hto-step.is-done .hto-step-label { color: #2563eb; font-weight: 600; }

/* Active — brand red ring */
.hto-step.is-active .hto-step-dot {
    background: #fff;
    border-color: #ED1C24;
    box-shadow: 0 0 0 3px rgba(237,28,36,0.12);
}
.hto-step.is-active .hto-step-dot::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ED1C24;
}
.hto-step.is-active .hto-step-label { color: #ED1C24; font-weight: 700; }

/* Terminal (cancelled/failed) — red X */
.hto-step.is-terminal .hto-step-dot {
    background: #dc2626;
    border-color: #dc2626;
}
.hto-step.is-terminal .hto-step-dot .hto-step-dot__x { display: block; color: #fff; }
.hto-step.is-terminal .hto-step-label { color: #dc2626; font-weight: 700; }

/* Current status line */
.hto-current-status {
    font-size: 0.875rem;
    color: #374151;
    margin: 0;
}
.hto-current-status strong { color: #111; }

/* ── Tracking row ──────────────────────────────────────────── */
.hto-tracking-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75em;
    flex-wrap: wrap;
}

.hto-tracking-number {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111;
    margin: 0;
}

.hto-tracking-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    padding: 0.35em 0.75em;
    background: #16a34a;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 4px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s;
    flex-shrink: 0;
}
.hto-tracking-link:hover { background: #15803d; color: #fff; text-decoration: none; }
.hto-tracking-link svg { width: 11px; height: 11px; }

/* ── Items ─────────────────────────────────────────────────── */
.hto-items-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid #e2e2e2;
}

.hto-item {
    display: flex;
    align-items: center;
    gap: 0.875em;
    padding: 0.875em 0;
    border-bottom: 1px solid #e2e2e2;
}

.hto-item:last-child { border-bottom: none; padding-bottom: 0; }
.hto-item:first-child { padding-top: 0.75em; }

.hto-item__image {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
}
.hto-item__image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hto-item__image--placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: #d1d5db;
}

.hto-item__info { flex: 1; min-width: 0; }

.hto-item__name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 0.2em;
    line-height: 1.4;
}

.hto-item__meta {
    font-size: 0.78rem;
    color: #6b7280;
    margin: 0 0 0.2em;
    line-height: 1.4;
}

.hto-item__qty { font-size: 0.8125rem; color: #9ca3af; }

.hto-item__price {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #333;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Order summary / totals ────────────────────────────────── */
.hto-totals-list { display: flex; flex-direction: column; }

.hto-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.45em 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.875rem;
    color: #374151;
}
.hto-total-row:last-child { border-bottom: none; padding-bottom: 0; }
.hto-total-row:first-child { padding-top: 0; }

.hto-total-row__label { color: #6b7280; }
.hto-total-row__value { font-weight: 500; color: #333; text-align: right; }

.hto-total-row--grand {
    padding-top: 0.75em !important;
    border-top: 2px solid #e2e2e2 !important;
    border-bottom: none !important;
}
.hto-total-row--grand .hto-total-row__label { font-size: 0.9375rem; font-weight: 700; color: #333; }
.hto-total-row--grand .hto-total-row__value { font-size: 1rem; font-weight: 800; color: #ED1C24; }
.hto-total-row--discount .hto-total-row__value { color: #059669; }
.hto-total-row--payment .hto-total-row__value { font-weight: 400; color: #555; font-size: 0.8125rem; text-align: right; max-width: 55%; }

/* ── Shipping address ──────────────────────────────────────── */
.hto-address-body {
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.65;
    font-style: normal;
    margin: 0;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .hto-wrap { padding: 0.75em 0 2em; }
    .hto-form-row { grid-template-columns: 1fr; gap: 0.75em; }
}
