/**
 * EC Fast Sales & Alternative Engine Styles
 * Version 1.1.0
 */

/* ============================================================
   1. Single Product Action Box
   ============================================================ */
.ec-fast-sales-product-box {
    margin-top: 18px;
    margin-bottom: 22px;
    padding: 16px 18px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    font-family: inherit;
    box-sizing: border-box;
}

.ec-fast-sales-product-box * {
    box-sizing: border-box;
}

.ec-fs-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.ec-fs-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #002b49;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 6px;
    line-height: 1.2;
}

.ec-fs-subtitle {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.ec-fs-pills {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ec-fs-btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.3;
    border-radius: 8px;
    border: 1.5px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    background: #ffffff;
    user-select: none;
    text-align: left;
    box-sizing: border-box;
}

.ec-fs-btn .ec-fs-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ec-fs-btn .ec-fs-text {
    flex-grow: 1;
}

.ec-fs-btn .ec-fs-arrow {
    margin-left: auto;
    font-size: 14px;
    opacity: 0.6;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.ec-fs-btn:hover .ec-fs-arrow {
    opacity: 1;
    transform: translateX(3px);
}

/* Stock Pill */
.ec-fs-btn.ec-pill-stock {
    background: #f0fdf4 !important;
    color: #166534 !important;
    border-color: #bbf7d0 !important;
}
.ec-fs-btn.ec-pill-stock:hover {
    background: #dcfce7 !important;
    border-color: #86efac !important;
    transform: translateY(-1.5px);
    box-shadow: 0 4px 10px rgba(22, 101, 52, 0.12);
}

/* Alternative Pill */
.ec-fs-btn.ec-pill-alt {
    background: #f5f3ff !important;
    color: #6d28d9 !important;
    border-color: #ddd6fe !important;
}
.ec-fs-btn.ec-pill-alt:hover {
    background: #ede9fe !important;
    border-color: #c4b5fd !important;
    transform: translateY(-1.5px);
    box-shadow: 0 4px 10px rgba(109, 40, 217, 0.15);
}

/* Priority / Out of Stock Alternative Pill */
.ec-fs-btn.ec-pill-priority {
    background: #fffbeb !important;
    color: #b45309 !important;
    border-color: #f59e0b !important;
    font-weight: 700;
}
.ec-fs-btn.ec-pill-priority:hover {
    background: #fef3c7 !important;
    border-color: #d97706 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(245, 158, 11, 0.25);
}

.ec-fs-urgent-tag {
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    display: inline-block;
    margin-left: 6px;
    animation: ec-pulse 2s infinite ease-in-out;
}

@keyframes ec-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(0.97); }
}

/* Trade Discount Pill */
.ec-fs-btn.ec-pill-discount {
    background: #f0f9ff !important;
    color: #0369a1 !important;
    border-color: #bae6fd !important;
}
.ec-fs-btn.ec-pill-discount:hover {
    background: #e0f2fe !important;
    border-color: #7dd3fc !important;
    transform: translateY(-1.5px);
    box-shadow: 0 4px 10px rgba(3, 105, 161, 0.12);
}


/* ============================================================
   2. Cart Page Bulk Quote Card
   ============================================================ */
.ec-fast-sales-cart-box {
    margin: 18px 0;
    padding: 16px 18px;
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.08);
    box-sizing: border-box;
}

.ec-btn-cart-quote {
    background: #15803d !important;
    color: #ffffff !important;
    font-size: 14.5px !important;
    font-weight: 700 !important;
    padding: 13px 18px !important;
    width: 100% !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 10px rgba(21, 128, 61, 0.25) !important;
}
.ec-btn-cart-quote:hover {
    background: #166534 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(21, 128, 61, 0.35) !important;
}

.ec-fs-cart-subtext {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #166534;
    font-weight: 600;
}


/* ============================================================
   3. Global Floating Pill Dock & Native WhatsApp Trigger
   ============================================================ */
.ec-fast-sales-dock {
    position: fixed;
    bottom: 20px;
    right: 18px;
    z-index: 99990;
    font-family: inherit;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.ec-dock-pills {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.14), 0 4px 8px -2px rgba(0, 0, 0, 0.06);
    margin-bottom: 8px;
}

.ec-dock-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 11px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    white-space: nowrap;
    background: #002b49 !important;
    color: #ffffff !important;
    box-sizing: border-box;
}

