/*
 * ═══════════════════════════════════════════════════════════════
 * NANOSOFT — Footer Extra Styles (Phase 2 Step 4 Extract)
 * ═══════════════════════════════════════════════════════════════
 * Extracted from _footer.php (was 3 multi-line <style> blocks, ~17 KB)
 * Now cached by browser for 30 days (.htaccess rule).
 *
 * Contains:
 *   1. View toggle styles (Top Deals Grid/List)
 *   2. V19 mega menu styling
 *   3. FAB stack position override (Messenger/WhatsApp/Scroll-top)
 *
 * Keep ALL original comments and formatting (not minified).
 * DO NOT minify - source readability preserved.
 * ═══════════════════════════════════════════════════════════════
 */


/* ─────────────────────────────────────────────────────────────
   1. #view-toggle-styles (was lines 11426-11658)
   Top Deals Grid/List view toggle styles
   ───────────────────────────────────────────────────────────── */
/* ============================================ */
/* Top Deals - Beautiful Grid/List View Toggle */
/* ============================================ */

/* List view container - flexbox not grid for better control */
.product-grid[data-view="list"],
.fs-products[data-view="list"] .product-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    grid-template-columns: none !important;
}

/* List view card - horizontal layout */
.product-grid[data-view="list"] .p-card,
.fs-products[data-view="list"] .p-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 14px !important;
    gap: 18px !important;
    background: var(--bg-card, #fff) !important;
    border: 1px solid var(--border, #e8e8e8) !important;
    border-radius: 12px !important;
    transition: all 0.25s ease !important;
    position: relative !important;
    overflow: hidden !important;
}

.product-grid[data-view="list"] .p-card:hover,
.fs-products[data-view="list"] .p-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08) !important;
    border-color: var(--primary, #ff6a00) !important;
}

/* Image: fixed size, square, left side */
.product-grid[data-view="list"] .p-card-img,
.fs-products[data-view="list"] .p-card-img {
    flex: 0 0 160px !important;
    width: 160px !important;
    height: 160px !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    background: var(--bg-soft, #fafafa) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
}

.product-grid[data-view="list"] .p-card-img img,
.fs-products[data-view="list"] .p-card-img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    padding: 8px !important;
}

/* Body: flexible, takes remaining space */
.product-grid[data-view="list"] .p-card-body,
.fs-products[data-view="list"] .p-card-body {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    padding: 4px 0 !important;
    gap: 8px !important;
    min-width: 0 !important;
}

/* Product title - bigger in list view */
.product-grid[data-view="list"] .p-card-body h3,
.product-grid[data-view="list"] .p-card-body h4,
.product-grid[data-view="list"] .p-card-body .p-name,
.fs-products[data-view="list"] .p-card-body h3,
.fs-products[data-view="list"] .p-card-body h4 {
    font-size: 16px !important;
    line-height: 1.4 !important;
    margin: 0 0 4px 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    color: var(--text, #1f1f1f) !important;
    font-weight: 600 !important;
}

/* Price section - bigger in list view */
.product-grid[data-view="list"] .p-card .p-price,
.product-grid[data-view="list"] .p-card [class*="price"],
.fs-products[data-view="list"] .p-card [class*="price"] {
    font-size: 18px !important;
    font-weight: 700 !important;
}

/* Tags row */
.product-grid[data-view="list"] .p-card .p-tags,
.fs-products[data-view="list"] .p-card .p-tags {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin-top: 4px !important;
}

/* Action buttons - vertical stack on right side */
.product-grid[data-view="list"] .p-card .p-actions,
.fs-products[data-view="list"] .p-card .p-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    align-self: center !important;
    flex-shrink: 0 !important;
}

/* "Add to Cart" button - more prominent in list view */
.product-grid[data-view="list"] .p-card .add-cart-btn,
.product-grid[data-view="list"] .p-card button[class*="cart"],
.fs-products[data-view="list"] .p-card .add-cart-btn {
    padding: 8px 18px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
}

/* Discount badges - position properly */
.product-grid[data-view="list"] .p-card .p-badge,
.product-grid[data-view="list"] .p-card [class*="badge"],
.product-grid[data-view="list"] .p-card [class*="discount"],
.fs-products[data-view="list"] .p-card .p-badge {
    position: absolute !important;
    top: 8px !important;
    left: 8px !important;
    z-index: 2 !important;
}

