/**
 * Order tracking shortcode — modern UI (scoped)
 */

.wc-lp-order-tracking {
    --wc-lp-ot-bg: linear-gradient(145deg, #f8fafc 0%, #eef2ff 45%, #f0fdf4 100%);
    --wc-lp-ot-card: rgba(255, 255, 255, 0.82);
    --wc-lp-ot-border: rgba(15, 23, 42, 0.08);
    --wc-lp-ot-shadow: 0 4px 24px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
    --wc-lp-ot-accent: #16a34a;
    --wc-lp-ot-accent-2: #22c55e;
    --wc-lp-ot-text: #0f172a;
    --wc-lp-ot-muted: #64748b;
    --wc-lp-ot-radius: 12px;
    --wc-lp-ot-radius-sm: 8px;
    max-width: 720px;
    margin: 2rem auto;
    padding: 0 1rem;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.wc-lp-order-tracking *,
.wc-lp-order-tracking *::before,
.wc-lp-order-tracking *::after {
    box-sizing: border-box;
}

.wc-lp-ot-shell {
    background: var(--wc-lp-ot-bg);
    border-radius: calc(var(--wc-lp-ot-radius) + 4px);
    padding: 2rem 1.5rem 2.25rem;
    border: 1px solid var(--wc-lp-ot-border);
    box-shadow: var(--wc-lp-ot-shadow);
}

.wc-lp-ot-form {
    margin: 0;
}

.wc-lp-ot-hero {
    text-align: center;
    margin-bottom: 1.75rem;
}

.wc-lp-ot-ajax-out {
    margin-top: 1.5rem;
}

.wc-lp-ot-loading {
    text-align: center;
    padding: 1.25rem;
    font-size: 0.9rem;
    color: var(--wc-lp-ot-muted);
    background: var(--wc-lp-ot-card);
    border: 1px solid var(--wc-lp-ot-border);
    border-radius: var(--wc-lp-ot-radius);
}

.wc-lp-ot-hero-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.12), rgba(34, 197, 94, 0.18));
    color: var(--wc-lp-ot-accent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.wc-lp-ot-title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.35rem, 4vw, 1.65rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--wc-lp-ot-text);
}

.wc-lp-ot-lead {
    margin: 0 auto;
    max-width: 28rem;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--wc-lp-ot-muted);
}

.wc-lp-ot-card {
    background: var(--wc-lp-ot-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--wc-lp-ot-border);
    border-radius: var(--wc-lp-ot-radius);
    padding: 1.35rem 1.25rem 1.25rem;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.wc-lp-ot-alerts {
    margin-bottom: 1rem;
}

.wc-lp-ot-alert {
    padding: 0.75rem 1rem;
    border-radius: var(--wc-lp-ot-radius-sm);
    font-size: 0.9rem;
    line-height: 1.45;
}

.wc-lp-ot-alert--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.wc-lp-ot-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--wc-lp-ot-muted);
    margin-bottom: 0.5rem;
}

.wc-lp-ot-fieldrow {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    align-items: stretch;
}

.wc-lp-ot-input {
    flex: 1 1 200px;
    min-width: 0;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    border: 1.5px solid rgba(15, 23, 42, 0.12);
    border-radius: var(--wc-lp-ot-radius-sm);
    background: #fff;
    color: var(--wc-lp-ot-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wc-lp-ot-input::placeholder {
    color: #94a3b8;
}

.wc-lp-ot-input:hover {
    border-color: rgba(22, 163, 74, 0.35);
}

.wc-lp-ot-input:focus {
    outline: none;
    border-color: var(--wc-lp-ot-accent);
    box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.15);
}

.wc-lp-ot-submit {
    flex: 0 0 auto;
    padding: 0.85rem 1.35rem;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, var(--wc-lp-ot-accent), var(--wc-lp-ot-accent-2));
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.35);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.wc-lp-ot-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.4);
}

.wc-lp-ot-submit:active {
    transform: translateY(0);
}

.wc-lp-ot-hint {
    margin: 0.65rem 0 0;
    font-size: 0.8rem;
    color: var(--wc-lp-ot-muted);
}

/* Results */
.wc-lp-ot-results {
    margin-top: 2rem;
}

.wc-lp-ot-results-meta {
    margin: 0 0 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--wc-lp-ot-muted);
}

