/* ==========================================================================
   FLOATING CUSTOMER SUPPORT & INSTANT ORDER TRACKER
   Luxe & Modern Tech UI, Dark/Light Mode Compatible, Glassmorphism, Micro-animations
   ========================================================================== */

/* Launcher Button */
.floating-support-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1040;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #ffffff;
    border: none;
    border-radius: 9999px;
    box-shadow: 0 8px 24px -4px rgba(79, 70, 229, 0.45), 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-support-launcher:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 28px -4px rgba(79, 70, 229, 0.55), 0 6px 16px rgba(0, 0, 0, 0.15);
}

.floating-support-launcher:active {
    transform: translateY(-1px) scale(0.98);
}

.support-launcher-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.support-launcher-ping {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 2px #ffffff;
    animation: supportPing 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes supportPing {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.support-launcher-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.2;
}

.support-launcher-title {
    font-size: 0.88rem;
    font-weight: 700;
}

.support-launcher-sub {
    font-size: 0.72rem;
    font-weight: 500;
    opacity: 0.85;
}

/* Floating Drawer Window */
.floating-support-drawer {
    position: fixed;
    bottom: 84px;
    right: 24px;
    z-index: 1045;
    width: 440px;
    max-width: calc(100vw - 32px);
    height: 640px;
    max-height: calc(100vh - 110px);
    background: var(--bg-surface, #ffffff);
    color: var(--text-primary, #0f172a);
    border-radius: 20px;
    box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px var(--border-subtle, #e2e8f0);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.96);
    transform-origin: bottom right;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
}

.floating-support-drawer.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Drawer Header */
.fsd-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.fsd-header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fsd-avatar-badge {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.fsd-header-info h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
}

.fsd-header-info p {
    margin: 2px 0 0 0;
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    gap: 6px;
}

.fsd-online-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
}

.fsd-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.2s ease;
}

.fsd-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Segmented Tabs */
.fsd-tabs-nav {
    display: flex;
    padding: 8px 12px;
    background: var(--bg-surface-raised, #f8fafc);
    border-bottom: 1px solid var(--border-subtle, #e2e8f0);
    gap: 6px;
}

.fsd-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary, #64748b);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fsd-tab-btn:hover {
    color: var(--text-primary, #0f172a);
    background: rgba(0, 0, 0, 0.04);
}

.fsd-tab-btn.active {
    background: var(--bg-surface, #ffffff);
    color: var(--accent-primary, #4f46e5);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Drawer Content Body */
.fsd-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 20px;
    position: relative;
}

.fsd-tab-pane {
    display: none;
    animation: fsdFadeIn 0.2s ease;
}

.fsd-tab-pane.active {
    display: block;
}

@keyframes fsdFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Form Styles inside Drawer */
.fsd-form-group {
    margin-bottom: 14px;
}

.fsd-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary, #475569);
    margin-bottom: 6px;
}

.fsd-input, .fsd-select, .fsd-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    background: var(--bg-surface-raised, #f8fafc);
    border: 1px solid var(--border-medium, #cbd5e1);
    color: var(--text-primary, #0f172a);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.88rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fsd-input:focus, .fsd-select:focus, .fsd-textarea:focus {
    outline: none;
    background: var(--bg-surface, #ffffff);
    border-color: var(--accent-primary, #4f46e5);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.fsd-btn-submit {
    width: 100%;
    padding: 11px 16px;
    background: var(--accent-gradient, linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%));
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fsd-btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

.fsd-btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* Recent Orders Quick Pills */
.fsd-recent-orders-box {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--border-subtle, #e2e8f0);
}

.fsd-recent-title {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 8px;
}

.fsd-order-chips {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.fsd-order-chip {
    padding: 5px 10px;
    background: var(--bg-surface-raised, #f1f5f9);
    border: 1px solid var(--border-subtle, #e2e8f0);
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 600;
    font-family: monospace;
    color: var(--accent-primary, #4f46e5);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.fsd-order-chip:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
}

/* Tracking Result Card */
.fsd-track-result {
    margin-top: 18px;
    background: var(--bg-surface-raised, #f8fafc);
    border: 1px solid var(--border-subtle, #e2e8f0);
    border-radius: 14px;
    padding: 16px;
}

.fsd-track-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.fsd-track-num {
    font-family: monospace;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    margin: 0;
}

.fsd-track-date {
    font-size: 0.75rem;
    color: var(--text-muted, #94a3b8);
    margin-top: 2px;
}

.fsd-status-pill {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Stepper Timeline */
.fsd-stepper-wrap {
    overflow-x: auto;
    padding: 6px 0 10px 0;
    margin: 14px 0;
    -webkit-overflow-scrolling: touch;
}

.fsd-stepper {
    display: flex;
    justify-content: space-between;
    position: relative;
    min-width: 100%;
    margin: 10px 0;
}

.fsd-stepper::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    height: 3px;
    background: var(--border-subtle, #e2e8f0);
    z-index: 1;
}

.fsd-stepper-progress {
    position: absolute;
    top: 14px;
    left: 14px;
    height: 3px;
    background: #10b981;
    z-index: 2;
    transition: width 0.4s ease;
}

.fsd-step-item {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1 1 0;
    min-width: 58px;
    padding: 0 4px;
}

.fsd-step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-surface, #ffffff);
    border: 2px solid var(--border-medium, #cbd5e1);
    color: var(--text-muted, #94a3b8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.fsd-step-item.completed .fsd-step-dot {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
}

.fsd-step-item.active .fsd-step-dot {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2);
}

.fsd-step-label {
    margin-top: 6px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted, #94a3b8);
    line-height: 1.1;
}

.fsd-step-item.active .fsd-step-label,
.fsd-step-item.completed .fsd-step-label {
    color: var(--text-primary, #0f172a);
}

/* Delivery Milestones Timeline */
.fsd-milestones {
    border-left: 2px solid var(--border-subtle, #e2e8f0);
    margin: 14px 0 14px 8px;
    padding-left: 14px;
}

.fsd-milestone-item {
    position: relative;
    margin-bottom: 12px;
}

.fsd-milestone-item:last-child {
    margin-bottom: 0;
}

.fsd-milestone-dot {
    position: absolute;
    left: -19px;
    top: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-primary, #4f46e5);
}

.fsd-milestone-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary, #0f172a);
}

.fsd-milestone-desc {
    font-size: 0.74rem;
    color: var(--text-secondary, #64748b);
}

.fsd-milestone-time {
    font-size: 0.68rem;
    color: var(--text-muted, #94a3b8);
}

/* Items Preview inside result */
.fsd-items-preview {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle, #e2e8f0);
}

.fsd-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.fsd-item-thumb {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid var(--border-subtle, #e2e8f0);
    object-fit: cover;
}

.fsd-item-info {
    flex: 1;
    font-size: 0.78rem;
    line-height: 1.2;
}

.fsd-item-name {
    font-weight: 600;
    color: var(--text-primary, #0f172a);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

.fsd-item-meta {
    font-size: 0.72rem;
    color: var(--text-muted, #94a3b8);
}

/* Tab 2: Channels Quick Grid */
.fsd-channels-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
}

.fsd-channel-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.fsd-channel-card.whatsapp {
    background: #dcfce7;
    color: #15803d;
    border-color: #bbf7d0;
}

.fsd-channel-card.whatsapp:hover {
    background: #bbf7d0;
    transform: translateY(-2px);
}

.fsd-channel-card.hotline {
    background: #e0f2fe;
    color: #0369a1;
    border-color: #bae6fd;
}

.fsd-channel-card.hotline:hover {
    background: #bae6fd;
    transform: translateY(-2px);
}

.fsd-channel-icon {
    font-size: 1.4rem;
}

.fsd-channel-text strong {
    display: block;
    font-size: 0.84rem;
    font-weight: 700;
}

.fsd-channel-text small {
    font-size: 0.72rem;
    opacity: 0.85;
}

/* Tab 3: FAQ Accordion */
.fsd-faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fsd-faq-item {
    border: 1px solid var(--border-subtle, #e2e8f0);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-surface, #ffffff);
}

.fsd-faq-question {
    width: 100%;
    padding: 12px 14px;
    background: transparent;
    border: none;
    text-align: left;
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-primary, #0f172a);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.fsd-faq-question:hover {
    color: var(--accent-primary, #4f46e5);
}

.fsd-faq-caret {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
    color: var(--text-muted, #94a3b8);
}

.fsd-faq-item.active .fsd-faq-caret {
    transform: rotate(180deg);
}

.fsd-faq-answer {
    padding: 0 14px 12px 14px;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-secondary, #475569);
    display: none;
}

.fsd-faq-item.active .fsd-faq-answer {
    display: block;
}

/* Full Page Tracker Styles */
.track-page-wrapper {
    max-width: 960px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: var(--font-family, inherit);
}

.track-hero {
    text-align: center;
    margin-bottom: 36px;
}

.track-hero h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary, #0f172a);
    margin: 0 0 10px 0;
}

.track-hero p {
    font-size: 1.05rem;
    color: var(--text-secondary, #64748b);
    max-width: 580px;
    margin: 0 auto;
}

.track-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-subtle, #e2e8f0);
    border-radius: 18px;
    padding: 28px;
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0,0,0,0.1));
    margin-bottom: 24px;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .floating-support-launcher {
        bottom: 16px;
        right: 16px;
        padding: 10px 14px;
    }
    .support-launcher-sub {
        display: none;
    }
    .floating-support-drawer {
        bottom: 74px;
        right: 12px;
        left: 12px;
        width: auto;
        max-width: none;
        height: 560px;
    }
    .fsd-channels-grid {
        grid-template-columns: 1fr;
    }
}
