/* ============================
   Order Tracking - Result Cards & Input
   ============================ */

/* Input wrapper with prefix */
.ot-input-wrapper {
    position: relative;
}

.ot-input-prefix {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gemarkt-red, #ff1f1f);
    pointer-events: none;
    z-index: 2;
    font-family: var(--font-primary, 'Inter', sans-serif);
    letter-spacing: 0.02em;
}

.ot-input-wrapper input {
    padding-left: 2.5rem !important;
}

.ot-input-prefix:empty+input {
    padding-left: 1.5rem !important;
}

/* When prefix is +995, need more room */
.ot-input-prefix[data-long]+input,
.ot-input-wrapper input[type="tel"] {
    padding-left: 4.5rem !important;
}

/* Results Container */
.ot-results {
    margin-top: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 31, 31, 0.3) transparent;
}

.ot-results::-webkit-scrollbar {
    width: 6px;
}

.ot-results::-webkit-scrollbar-track {
    background: transparent;
}

.ot-results::-webkit-scrollbar-thumb {
    background: rgba(255, 31, 31, 0.3);
    border-radius: 3px;
}

/* Results Header */
.ot-results-header {
    font-size: 0.9rem;
    color: var(--color-gray-500, #6b7280);
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ot-results-header i {
    color: var(--gemarkt-red, #ff1f1f);
}

/* Order Card */
.ot-card {
    background: var(--color-gray-50, #f9fafb);
    border: 1px solid var(--color-gray-200, #e5e7eb);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.ot-card:last-child {
    margin-bottom: 0;
}

.ot-card-main {
    background: white;
    border-color: var(--gemarkt-red, #ff1f1f);
    border-width: 2px;
    box-shadow: 0 4px 20px rgba(255, 31, 31, 0.08);
}

.ot-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ot-order-id {
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-gray-900, #111827);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ot-order-id i {
    color: var(--gemarkt-red, #ff1f1f);
    font-size: 0.9rem;
}

/* Status Badge */
.ot-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.ot-status i {
    font-size: 0.75rem;
}

/* Card Date */
.ot-card-date {
    font-size: 0.85rem;
    color: var(--color-gray-500, #6b7280);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ot-card-date i {
    font-size: 0.8rem;
}

/* Items List */
.ot-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.ot-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 10px;
    transition: background 0.15s ease;
}

.ot-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.ot-item-img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--color-gray-200, #e5e7eb);
    flex-shrink: 0;
}

.ot-item-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.ot-item-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-gray-800, #1f2937);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.ot-item-qty {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-gray-500, #6b7280);
    flex-shrink: 0;
    margin-left: 0.5rem;
}

/* Card Footer */
.ot-card-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.5rem;
    border-top: 1px solid var(--color-gray-200, #e5e7eb);
}

.ot-total-items {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-gray-600, #4b5563);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.ot-total-items i {
    color: var(--gemarkt-red, #ff1f1f);
    font-size: 0.8rem;
}

/* Loading / Error / Empty States */
.ot-loading,
.ot-error,
.ot-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--color-gray-500, #6b7280);
}

.ot-loading i,
.ot-error i,
.ot-empty i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    display: block;
}

.ot-loading i {
    color: var(--gemarkt-red, #ff1f1f);
}

.ot-error i {
    color: #ef4444;
}

.ot-empty i {
    color: var(--color-gray-400, #9ca3af);
}

.ot-loading p,
.ot-error p,
.ot-empty p {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Modal content override for scrollable results */
.order-tracking-modal .product-search-modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

/* ============================
   Responsive - Tablet (max-width: 1024px)
   ============================ */
@media (max-width: 1024px) {
    .ot-results {
        max-height: 350px;
    }

    .ot-item-title {
        max-width: 180px;
    }
}

/* ============================
   Responsive - Phone (max-width: 768px)
   ============================ */
@media (max-width: 768px) {
    .order-tracking-modal .product-search-modal-content {
        max-height: 85vh;
        padding: 20px 15px !important;
    }

    .ot-results {
        max-height: 45vh;
        margin-top: 1rem;
    }

    .ot-card {
        padding: 1rem;
        border-radius: 12px;
    }

    .ot-card-main {
        border-width: 1.5px;
    }

    .ot-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .ot-order-id {
        font-size: 0.925rem;
    }

    .ot-status {
        font-size: 0.75rem;
        padding: 0.3rem 0.7rem;
    }

    .ot-card-date {
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
    }

    .ot-item {
        gap: 0.5rem;
        padding: 0.4rem;
    }

    .ot-item-img {
        width: 36px;
        height: 36px;
        border-radius: 6px;
    }

    .ot-item-title {
        max-width: 140px;
        font-size: 0.825rem;
    }

    .ot-item-qty {
        font-size: 0.75rem;
    }

    .ot-total-items {
        font-size: 0.8rem;
    }

    .ot-input-prefix {
        font-size: 1rem;
        left: 1rem;
    }

    .ot-input-wrapper input {
        padding-left: 2.2rem !important;
    }

    .ot-input-prefix[data-long]+input,
    .ot-input-wrapper input[type="tel"] {
        padding-left: 4rem !important;
    }

    .ot-results-header {
        font-size: 0.85rem;
    }

    .ot-loading,
    .ot-error,
    .ot-empty {
        padding: 2rem 0.75rem;
    }

    .ot-loading i,
    .ot-error i,
    .ot-empty i {
        font-size: 1.75rem;
    }

    .ot-loading p,
    .ot-error p,
    .ot-empty p {
        font-size: 0.875rem;
    }

    /* Tracking tab switch */
    .tracking-type-switch {
        margin-bottom: 1rem;
    }

    .tracking-type-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    /* Recent orders area */
    .recent-orders-area {
        margin-top: 1.25rem;
        padding-top: 1rem;
    }

    .recent-orders-list {
        gap: 0.5rem;
    }

    .recent-order-item {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
        gap: 0.35rem;
    }
}

/* ============================
   Responsive - Small Phone (max-width: 480px)
   ============================ */
@media (max-width: 480px) {
    .order-tracking-modal .product-search-modal-content {
        max-height: 90vh;
        padding: 18px 12px !important;
        border-radius: 12px !important;
        width: 98% !important;
        max-width: 98% !important;
    }

    .ot-results {
        max-height: 40vh;
        margin-top: 0.75rem;
    }

    .ot-card {
        padding: 0.85rem;
        border-radius: 10px;
        margin-bottom: 0.5rem;
    }

    .ot-order-id {
        font-size: 0.85rem;
    }

    .ot-order-id i {
        font-size: 0.8rem;
    }

    .ot-status {
        font-size: 0.7rem;
        padding: 0.25rem 0.6rem;
        gap: 0.25rem;
    }

    .ot-status i {
        font-size: 0.65rem;
    }

    .ot-card-date {
        font-size: 0.75rem;
        margin-bottom: 0.6rem;
    }

    .ot-item-img {
        width: 32px;
        height: 32px;
    }

    .ot-item-title {
        max-width: 120px;
        font-size: 0.8rem;
    }

    .ot-item-qty {
        font-size: 0.7rem;
    }

    .ot-total-items {
        font-size: 0.75rem;
    }

    .ot-input-prefix {
        font-size: 0.9rem;
        left: 0.85rem;
    }

    .ot-input-wrapper input {
        padding-left: 2rem !important;
    }

    .ot-input-prefix[data-long]+input,
    .ot-input-wrapper input[type="tel"] {
        padding-left: 3.5rem !important;
    }

    .ot-loading,
    .ot-error,
    .ot-empty {
        padding: 1.5rem 0.5rem;
    }

    .ot-loading i,
    .ot-error i,
    .ot-empty i {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .ot-loading p,
    .ot-error p,
    .ot-empty p {
        font-size: 0.8rem;
    }

    /* Hide button text on tiny screens, show only icon */
    #orderTrackingBtn span {
        display: none;
    }

    #orderTrackingBtn {
        padding: 0.6rem 0.8rem !important;
        min-width: auto;
    }

    .tracking-type-btn {
        padding: 0.45rem 0.5rem;
        font-size: 0.8rem;
    }

    .recent-order-item {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }
}

/* ============================
   Responsive - Extra Small (max-width: 360px)
   ============================ */
@media (max-width: 360px) {
    .order-tracking-modal .product-search-modal-content {
        padding: 15px 10px !important;
    }

    .ot-card {
        padding: 0.75rem;
    }

    .ot-item-title {
        max-width: 100px;
    }

    .ot-order-id {
        font-size: 0.8rem;
    }

    .ot-input-prefix[data-long]+input,
    .ot-input-wrapper input[type="tel"] {
        padding-left: 3.25rem !important;
    }

    .ot-input-prefix[data-long] {
        font-size: 0.8rem;
    }

    .tracking-type-btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.4rem;
    }
}