/* Wishlist/Compare icon buttons in list view */
.product-grid[data-view="list"] .p-card .icon-btn,
.product-grid[data-view="list"] .p-card .heart-btn,
.fs-products[data-view="list"] .p-card .icon-btn {
    width: 32px !important;
    height: 32px !important;
}

/* Description visible in list view (hidden in grid) */
.product-grid[data-view="list"] .p-card .p-desc,
.product-grid[data-view="list"] .p-card .p-description,
.fs-products[data-view="list"] .p-card .p-desc {
    display: block !important;
    font-size: 13px !important;
    color: var(--text-muted, #666) !important;
    margin: 4px 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
}

/* Rating in list view */
.product-grid[data-view="list"] .p-card .p-rating,
.product-grid[data-view="list"] .p-card [class*="rating"],
.fs-products[data-view="list"] .p-card .p-rating {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    font-size: 13px !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .product-grid[data-view="list"] .p-card,
    .fs-products[data-view="list"] .p-card {
        padding: 10px !important;
        gap: 12px !important;
    }
    
    .product-grid[data-view="list"] .p-card-img,
    .fs-products[data-view="list"] .p-card-img {
        flex: 0 0 110px !important;
        width: 110px !important;
        height: 110px !important;
    }
    
    .product-grid[data-view="list"] .p-card-body h3,
    .product-grid[data-view="list"] .p-card-body h4,
    .fs-products[data-view="list"] .p-card-body h3 {
        font-size: 14px !important;
    }
    
    .product-grid[data-view="list"] .p-card [class*="price"],
    .fs-products[data-view="list"] .p-card [class*="price"] {
        font-size: 15px !important;
    }
    
    /* Hide description on mobile to save space */
    .product-grid[data-view="list"] .p-card .p-desc,
    .fs-products[data-view="list"] .p-card .p-desc {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .product-grid[data-view="list"] .p-card-img,
    .fs-products[data-view="list"] .p-card-img {
        flex: 0 0 90px !important;
        width: 90px !important;
        height: 90px !important;
    }
}

/* View toggle button - active state */
.fs-view-btn.active {
    background: var(--primary, #ff6a00) !important;
    color: #fff !important;
    border-color: var(--primary, #ff6a00) !important;
}

.fs-view-btn.active svg {
    stroke: #fff !important;
}

.fs-view-btn {
    transition: all 0.2s ease !important;
}

.fs-view-btn:hover {
    background: var(--bg-hover, #f0f0f0) !important;
}

/* ─────────────────────────────────────────────────────────────
   2. #v19-mega (was lines 11663-11964)
   V19 mega menu styling
   ───────────────────────────────────────────────────────────── */
/* Blue title (imogi OR base exists) */
.nss-nav-blue { color: #1a237e !important; font-weight: 600; }
.nss-nav-blue:hover { color: #283593 !important; }
.nss-nav-ico { font-size: 16px; vertical-align: middle; }
.nss-arrow { font-size: 9px; opacity: 0.7; margin-left: 2px; }

/* Mega wrapper */
.nss-nav-wrap { position: relative; height: 100%; }
.nss-nav-wrap > .nav-link { display: inline-flex; height: 100%; align-items: center; }

/* The dropdown */
.nss-mega {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #e8eaf6;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.15);
    z-index: 9999;
    display: flex;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .2s, visibility .2s, transform .2s;
    overflow: visible !important;
    min-height: 400px;
    min-width: 1080px !important;
    /* CRITICAL FIX: Prevent right side overflow */
    max-width: calc(100vw - 40px);
}

/* Smart positioning — if nav item is in right half, align right edge */
.nss-nav-wrap.nss-align-right .nss-mega {
    left: auto;
    right: 0;
}
.nss-nav-wrap:hover .nss-mega,
.nss-nav-wrap:focus-within .nss-mega { opacity: 1; visibility: visible; transform: translateY(0); }

/* Left sidebar — all bases */
.nss-mega-sidebar {
    width: 200px;
    background: #f7f9fc;
    border-right: 1px solid #e8eaf6;
    padding: 8px 0;
    flex-shrink: 0;
    max-height: 480px;
    overflow-y: auto;
}
.nss-mega-base {
    padding: 10px 16px;
    font-size: 13px;
    color: #1a1a2e;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 3px solid transparent;
    transition: all .15s;
}
.nss-mega-base:hover,
.nss-mega-base.active {
    background: #fff;
    color: #1a237e;
    border-left-color: #1a237e;
    font-weight: 600;
}
.nss-mega-base-t { flex: 1; }
.nss-mega-base-arrow {
    color: #999;
    font-size: 18px;
    line-height: 1;
    margin-left: 4px;
    transition: transform .2s ease, color .2s ease;
}
.nss-mega-base:hover .nss-mega-base-arrow,
.nss-mega-base.active .nss-mega-base-arrow {
    color: #1a237e;
    transform: translateX(3px);
}
.cat-sb-link .text { flex: 1; }
.cat-sb-link .arrow {
    color: #999 !important;
    font-size: 18px !important;
    line-height: 1;
    margin-left: 4px;
}
.cat-sb-item:hover .cat-sb-link .arrow {
    color: #1a237e !important;
    transform: translateX(3px);
}

/* Panels */
.nss-mega-panels { flex: 1; position: relative; }
.nss-mega-panel { display: none; padding: 18px 22px; }
.nss-mega-panel.active { display: block; }

/* Panel header */
.nss-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #1a237e;
    margin-bottom: 14px;
}
.nss-panel-title {
    font-size: 16px;
    font-weight: 800;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 8px;
}
.nss-see-all {
    color: #1a237e;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.nss-see-all:hover { text-decoration: underline; }

/* Panel body — split into main left + featured right */
.nss-panel-body {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 18px;
}
.nss-panel-body.nss-panel-body-noright {
    grid-template-columns: 1fr;
}

/* Left main with adaptive columns */
.nss-panel-left { display: grid; gap: 14px; }
.nss-panel-left.nss-cols-1 { grid-template-columns: 1fr; }
.nss-panel-left.nss-cols-2 { grid-template-columns: 1fr 1fr; }
.nss-panel-left.nss-cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.nss-panel-left.nss-cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

.nss-col { display: flex; flex-direction: column; gap: 2px; }

.nss-section-head {
    font-size: 11px;
    font-weight: 700;
    color: #1a237e;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: 6px 8px;
    background: #f0f4ff;
    border-radius: 4px;
    margin-bottom: 4px;
    margin-top: 6px;
}
.nss-section-head:first-child { margin-top: 0; }

.nss-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    font-size: 12.5px;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all .12s;
}
.nss-item:hover {
    background: #f0f4ff;
    color: #1a237e;
    padding-left: 11px;
}
.nss-item-ico { font-size: 14px; flex-shrink: 0; }
.nss-item-t { flex: 1; line-height: 1.3; }

/* Tag badges */
.nss-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .03em;
    margin-left: 4px;
    vertical-align: middle;
}
.nss-b-hot      { background: #1a237e; color: #fff; }
.nss-b-new      { background: #1565c0; color: #fff; }
.nss-b-best     { background: #f59e0b; color: #fff; }
.nss-b-featured { background: #6a1b9a; color: #fff; }

/* Right side - featured + notice */
.nss-panel-right {
    background: #fafbff;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.nss-feat-head {
    font-size: 12px;
    font-weight: 800;
    color: #d32f2f;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.nss-feat-list { display: flex; flex-direction: column; gap: 8px; }

.nss-fc {
    display: flex;
    gap: 8px;
    padding: 8px;
    background: #fff;
    border: 1px solid #e8eaf6;
    border-radius: 8px;
    text-decoration: none;
    color: #1a1a2e;
    transition: all .15s;
}
.nss-fc:hover {
    border-color: #1a237e;
    box-shadow: 0 4px 10px rgba(26,35,126,0.1);
    transform: translateY(-1px);
}
.nss-fc-img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: #f0f4ff;
}
.nss-fc-emoji {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    background: #f0f4ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}
.nss-fc-body { flex: 1; min-width: 0; }
.nss-fc-title {
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.3;
    color: #1a1a2e;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 3px;
}
.nss-fc-price {
    font-size: 12px;
    font-weight: 700;
    color: #d32f2f;
}
.nss-fc-price s { color: #999; font-weight: 400; margin-left: 4px; font-size: 10.5px; }

/* Notice box */
.nss-notice {
    display: block;
    background: linear-gradient(135deg, #1a237e, #3949ab);
    color: #fff;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    margin-top: auto;
    transition: transform .15s;
}
.nss-notice:hover { transform: scale(1.02); color: #fff; }
.nss-notice-ico { font-size: 22px; margin-bottom: 4px; }
.nss-notice-t { font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.nss-notice-d { font-size: 10.5px; opacity: 0.9; line-height: 1.3; }

/* Mobile responsive (Feature 7) */
@media (max-width: 1024px) {
    .nss-mega { display: none !important; }
}
@media (max-width: 768px) {
    .nss-mega { width: 100% !important; left: 0; right: 0; }
    .nss-mega-sidebar { width: 140px; }
    .nss-panel-body { grid-template-columns: 1fr; }
    .nss-panel-left.nss-cols-2,
    .nss-panel-left.nss-cols-3,
    .nss-panel-left.nss-cols-4 { grid-template-columns: 1fr; }
}

/* Cat sidebar flyout — uses same panel rendering */
.cat-sb-flyout .nss-panel-head { padding: 14px 18px 10px; margin: 0; border-bottom: 2px solid #1a237e; }
.cat-sb-flyout .nss-panel-body { padding: 0 18px 18px; }

/* ─────────────────────────────────────────────────────────────
   3. #sc-final-position-override (was lines 12159-12277)
   FAB stack (Messenger/WhatsApp/Scroll-top) position fix
   ───────────────────────────────────────────────────────────── */
  /* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
     Layout (TOP → BOTTOM):
     🔵 Messenger    (top of fab-stack)
     🟢 WhatsApp     (bottom of fab-stack)
     💬 Smart Chat N (between fab-stack & scroll-top)
     ⬆️ Scroll Top   (own position, very bottom)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
  
  /* fab-stack now holds ONLY Messenger + WhatsApp */
  body .fab-stack {
    gap: 10px !important;
  }
  
  /* All FABs uniform size */
  body .fab-stack .fab {
    width: 44px !important;
    height: 44px !important;
    margin: 0 !important;
  }
  
  /* Pull scroll-top OUT of fab-stack to its own bottom slot */
  body .fab-stack .fab.scroll-top,
  body button#scrollTop.fab.scroll-top {
    position: fixed !important;
    right: 16px !important;
    bottom: 80px !important;
    width: 44px !important;
    height: 44px !important;
    z-index: 8999 !important;
    margin: 0 !important;
  }
  
  /* Move fab-stack base UP so it floats above Smart Chat */
  body .fab-stack {
    bottom: 196px !important;
  }
  
  /* Smart Chat N — between scroll-top and fab-stack */
  body #sc-widget #sc-bubble,
  body button#sc-bubble {
    position: fixed !important;
    right: 16px !important;
    bottom: 138px !important;
    width: 44px !important;
    height: 44px !important;
    z-index: 9001 !important;
  }
  body #sc-widget #sc-bubble svg {
    width: 28px !important;
    height: 28px !important;
  }
  body #sc-widget #sc-window {
    bottom: 196px !important;
    right: 16px !important;
    z-index: 9002 !important;
  }
  
  /* ─── Desktop ≥769px ─── */
  @media (min-width: 769px) {
    body .fab-stack .fab {
      width: 48px !important;
      height: 48px !important;
    }
    body .fab-stack .fab.scroll-top,
    body button#scrollTop.fab.scroll-top {
      bottom: 24px !important;
      width: 48px !important;
      height: 48px !important;
    }
    body .fab-stack {
      bottom: 148px !important;
    }
    body #sc-widget #sc-bubble,
    body button#sc-bubble {
      bottom: 86px !important;
      width: 48px !important;
      height: 48px !important;
    }
    body #sc-widget #sc-bubble svg {
      width: 30px !important;
      height: 30px !important;
    }
    body #sc-widget #sc-window {
      bottom: 144px !important;
    }
  }
  
  /* ─── Small mobile ≤480px ─── */
  @media (max-width: 480px) {
    body .fab-stack {
      gap: 8px !important;
      bottom: 196px !important;
    }
    body .fab-stack .fab {
      width: 42px !important;
      height: 42px !important;
    }
    body .fab-stack .fab.scroll-top,
    body button#scrollTop.fab.scroll-top {
      bottom: 90px !important;
      width: 42px !important;
      height: 42px !important;
    }
    body #sc-widget #sc-bubble,
    body button#sc-bubble {
      width: 42px !important;
      height: 42px !important;
      bottom: 142px !important;
    }
    body #sc-widget #sc-bubble svg {
      width: 26px !important;
      height: 26px !important;
    }
    body #sc-widget #sc-window {
      bottom: 196px !important;
    }
  }