.wc-lp-ot-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.wc-lp-ot-order {
    background: #fff;
    border: 1px solid var(--wc-lp-ot-border);
    border-radius: var(--wc-lp-ot-radius);
    padding: 1.25rem 1.35rem;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
    position: relative;
    overflow: hidden;
}

.wc-lp-ot-order::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--wc-lp-ot-accent), var(--wc-lp-ot-accent-2));
    border-radius: 4px 0 0 4px;
    opacity: 0.85;
}

.wc-lp-ot-order--completed::before,
.wc-lp-ot-order--processing::before {
    background: linear-gradient(180deg, #16a34a, #4ade80);
}

.wc-lp-ot-order--pending::before,
.wc-lp-ot-order--on-hold::before {
    background: linear-gradient(180deg, #ca8a04, #eab308);
}

.wc-lp-ot-order--cancelled::before,
.wc-lp-ot-order--failed::before,
.wc-lp-ot-order--refunded::before {
    background: linear-gradient(180deg, #dc2626, #f87171);
}

.wc-lp-ot-order-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding-left: 0.35rem;
}

.wc-lp-ot-order-id {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.wc-lp-ot-order-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--wc-lp-ot-muted);
}

.wc-lp-ot-order-num {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--wc-lp-ot-text);
    letter-spacing: -0.02em;
}

.wc-lp-ot-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    background: rgba(22, 163, 74, 0.1);
    color: #15803d;
    border: 1px solid rgba(22, 163, 74, 0.2);
}

.wc-lp-ot-order--pending .wc-lp-ot-badge,
.wc-lp-ot-order--on-hold .wc-lp-ot-badge {
    background: rgba(234, 179, 8, 0.12);
    color: #a16207;
    border-color: rgba(234, 179, 8, 0.25);
}

.wc-lp-ot-order--cancelled .wc-lp-ot-badge,
.wc-lp-ot-order--failed .wc-lp-ot-badge {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.2);
}

.wc-lp-ot-order-time {
    display: block;
    margin: 0.65rem 0 0 0.35rem;
    font-size: 0.8rem;
    color: var(--wc-lp-ot-muted);
}

.wc-lp-ot-status-msg {
    margin: 1rem 0 0 0.35rem;
    padding: 1rem;
    border-radius: var(--wc-lp-ot-radius-sm);
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.06), rgba(34, 197, 94, 0.08));
    border: 1px solid rgba(22, 163, 74, 0.15);
}

.wc-lp-ot-status-msg-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--wc-lp-ot-accent);
    margin-bottom: 0.35rem;
}

.wc-lp-ot-status-msg-body {
    font-size: 0.9rem;
    line-height: 1.55;
    color: #14532d;
}

.wc-lp-ot-lines {
    list-style: none;
    margin: 1rem 0 0 0.35rem;
    padding: 0;
    border-top: 1px dashed rgba(15, 23, 42, 0.1);
}

.wc-lp-ot-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
    font-size: 0.9rem;
}

.wc-lp-ot-line:last-child {
    border-bottom: none;
}

.wc-lp-ot-line-name {
    color: var(--wc-lp-ot-text);
    font-weight: 500;
    word-break: break-word;
}

.wc-lp-ot-line-qty {
    flex-shrink: 0;
    font-weight: 600;
    color: var(--wc-lp-ot-muted);
    font-variant-numeric: tabular-nums;
}

.wc-lp-ot-order-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0 0 0.35rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.wc-lp-ot-total-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--wc-lp-ot-muted);
}

.wc-lp-ot-total-val {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--wc-lp-ot-text);
}

.wc-lp-ot-empty {
    margin-top: 2rem;
    text-align: center;
    padding: 2rem 1.25rem;
    background: var(--wc-lp-ot-card);
    border: 1px dashed var(--wc-lp-ot-border);
    border-radius: var(--wc-lp-ot-radius);
}

.wc-lp-ot-empty-icon {
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 0.75rem;
    opacity: 0.85;
}

.wc-lp-ot-empty-title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--wc-lp-ot-text);
}

.wc-lp-ot-empty-text {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--wc-lp-ot-muted);
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 540px) {
    .wc-lp-ot-shell {
        padding: 1.5rem 1rem 1.75rem;
    }

    .wc-lp-ot-fieldrow {
        flex-direction: column;
    }

    .wc-lp-ot-submit {
        width: 100%;
    }
}
