/* High-End Order Tracking Styles */
.ot-premium-wrapper {
    background-color: #fafcff;
    padding: 40px 20px;
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ot-premium-card {
    max-width: 500px;
}

#ot-track-result {
    max-width: 900px;
    will-change: opacity, transform;
}

.ot-premium-card,
#ot-track-result {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    width: 100%;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.08), 0 0 15px rgba(0, 0, 0, 0.02);
    padding: 40px;
    box-sizing: border-box;
    border: 1px solid #e2e8f0;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* SQUEEZED STATE WHEN RESULTS OPEN */
.ot-premium-card.results-active {
    max-width: 900px;
    padding: 40px;
}

/* Hide card entirely when form is slid up */
.ot-premium-card.form-hidden {
    display: none !important;
}

.ot-premium-card.results-active .ot-premium-head,
.ot-premium-card.form-hidden .ot-premium-head {
    display: none;
}

.ot-header-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.ot-header-right .ot-status-badge {
    justify-content: center;
}

.ot-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    transition: all 0.4s ease;
}

.ot-premium-card.results-active .ot-form-grid {
    grid-template-columns: 1fr 1fr auto;
    gap: 20px;
    align-items: end;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 32px;
    margin-bottom: 0;
}

/* Typography & Headings */
.ot-premium-head {
    text-align: center;
    margin-bottom: 40px;
}

.ot-premium-head h1 {
    font-size: 34px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 12px 0;
    letter-spacing: -0.03em;
}

.ot-premium-head p {
    font-size: 16px;
    color: #64748b;
    margin: 0;
    line-height: 1.6;
}

/* Form Elements */
.ot-form-group {
    margin-bottom: 0;
}

.ot-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ot-input-control {
    width: 100%;
    padding: 16px 20px !important;
    font-size: 16px;
    height: auto !important;
    color: #0f172a;
    background-color: #f8fafc !important;
    border: 2px solid #dfdfdf !important;
    border-radius: 14px !important;
    box-sizing: border-box;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* --- AUTOFILL OVERRIDE (Default State) --- */
.ot-input-control:-webkit-autofill,
.ot-input-control:-webkit-autofill:hover,
.ot-input-control:-webkit-autofill:focus,
.ot-input-control:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #f8fafc inset !important;
    -webkit-text-fill-color: #0f172a !important;
    transition: background-color 5000s ease-in-out 0s;
}

.ot-premium-card.results-active .ot-input-control {
    padding: 14px 18px !important;
    font-size: 15px;
    background: #ebebeb !important;
}

/* --- AUTOFILL OVERRIDE (Results Active State) --- */
.ot-premium-card.results-active .ot-input-control:-webkit-autofill,
.ot-premium-card.results-active .ot-input-control:-webkit-autofill:hover,
.ot-premium-card.results-active .ot-input-control:-webkit-autofill:focus,
.ot-premium-card.results-active .ot-input-control:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #ebebeb inset !important;
}

.ot-premium-card.results-active .ot-tracking-wrapper .ot-input-control {
    padding-left: 0 !important;
}

.ot-premium-card.results-active .ot-tracking-wrapper .ot-prefix-box {
    background: #ebebeb !important;
}

.ot-input-control:focus {
    background-color: #ffffff !important;
    border-color: var(--theme-palette-color-2) !important;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--theme-palette-color-2) 15%, transparent);
}

/* --- AUTOFILL OVERRIDE (Focus State) --- */
.ot-form-group label {
    display: flex;
    align-items: center;
    gap: 5px;
}

.ot-form-group label svg {
    width: 16px;
    height: 16px;
}

.ot-form-group label svg path {
    stroke: #94a3b8;
}

.ot-input-control:focus:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
}

.ot-tracking-wrapper {
    display: flex;
    align-items: center;
    background-color: #f8fafc;
    border: 2px solid #dfdfdf;
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.ot-tracking-wrapper:focus-within {
    background-color: #ffffff;
    border-color: var(--theme-palette-color-2);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--theme-palette-color-2) 15%, transparent);
}

.ot-prefix-box {
    color: #64748b;
    font-weight: 700;
    padding: 16px 0 16px 20px;
    font-size: 16px;
}

.ot-premium-card.results-active .ot-prefix-box {
    padding: 14px 0 14px 18px;
    font-size: 15px;
}

.ot-tracking-wrapper .ot-input-control {
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding-left: 0 !important;
}

/* --- AUTOFILL OVERRIDE (Tracking Wrapper Transparent) --- */
.ot-tracking-wrapper .ot-input-control:-webkit-autofill,
.ot-tracking-wrapper .ot-input-control:-webkit-autofill:hover,
.ot-tracking-wrapper .ot-input-control:-webkit-autofill:focus,
.ot-tracking-wrapper .ot-input-control:-webkit-autofill:active {
    transition: background-color 5000s ease-in-out 0s !important;
    -webkit-box-shadow: transparent !important;
}

.ot-tracking-wrapper .ot-input-control:focus {
    box-shadow: none !important;
}

