/* ============================================================
   FAKE SALE v3.0.0 – TechDaffy.com
   All frontend styles: Popup, Bulk Discount, Timer, Social Proof
   ============================================================ */

/* ============================================================
   1. POPUP NOTIFICATION
   ============================================================ */
#fs-popup {
    position: fixed;
    z-index: 999999;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.10);
    padding: 14px 18px 14px 14px;
    display: flex;
    align-items: center;
    gap: 13px;
    max-width: 320px;
    min-width: 260px;
    width: calc(100vw - 32px);
    box-sizing: border-box;
    border: 1px solid rgba(0,0,0,.06);
    animation: fs-pop-in .42s cubic-bezier(.34,1.56,.64,1) forwards;
}

#fs-popup.fs-pos-bottom-left  { bottom: 20px; left: 20px; }
#fs-popup.fs-pos-bottom-right { bottom: 20px; right: 20px; }
#fs-popup.fs-pos-top-left     { top: 80px;    left: 20px; }
#fs-popup.fs-pos-top-right    { top: 80px;    right: 20px; }

@keyframes fs-pop-in {
    from { opacity:0; transform:translateY(30px) scale(.92); }
    to   { opacity:1; transform:translateY(0)    scale(1);   }
}
@keyframes fs-pop-out {
    from { opacity:1; transform:translateY(0)    scale(1);   }
    to   { opacity:0; transform:translateY(30px) scale(.92); }
}
#fs-popup.fs-hiding { animation: fs-pop-out .35s ease forwards; }

.fs-popup-badge {
    position: absolute;
    top: -10px;
    right: 44px;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: .5px;
    box-shadow: 0 2px 6px rgba(231,76,60,.4);
    white-space: nowrap;
}

.fs-popup-img {
    width: 64px;
    height: 64px;
    min-width: 64px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid #f0f0f0;
    background: #f8f8f8;
}

.fs-popup-body { flex:1; overflow:hidden; }

