/* ═══════════════════════════════════════════════════════════════════
   UPS Custom — Order Detail Page  (matches pagedone design)
   ═══════════════════════════════════════════════════════════════════ */

/* ── Fonts ───────────────────────────────────────────────────────── */

/* ── Section wrapper ─────────────────────────────────────────────── */
.uod-section {
    padding: 48px 0;
}

.uod-container {
    width: 100%;
    max-width: 1120px;
    padding: 0 20px;
    margin: 0 auto;
}

.uod-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    padding: 28px;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background:
        radial-gradient(circle at top left, rgba(219, 234, 254, 0.9), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

/* ── Page title block ────────────────────────────────────────────── */
.uod-title-block {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.uod-page-title {
    font-family: inherit;
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.3;
    border: none;
    padding: 0;
}

.uod-page-desc {
    max-width: 720px;
    font-size: 0.95rem;
    color: #6b7280;
    line-height: 1.65;
    margin: 0;
}

/* ── Block ───────────────────────────────────────────────────────── */
.uod-block {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 22px 24px;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

/* Header row: title left + button right */
.uod-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.uod-block-title {
    font-family: inherit;
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
    padding: 0;
    border: none;
    line-height: 1.4;
}

.uod-block-title--standalone {
    margin-bottom: 4px;
}

.uod-order-id {
    font-family: inherit;
    font-size: 1.5rem;
    font-weight: 600;
    color: #4b5563;
    margin: 0;
    padding: 0;
    border: none;
}

/* ── Primary button ──────────────────────────────────────────────── */
.uod-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 20px;
    background: #4f46e5;
    color: #fff !important;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.5;
    cursor: pointer;
    text-decoration: none !important;
    transition: background 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(16,24,40,0.05);
}
.uod-btn-primary:hover { background: #3730a3; color: #fff !important; }
.uod-btn-disabled { opacity: 0.45; cursor: default; }
.uod-btn-disabled:hover { background: #4f46e5; }

/* ── Info strip ──────────────────────────────────────────────────── */
.uod-info-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 32px 40px;
    padding: 24px;
    border: 1px solid #edf2f7;
    border-radius: 12px;
    background: #fbfdff;
}

.uod-info-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.uod-info-label {
    font-size: 0.95rem;
    font-weight: 400;
    color: #6b7280;
    line-height: 1.5;
}

.uod-info-value {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.6;
    white-space: nowrap;
}

/* ── Stepper container ───────────────────────────────────────────── */
.uod-stepper-wrap {
    width: 100%;
    padding: 36px 24px;
    border-radius: 12px;
    border: 1px solid #dbe3ef;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    overflow-x: auto;
}

.uod-stepper {
    display: flex;
    align-items: flex-start;
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

/* Each step occupies equal horizontal space */
.uod-step {
    flex: 1 1 0;
    position: relative;
    display: flex;
    justify-content: center;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: #6b7280;   /* default: pending */
    white-space: nowrap;
}

/* Connector line via ::after — spans from center of this step to center of next */
.uod-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 15px;        /* vertically centered in 32px circle = 16px - 1px */
    left: 50%;
    right: -50%;
    height: 2px;
    background: #d1d5db; /* gray by default */
    z-index: 0;
}

/* Blue connector = next step is done */
.uod-step--line-done::after  { background: #4f46e5; }
.uod-step--line-pending::after { background: #d1d5db; }

/* Centering wrapper inside li */
.uod-step-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    position: relative;
    z-index: 1;
}

/* Circle */
.uod-step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    /* Default (future): outline only */
    background: transparent;
    color: #4f46e5;
    border: 2px solid #4f46e5;
    flex-shrink: 0;
}

/* Done / current: filled */
.uod-step--done .uod-step-circle,
.uod-step--current .uod-step-circle {
    background: #4f46e5;
    color: #fff;
    border-color: #4f46e5;
}

/* Done: indigo text */
.uod-step--done,
.uod-step--current {
    color: #4f46e5;
}

.uod-step-date {
    font-size: 14px;
    font-weight: 400;
    color: inherit;
    opacity: 0.85;
}

.uod-step-exception {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #dc2626;
    margin-top: 2px;
    letter-spacing: 0.02em;
}

/* ── Current step indicator (green triangle) ─────────────────────── */
.uod-step-indicator {
    display: block;
    font-size: 14px;
    color: #16a34a;
    margin-top: 4px;
    line-height: 1;
}

/* ── Stepper color schemes by tracking status ────────────────────── */

/* D = Delivered — all done steps turn green */
.uod-stepper-wrap[data-tracking-status="D"] .uod-step--done .uod-step-circle,
.uod-stepper-wrap[data-tracking-status="D"] .uod-step--current .uod-step-circle {
    background: #16a34a;
    border-color: #16a34a;
}
.uod-stepper-wrap[data-tracking-status="D"] .uod-step--done,
.uod-stepper-wrap[data-tracking-status="D"] .uod-step--current {
    color: #16a34a;
}
.uod-stepper-wrap[data-tracking-status="D"] .uod-step--line-done::after {
    background: #16a34a;
}
.uod-stepper-wrap[data-tracking-status="D"] .uod-step--future .uod-step-circle {
    border-color: #16a34a;
    color: #16a34a;
}

/* I = In Transit — amber/orange accent on current step */
.uod-stepper-wrap[data-tracking-status="I"] .uod-step--current .uod-step-circle {
    background: #f59e0b;
    border-color: #f59e0b;
    box-shadow: 0 0 0 4px rgba(245,158,11,0.18);
}
.uod-stepper-wrap[data-tracking-status="I"] .uod-step--current {
    color: #f59e0b;
}

/* O = Out for Delivery — orange accent on current step */
.uod-stepper-wrap[data-tracking-status="O"] .uod-step--current .uod-step-circle {
    background: #ea580c;
    border-color: #ea580c;
    box-shadow: 0 0 0 4px rgba(234,88,12,0.18);
}
.uod-stepper-wrap[data-tracking-status="O"] .uod-step--current {
    color: #ea580c;
}

/* X = Exception — red on current step */
.uod-stepper-wrap[data-tracking-status="X"] .uod-step--current .uod-step-circle {
    background: #dc2626;
    border-color: #dc2626;
    box-shadow: 0 0 0 4px rgba(220,38,38,0.18);
}
.uod-stepper-wrap[data-tracking-status="X"] .uod-step--current {
    color: #dc2626;
}

/* ── Items table ─────────────────────────────────────────────────── */
.uod-items {
    width: 100%;
    padding-top: 10px;
}

.uod-items-head {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 16px;
    background: #f9fafb;
    gap: 16px;
    border: 1px solid #edf2f7;
    border-radius: 12px 12px 0 0;
}

.uod-th {
    font-size: 16px;
    font-weight: 400;
    color: #6b7280;
    line-height: 1.5;
}

.uod-th-right {
    display: flex;
    align-items: center;
}

.uod-th-qty   { width: 160px; text-align: center; font-size: 0.95rem; font-weight: 400; color: #6b7280; }
.uod-th-price { width: 160px; text-align: center; font-size: 0.95rem; font-weight: 400; color: #6b7280; }

.uod-item-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px 24px;
    padding: 18px 16px;
    border-bottom: 1px solid #e5e7eb;
    border-left: 1px solid #edf2f7;
    border-right: 1px solid #edf2f7;
    background: #ffffff;
}
.uod-item-row:last-child {
    border-bottom: 1px solid #edf2f7;
    border-radius: 0 0 12px 12px;
}

/* Left column */
.uod-item-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
    min-width: 0;
    overflow: hidden;
}

.uod-item-img-wrap {
    width: 120px;
    height: 120px;
    background: #f9fafb;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.uod-item-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
}

.uod-item-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.uod-item-name {
    font-size: 1rem;
    font-weight: 500;
    color: #111827;
    line-height: 1.5;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 420px;
}
a.uod-item-name:hover { color: #4f46e5; text-decoration: none; }

.uod-item-sku,
.uod-item-meta {
    font-size: 0.9rem;
    font-weight: 400;
    color: #6b7280;
    line-height: 1.5;
    white-space: nowrap;
}

/* Right column */
.uod-item-right {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}

.uod-item-qty-display,
.uod-item-qty-wrap {
    width: 160px;
    display: flex;
    justify-content: center;
}

.uod-item-qty-num {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    font-size: 1rem;
    font-weight: 500;
    color: #111827;
    background: #fff;
}

.uod-item-price {
    width: 160px;
    text-align: center;
    font-size: 1rem;
    font-weight: 500;
    color: #111827;
    line-height: 1.5;
}

/* ── Totals ──────────────────────────────────────────────────────── */
.uod-totals-grid {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.uod-totals-card {
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #dbe3ef;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.uod-total-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.uod-total-label {
    font-size: 1rem;
    font-weight: 500;
    color: #4b5563;
    line-height: 1.6;
}

.uod-total-value {
    font-size: 1rem;
    font-weight: 500;
    color: #111827;
    line-height: 1.6;
    text-align: right;
}

.uod-total-value--total {
    font-weight: 700;
}

/* WooCommerce price tag overrides */
.uod-total-value .woocommerce-Price-amount,
.uod-item-price .woocommerce-Price-amount {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

/* ── Shipment tracking card ──────────────────────────────────────── */
.uod-shipment-card {
    margin-top: 20px;
    padding: 20px 24px;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.uod-shipment-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.uod-carrier-logo {
    height: 50px;
    max-width: 130px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.uod-shipment-info {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.uod-shipment-lbl {
    font-size: 0.9rem;
    color: #6b7280;
    flex-shrink: 0;
}

.uod-tracking-num {
    font-size: 0.9rem;
    font-family: monospace;
    color: #2980b9;
    text-decoration: none;
    word-break: break-all;
}
.uod-tracking-num:hover { text-decoration: underline; }

.uod-btn-outline {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    border: 1.5px solid #4f46e5;
    border-radius: 8px;
    color: #4f46e5 !important;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.15s;
}
.uod-btn-outline:hover { background: rgba(79,70,229,0.06); }

.uod-btn-map.ups-live-track-btn {
    background: #4f46e5;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 18px;
}
.uod-btn-map.ups-live-track-btn:hover { background: #3730a3; }

/* map wrap inside our card — embedded, always visible */
.uod-map-wrap {
    margin-top: 0 !important;
    border: none !important;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: none;
}

.uod-map-wrap .ups-track-map {
    height: 380px;
    border-radius: 10px 10px 0 0;
}

.uod-map-wrap .ups-track-timeline {
    max-height: 260px;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .uod-wrapper {
        padding: 16px;
        border-radius: 14px;
    }

    .uod-block {
        padding: 18px 16px;
    }

    .uod-info-strip {
        padding: 18px 16px;
    }

    .uod-stepper-wrap {
        padding: 24px 16px;
    }

    .uod-step {
        font-size: 12px;
    }

    .uod-step-circle {
        width: 26px;
        height: 26px;
        font-size: 12px;
    }

    .uod-step:not(:last-child)::after {
        top: 12px;
    }

    .uod-items-head { display: none; }

    .uod-item-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .uod-item-right {
        justify-content: flex-start;
        padding-left: 136px; /* align with text, not image */
    }

    .uod-item-qty-display,
    .uod-item-price {
        width: 100px;
    }

    .uod-totals-grid {
        grid-template-columns: 1fr;
    }

    .uod-info-strip {
        gap: 20px 24px;
    }

    .uod-page-title { font-size: 1.75rem; }
    .uod-block-title { font-size: 1.25rem; }
    .uod-order-id { font-size: 1.125rem; }
}

@media (max-width: 480px) {
    .uod-item-img-wrap { width: 80px; height: 80px; }
    .uod-item-img { width: 60px; height: 60px; }
    .uod-item-right { padding-left: 96px; }

    .uod-stepper {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 8px;
    }
    .uod-step {
        flex: 0 0 80px;
        white-space: normal;
        text-align: center;
    }
    .uod-step::after { display: none; }
}

/* ── Public tracking page — search form ──────────────────────── */

.uod-track-form-block {
    padding: 28px 32px;
}

.uod-track-form-compact {
    padding: 20px 32px;
}

.uod-track-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    margin-bottom: 20px;
}

.uod-track-form {
    width: 100%;
}

.uod-track-form-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.uod-track-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 220px;
}

.uod-track-field--btn {
    flex: 0 0 auto;
}

.uod-track-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.uod-track-label--hidden {
    visibility: hidden;
}

.uod-track-input {
    padding: 10px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s;
    font-family: inherit;
}

.uod-track-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}

.uod-track-submit {
    padding: 10px 28px;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .uod-track-form-row {
        flex-direction: column;
    }
    .uod-track-field--btn {
        width: 100%;
    }
    .uod-track-submit {
        width: 100%;
    }
    .uod-track-label--hidden {
        display: none;
    }
    .uod-track-form-block,
    .uod-track-form-compact {
        padding: 20px 16px;
    }
}