.ot-submit-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background-color: var(--theme-palette-color-2) !important;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    padding: 16px 24px !important;
    border: none;
    border-radius: 14px !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ot-submit-btn svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.ot-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px color-mix(in srgb, var(--theme-palette-color-2) 30%, transparent);
}

.ot-submit-btn:hover svg {
    transform: translateX(4px);
}

.ot-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.ot-result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px dashed #e2e8f0;
}

.ot-header-left h2 {
    font-size: 36px;
    font-weight: 800;
    color: #0f172a;
    margin: 8px 0 0 0;
    letter-spacing: -0.02em;
}

/* Labels with Icons */
.ot-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

.ot-detail-table.ot-summary-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    font-family: inherit;
}

.ot-detail-table.ot-summary-table thead th {
    background: var(--theme-palette-color-6);
    color: var(--theme-palette-color-4);
    font-weight: 600;
    text-align: left;
    padding: 14px 18px;
    font-size: 14px;
    letter-spacing: 0.3px;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.ot-detail-table.ot-summary-table tbody td {
    padding: 14px 18px;
    font-size: 14px;
    color: #1a1a1a;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: #fff;
    transition: background 0.2s ease;
}

.ot-detail-table.ot-detail-table.ot-summary-table tbody td:nth-child(2) {
    display: flex;
    flex-direction: column;
}

.ot-detail-table.ot-detail-table.ot-summary-table thead th:nth-child(3),
.ot-detail-table.ot-detail-table.ot-summary-table thead th:nth-child(4),
.ot-detail-table.ot-detail-table.ot-summary-table thead th:nth-child(5),
.ot-detail-table.ot-detail-table.ot-summary-table thead th:nth-child(6),
.ot-detail-table.ot-detail-table.ot-summary-table tbody td:nth-child(3),
.ot-detail-table.ot-detail-table.ot-summary-table tbody td:nth-child(4),
.ot-detail-table.ot-detail-table.ot-summary-table tbody td:nth-child(5),
.ot-detail-table.ot-detail-table.ot-summary-table tbody td:nth-child(6) {
    text-align: center;
}

.ot-detail-table.ot-summary-table tbody tr:last-child td {
    border-bottom: none;
}

.ot-detail-table.ot-summary-table tbody tr:hover td {
    background: rgba(0, 0, 0, 0.02);
}

.ot-detail-table.ot-summary-table .ot-type-dim {
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
}

/* Track Another button hover */
#ot-track-another {
    transition: background 0.2s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.2s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.15s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#ot-track-another:hover {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
    color: #1e293b !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08) !important;
    transform: translateY(-1px) !important;
}

#ot-track-another:active {
    transform: translateY(0) !important;
    box-shadow: none !important;
}

/* Status label coherence */
.ot-header-right .ot-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.ot-header-right .ot-label svg {
    width: 14px;
    height: 14px;
    stroke: #94a3b8;
}

.ot-input-control::placeholder {
    color: #b6b6b6 !important;
}

.ot-hidden {
    display: none !important;
}

.ot-empty-pending {
    padding: 40px 20px;
}

.ot-empty-pending__icon {
    opacity: 0.3;
    margin-bottom: 16px;
}

.ot-empty-pending__title {
    margin: 0 0 8px;
    font-size: 1.125rem;
    color: var(--ec-text-main);
}

.ot-empty-pending__text {
    margin: 0;
    color: var(--ec-text-muted);
}

.ot-status-trigger-btn {
    padding: 6px 14px !important;
    font-size: 0.8rem !important;
    min-width: auto !important;
    height: 32px !important;
}

.ot-track-message-spaced {
    margin-top: 20px;
}

.ot-track-result-centered {
    margin: auto;
}

.ot-action-wrap {
    text-align: center;
    margin-top: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ot-action-wrap--delayed {
    transition: opacity 0.3s ease 0.4s;
}

.ot-secondary-ghost-btn {
    background: transparent;
    border: 1.5px solid #cbd5e1;
    color: #475569;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
}

.ot-card-loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

.ot-card-loader--soft {
    background: rgba(255, 255, 255, 0.85);
}

.ot-card-loader--soft-strong {
    background: rgba(255, 255, 255, 0.88);
}

.ot-card-loader__text {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
}

.ot-card-loader__text--strong {
    font-weight: 500;
}

#ot-loggedin-card {
    position: relative;
}

.ot-entry-loader {
    width: 100%;
    max-width: 640px;
    min-height: 280px;
    margin: 0 auto;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 48px 24px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.08), 0 0 15px rgba(0, 0, 0, 0.02);
}

.ot-entry-loader__text {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: #64748b;
}

.ot-entry-loading #ot-loggedin-card,
.ot-entry-loading #ot-track-result {
    display: none !important;
}

.ot-entry-loading #ot-entry-loader {
    display: flex !important;
}

.ot-status-label-icon {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-right: 4px;
}