.fs-popup-name {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fs-popup-product {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.fs-popup-time {
    font-size: 11px;
    color: #27ae60;
    margin-top: 4px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.fs-popup-time::before {
    content: '';
    width: 7px;
    height: 7px;
    background: #27ae60;
    border-radius: 50%;
    display: inline-block;
    animation: fs-pulse 1.5s infinite;
}

.fs-popup-close {
    position: absolute;
    top: 7px;
    right: 9px;
    background: none;
    border: none;
    font-size: 17px;
    cursor: pointer;
    color: #c0c0c0;
    padding: 2px 5px;
    border-radius: 50%;
    line-height: 1;
    transition: color .2s, background .2s;
}
.fs-popup-close:hover { color: #555; background: #f5f5f5; }

.fs-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg,#2271b1,#27ae60);
    border-radius: 0 0 16px 16px;
    width: 100%;
    transition: width linear;
}

@keyframes fs-pulse {
    0%,100% { opacity:1; transform:scale(1); }
    50%      { opacity:.5; transform:scale(1.3); }
}

/* ============================================================
   2. BULK DISCOUNT TABLE
   ============================================================ */
.fs-bulk-table {
    border: 1px solid #eaeaea;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 3px 14px rgba(0,0,0,.07);
    font-family: inherit;
}

.fs-bulk-heading {
    background: linear-gradient(135deg,#667eea,#764ba2);
    color: #fff;
    padding: 13px 18px;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: .3px;
}

.fs-bulk-icon { font-size: 17px; }

.fs-bulk-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    border-bottom: 1px solid #f3f3f3;
    transition: background .18s;
}
.fs-bulk-row:last-child { border-bottom: none; }
.fs-bulk-row:hover { background: #fafafa; }
.fs-bulk-row.fs-tier-active {
    background: #f0fff5;
    border-left: 3px solid #27ae60;
}

.fs-bulk-qty { text-align:center; min-width:52px; }
.fs-bulk-qty-num { display:block; font-size:22px; font-weight:800; color:#1a1a1a; line-height:1; }
.fs-bulk-qty-label { display:block; font-size:10px; color:#aaa; text-transform:uppercase; letter-spacing:.8px; margin-top:2px; }

.fs-bulk-arrow { color:#d0d0d0; font-size:20px; }

.fs-bulk-info { display:flex; align-items:center; gap:10px; flex:1; flex-wrap:wrap; }

.fs-bulk-save-badge {
    background: linear-gradient(135deg,#27ae60,#2ecc71);
    color: #fff;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(39,174,96,.3);
}

.fs-bulk-row.fs-tier-active .fs-bulk-save-badge {
    animation: fs-badge-glow 1.6s infinite;
}
@keyframes fs-badge-glow {
    0%,100% { box-shadow:0 2px 6px rgba(39,174,96,.3); }
    50%      { box-shadow:0 4px 14px rgba(39,174,96,.6); }
}

.fs-bulk-each { font-size:13px; color:#555; font-weight:500; }
.fs-bulk-each del { color:#bbb; font-size:12px; }

.fs-bulk-notice {
    background: #f8fff9;
    border-top: 1px solid #e8f5ea;
    padding: 9px 18px;
    font-size: 12px;
    color: #27ae60;
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 700;
}

.fs-bulk-notice-icon {
    width: 16px; height: 16px;
    background: #27ae60;
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 900;
    flex-shrink: 0;
}

/* ============================================================
   3. LIMITED TIME OFFER TIMER
   ============================================================ */
.fs-timer-wrap {
    background: #1a1a2e;
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,.18);
    overflow: hidden;
    position: relative;
}

/* Animated shimmer strip */
.fs-timer-wrap::before {
    content: '';
    position: absolute;
    top: 0; left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg,transparent,rgba(255,255,255,.05),transparent);
    animation: fs-shimmer 3s infinite;
}
@keyframes fs-shimmer {
    0%   { left:-60%; }
    100% { left:140%; }
}

.fs-timer-label {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .5px;
    text-align: center;
    opacity: .92;
}

.fs-timer-digits {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.fs-timer-block { display:flex; flex-direction:column; align-items:center; gap:4px; }

.fs-timer-num {
    display: block;
    background: #e74c3c;
    color: #fff;
    font-size: 28px;
    font-weight: 900;
    min-width: 58px;
    text-align: center;
    border-radius: 10px;
    padding: 8px 6px;
    letter-spacing: 2px;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 4px 12px rgba(0,0,0,.3);
    position: relative;
    overflow: hidden;
}

/* Digit flip highlight */
.fs-timer-num.fs-flip { animation: fs-flip .25s ease; }
@keyframes fs-flip {
    0%   { transform:rotateX(0); }
    50%  { transform:rotateX(-15deg) scale(.97); }
    100% { transform:rotateX(0); }
}

.fs-timer-unit {
    font-size: 10px;
    color: rgba(255,255,255,.6);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 600;
}

.fs-timer-sep {
    font-size: 26px;
    font-weight: 900;
    color: #e74c3c;
    margin-bottom: 14px;
    opacity: .8;
}

/* Urgency blink when < 1 hour */
.fs-timer-urgent .fs-timer-num { animation: fs-urgent-blink 1s infinite; }
@keyframes fs-urgent-blink {
    0%,100% { box-shadow:0 4px 12px rgba(231,76,60,.4); }
    50%      { box-shadow:0 4px 20px rgba(231,76,60,.9); }
}

/* ============================================================
   4. SOCIAL PROOF
   ============================================================ */
.fs-social-proof {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #e74c3c;
    padding: 8px 14px;
    background: linear-gradient(135deg,rgba(231,76,60,.08),rgba(255,107,0,.06));
    border-left: 3px solid currentColor;
    border-radius: 6px;
    animation: fs-social-fade-in .5s ease;
}

@keyframes fs-social-fade-in {
    from { opacity:0; transform:translateY(-6px); }
    to   { opacity:1; transform:translateY(0);    }
}

.fs-social-fire { font-size:16px; animation: fs-fire 1.2s infinite; }
@keyframes fs-fire {
    0%,100% { transform:scale(1) rotate(-3deg); }
    50%      { transform:scale(1.2) rotate(3deg); }
}

.fs-social-text { flex:1; }

/* ============================================================
   5. RESPONSIVE
   ============================================================ */
@media (max-width: 480px) {
    /* Popup */
    #fs-popup { max-width:calc(100vw - 24px); min-width:0; padding:12px 14px 12px 12px; }
    #fs-popup.fs-pos-bottom-left,
    #fs-popup.fs-pos-bottom-right { bottom:12px; left:12px; right:12px; }
    #fs-popup.fs-pos-top-left,
    #fs-popup.fs-pos-top-right    { top:12px;   left:12px; right:12px; }
    .fs-popup-img { width:52px; height:52px; min-width:52px; }
    .fs-popup-name { font-size:13px; }
    .fs-popup-product { font-size:11px; }

    /* Bulk */
    .fs-bulk-row { padding:10px 14px; gap:10px; }
    .fs-bulk-qty-num { font-size:18px; }
    .fs-bulk-each { font-size:12px; }
    .fs-bulk-heading { padding:11px 14px; font-size:13px; }
    .fs-bulk-save-badge { padding:4px 10px; font-size:11px; }

    /* Timer */
    .fs-timer-wrap { padding:14px 14px; }
    .fs-timer-num  { font-size:22px; min-width:46px; padding:6px 4px; border-radius:8px; }
    .fs-timer-sep  { font-size:20px; }
    .fs-timer-label { font-size:12px; }
    .fs-timer-digits { gap:5px; }

    /* Social */
    .fs-social-proof { font-size:12px; padding:7px 12px; }
}

@media (max-width: 360px) {
    .fs-bulk-row { flex-wrap:wrap; }
    .fs-bulk-arrow { display:none; }
    .fs-timer-num { font-size:18px; min-width:40px; }
    .fs-timer-sep { font-size:16px; margin-bottom:12px; }
}

/* ============================================================
   6. MOBILE – after short-description placement
   These blocks are moved by JS on mobile. Ensure they display
   correctly regardless of where they land in the DOM.
   ============================================================ */
@media (max-width: 768px) {
    /* Make sure blocks are never hidden inside sticky cart zones */
    .fs-bulk-table,
    .fs-timer-wrap,
    .fs-social-proof {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: static !important;
        z-index: auto !important;
        pointer-events: auto !important;
    }

    /* Ensure they sit within the flow, not overlapped by sticky bar */
    .fs-bulk-table   { clear: both; }
    .fs-timer-wrap   { clear: both; }
    .fs-social-proof { clear: both; }

    /* After short-description spacing */
    .woocommerce-product-details__short-description + .fs-bulk-table,
    .short-description + .fs-bulk-table,
    .woocommerce-product-details__short-description + .fs-timer-wrap,
    .short-description + .fs-timer-wrap,
    .woocommerce-product-details__short-description + .fs-social-proof,
    .short-description + .fs-social-proof {
        margin-top: 14px;
    }

    /* Compact timer on mobile */
    .fs-timer-wrap {
        border-radius: 10px;
        padding: 12px 14px;
    }

    /* Social proof compact */
    .fs-social-proof {
        font-size: 12px;
        padding: 8px 12px;
    }

    /* Bulk table full width */
    .fs-bulk-table {
        width: 100%;
        box-sizing: border-box;
    }
}