.ec-dock-btn svg {
    flex-shrink: 0;
}

.ec-dock-cart {
    background: #d97706 !important;
    border-color: #f59e0b !important;
}
.ec-dock-cart:hover {
    background: #b45309 !important;
    transform: translateX(-3px);
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.3);
}

.ec-dock-stock:hover {
    background: #047857 !important;
    border-color: #10b981 !important;
    transform: translateX(-3px);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.25);
}

.ec-dock-alt:hover {
    background: #5b21b6 !important;
    border-color: #8b5cf6 !important;
    transform: translateX(-3px);
    box-shadow: 0 4px 10px rgba(109, 40, 217, 0.25);
}

.ec-dock-discount:hover {
    background: #0369a1 !important;
    border-color: #38bdf8 !important;
    transform: translateX(-3px);
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.25);
}

.ec-dock-bom {
    background: #334155 !important;
    border-color: #64748b !important;
}
.ec-dock-bom:hover {
    background: #1e293b !important;
    transform: translateX(-3px);
    box-shadow: 0 4px 10px rgba(51, 65, 85, 0.25);
}

/* Native Master WhatsApp Bubble (Replaces QuadLayers Social Chat) */
.ec-dock-wa-master {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #25d366 !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.45);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    padding: 0;
}
.ec-dock-wa-master:hover {
    background: #20ba5a !important;
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 10px 22px rgba(37, 211, 102, 0.55);
}


/* ============================================================
   4. Rep Selection & Identity Modal
   ============================================================ */
.ec-rep-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    box-sizing: border-box;
}

.ec-rep-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.ec-rep-modal-card {
    position: relative;
    width: 90%;
    max-width: 460px;
    background: #ffffff;
    border-radius: 16px;
    padding: 24px 22px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    border: 1px solid #e2e8f0;
    z-index: 1;
    animation: ec-modal-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ec-modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.ec-rep-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: transparent !important;
    border: none !important;
    font-size: 24px;
    line-height: 1;
    color: #94a3b8 !important;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s ease;
}
.ec-rep-close:hover {
    color: #0f172a !important;
    background: #f1f5f9 !important;
}

.ec-rep-header h4 {
    margin: 0 0 6px 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.ec-rep-header p {
    margin: 0 0 16px 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
}

/* Customer Identity Micro-Fields */
.ec-rep-identity-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 14px;
    box-sizing: border-box;
}

.ec-rep-identity-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.ec-rep-input {
    width: 100%;
    padding: 8px 10px;
    font-size: 12.5px;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    outline: none;
    font-family: inherit;
    transition: border-color 0.15s ease;
    box-sizing: border-box;
}

.ec-rep-input:focus {
    border-color: #002b49;
}

.ec-rep-identity-hint {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-top: 5px;
}

/* BOM / Parts List Textarea */
.ec-rep-bom-section {
    margin-bottom: 14px;
}

.ec-rep-bom-section label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

.ec-rep-textarea {
    width: 100%;
    padding: 8px 10px;
    font-size: 12px;
    font-family: monospace;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    box-sizing: border-box;
    resize: vertical;
    outline: none;
    background: #ffffff;
}

.ec-rep-textarea:focus {
    border-color: #002b49;
}

.ec-rep-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ec-rep-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.ec-rep-item:hover {
    border-color: #25d366;
    background: #f0fdf4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.15);
}

.ec-rep-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #002b49;
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ec-rep-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.ec-rep-info strong {
    font-size: 14px;
    color: #0f172a;
    font-weight: 700;
}

.ec-rep-info span {
    font-size: 12px;
    color: #64748b;
}

.ec-rep-wa-icon {
    font-size: 18px;
    flex-shrink: 0;
}

/* ============================================================
   5. Mobile Responsiveness
   ============================================================ */
@media (max-width: 768px) {
    /* On mobile single product page, hide the pill stack but keep the native WhatsApp bubble! */
    body.single-product .ec-dock-pills {
        display: none !important;
    }

    .ec-fast-sales-dock {
        bottom: 16px;
        right: 14px;
    }

    .ec-dock-wa-master {
        width: 52px;
        height: 52px;
    }

    .ec-rep-identity-fields {
        grid-template-columns: 1fr;
    }
}