@media (max-width: 768px) {
    #ot-track-result {
        padding: 15px;
        padding-top: 30px;
    }

    /* Collapse table into cards */
    .ot-detail-table.ot-summary-table {
        display: block;
        width: 100%;
        border: none;
        box-shadow: none;
    }

    .ot-detail-table.ot-summary-table thead {
        display: none;
    }

    .ot-detail-table.ot-summary-table tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    /* Each row = a card */
    .ot-detail-table.ot-summary-table tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0;
        background: #ffffff;
        border: 1px solid #e2e8f0;
        border-radius: 14px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
    }

    /* Each cell = labeled key-value block */
    .ot-detail-table.ot-summary-table td {
        display: flex;
        flex-direction: column;
        padding: 12px 14px;
        border: none;
        border-right: 1px solid #f1f5f9;
        border-bottom: 1px solid #f1f5f9;
        font-size: 14px;
        font-weight: 600;
        color: #0f172a;
        word-break: break-word;
    }

    .ot-detail-table.ot-summary-table td:last-child {
        border-right: none;
    }

    /* Label from data-label attribute */
    .ot-detail-table.ot-summary-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: #94a3b8;
        margin-bottom: 4px;
    }

    /* # and Brand span full width as header row of card */
    .ot-detail-table.ot-summary-table td:nth-child(1) {
        grid-column: span 1;
        background: #f8fafc;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 10px 8px;
    }

    .ot-detail-table.ot-summary-table td:nth-child(1)::before {
        font-size: 9px;
        color: #cbd5e1;
        margin-bottom: 2px;
    }

    .ot-detail-table.ot-summary-table td:nth-child(1)::after {
        content: attr(data-label-val);
    }

    .ot-detail-table.ot-summary-table td:nth-child(1) {
        grid-column: span 1;
        background: #f1f5f9;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 14px 8px;
        font-size: 22px;
        font-weight: 800;
        color: #334155;
        letter-spacing: -0.5px;
        border-right: 1px solid #e2e8f0;
    }

    .ot-detail-table.ot-summary-table td:nth-child(1)::before {
        font-size: 9px;
        font-weight: 700;
        color: #94a3b8;
        letter-spacing: 0.1em;
        margin-bottom: 4px;
    }

    .ot-detail-table.ot-summary-table td:nth-child(2) {
        grid-column: span 1;
        background: #f8fafc;
        font-size: 14px;
        font-weight: 700;
        color: #0f172a;
    }
}

.ot-detail-table span svg,
.ot-info-box svg,
.ot-header-left svg,
.ot-group-header svg {
    width: 16px;
    height: 16px;
    stroke: #94a3b8 !important;
}

/* Ultra Premium Badges */
.ot-status-badge {
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
}

.ot-status-badge.is-not-approved {
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fecaca;
}

.ot-status-badge.is-pending {
    background: #fffbeb;
    color: #f59e0b;
    border: 1px solid #fde68a;
}

.ot-status-badge.is-processing {
    background: color-mix(in srgb, var(--theme-palette-color-2) 10%, transparent);
    color: var(--theme-palette-color-2);
    border: 1px solid color-mix(in srgb, var(--theme-palette-color-2) 30%, transparent);
}

.ot-status-badge.is-completed {
    background: #ecfdf5;
    color: #10b981;
    border: 1px solid #a7f3d0;
}

.ot-status-badge.is-cancelled {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #cbd5e1;
}

/* Overview Grid */
.ot-result-overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 40px;
}

.ot-info-box {
    background: #ffffff;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    transition: transform 0.3s ease;
}

.ot-info-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.04);
}

.ot-info-box strong {
    font-size: 20px;
    color: #0f172a;
    display: block;
    margin-top: 10px;
    font-weight: 700;
}

/* Order Details (Groups) */
.ot-groups-wrapper h3 {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 24px 0;
}

.ot-group-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
}

.ot-group-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.ot-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px dashed #ccc;
}

.ot-group-header h4 {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ot-group-header h4 svg {
    color: #94a3b8 !important;
    stroke: #94a3b8 !important;
}

.ot-code-badge {
    background: #f8fafc;
    color: var(--theme-palette-color-2);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    border: 1px solid #e2e8f0;
    letter-spacing: 0.5px;
}

#ot-track-message {
    margin-top: 24px;
    padding: 16px 20px;
    border-radius: 14px;
    background-color: #fef2f2;
    color: #b91c1c;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    border: 1px solid #fecaca;
}

.ot-empty-state {
    color: #64748b;
    font-size: 16px;
    font-weight: 500;
    background: #f8fafc;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    border: 1px dashed #cbd5e1;
}

/* Spinner Loader */
.ot-loader {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .ot-premium-wrapper {
        padding: 40px 16px;
        min-height: auto;
    }

    .ot-premium-card {
        padding: 32px 24px;
        border-radius: 20px;
    }

    .ot-premium-card.results-active {
        padding: 24px;
    }

    .ot-premium-card.results-active .ot-form-grid {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .ot-result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .ot-result-overview-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .ot-group-card {
        padding: 24px;
    }

    .ot-group-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}