/* ─────────────────────────────────────────────────────────────────────────
   AI B2B Smart Search — v2.0 Frontend Styles
   Fullscreen Blinkit-style overlay | No GST toggle | Variable products
   ───────────────────────────────────────────────────────────────────────── */

/* ══ Body lock ═══════════════════════════════════════════════════════════ */
body.aib2b-no-scroll {
    overflow: hidden !important;
}

/* ══ Inline mic button (next to theme search bar) ════════════════════════ */
.aib2b-inline-mic {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: background 0.15s, color 0.15s;
    z-index: 10;
    line-height: 0;
}
.aib2b-inline-mic:hover { background: #f0f0f0; color: #1F3A5F; }
.aib2b-inline-mic.aib2b-mic-active {
    color: #e53935;
    background: #fff0f0;
    animation: aib2b-pulse 0.9s ease-in-out infinite;
}

/* ══ Fullscreen overlay ══════════════════════════════════════════════════ */
.aib2b-fs {
    position: fixed;
    inset: 0;
    background: #f8f9fb;
    z-index: 9999999;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    will-change: opacity, transform;
}
.aib2b-fs.aib2b-fs-open {
    opacity: 1;
    transform: translateY(0);
}
.aib2b-fs.aib2b-fs-close {
    opacity: 0;
    transform: translateY(8px);
}

/* ── Header bar ──────────────────────────────────────────────────────── */
.aib2b-fs-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #fff;
    border-bottom: 1px solid #e8ecf0;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 2;
}

.aib2b-fs-back {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #333;
    flex-shrink: 0;
    transition: background 0.15s;
    line-height: 0;
}
.aib2b-fs-back:hover { background: #f0f0f0; }

.aib2b-fs-input-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}
.aib2b-fs-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    display: inline-flex;
    pointer-events: none;
    line-height: 0;
}
.aib2b-fs-inp {
    width: 100%;
    border: 1.5px solid #dce0e8;
    border-radius: 8px;
    padding: 10px 82px 10px 38px;
    font-size: 15px;
    background: #f7f8fa;
    color: #1a1a2e;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}
.aib2b-fs-inp:focus {
    border-color: #1F3A5F;
    background: #fff;
}
.aib2b-fs-inp::-webkit-search-cancel-button { display: none; }

.aib2b-fs-clear,
.aib2b-fs-mic {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: background 0.15s, color 0.15s;
    line-height: 0;
}
.aib2b-fs-clear { right: 38px; }
.aib2b-fs-mic   { right: 8px; }
.aib2b-fs-clear:hover,
.aib2b-fs-mic:hover { background: #f0f0f0; }
.aib2b-fs-mic.aib2b-mic-active {
    color: #e53935;
    background: #fff0f0;
    animation: aib2b-pulse 0.9s ease-in-out infinite;
}

/* ── Body (scrollable) ───────────────────────────────────────────────── */
.aib2b-fs-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 20px;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}
.aib2b-fs-body::-webkit-scrollbar { width: 4px; }
.aib2b-fs-body::-webkit-scrollbar-track { background: transparent; }
.aib2b-fs-body::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

/* ── Section ─────────────────────────────────────────────────────────── */
.aib2b-fs-sec {
    padding: 14px 14px 6px;
}
.aib2b-fs-sec + .aib2b-fs-sec {
    border-top: 1px solid #eef0f3;
}
.aib2b-fs-sec-title {
    font-size: 11px;
    font-weight: 700;
    color: #9aa0ac;
    text-transform: uppercase;
    letter-spacing: .7px;
    margin-bottom: 10px;
}
.aib2b-fs-seasonal {
    background: linear-gradient(90deg,#fff8e1,#fffde7);
}

/* ── Loading ─────────────────────────────────────────────────────────── */
.aib2b-fs-loading {
    padding: 40px 20px;
    text-align: center;
    color: #888;
    font-size: 14px;
}

/* ── Spinner ─────────────────────────────────────────────────────────── */
.aib2b-spinner {
    display: inline-block;
    width: 16px; height: 16px;
    border: 2.5px solid #ddd;
    border-top-color: #1F3A5F;
    border-radius: 50%;
    animation: aib2b-spin .65s linear infinite;
    vertical-align: middle;
}

/* ══ Product grid (Blinkit 2-col) ════════════════════════════════════════ */
.aib2b-prod-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
@media (min-width: 600px) { .aib2b-prod-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .aib2b-prod-grid { grid-template-columns: repeat(4, 1fr); } }

/* ── Product card ─────────────────────────────────────────────────────── */
.aib2b-prod-card {
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.18s, transform 0.18s;
}
.aib2b-prod-card:hover {
    box-shadow: 0 4px 18px rgba(0,0,0,.10);
    transform: translateY(-1px);
}

/* Image wrapper */
.aib2b-prod-img-wrap {
    position: relative;
    display: block;
    background: #f7f8fa;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    flex-shrink: 0;
}
.aib2b-prod-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    box-sizing: border-box;
    transition: transform 0.22s;
}
.aib2b-prod-card:hover .aib2b-prod-img-wrap img { transform: scale(1.04); }

.aib2b-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    background: #f0f2f5;
    color: #ccc;
}

/* Stock badges on image */
.aib2b-badge-low {
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 9px;
    font-weight: 700;
    background: #ffe0dc;
    color: #c0392b;
    padding: 2px 6px;
    border-radius: 3px;
    animation: aib2b-blink 1.6s infinite;
    text-transform: uppercase;
    letter-spacing: .3px;
    white-space: nowrap;
}
.aib2b-badge-out {
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 9px;
    font-weight: 700;
    background: rgba(0,0,0,.55);
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: .3px;
}

/* Info area */
.aib2b-prod-info {
    flex: 1;
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.aib2b-prod-brand {
    font-size: 9px;
    font-weight: 700;
    color: #6a6af4;
    text-transform: uppercase;
    letter-spacing: .5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.aib2b-prod-name {
    font-size: 12px;
    font-weight: 600;
    color: #1a1a2e;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-decoration: none;
}
.aib2b-prod-name:hover { color: #1F3A5F; text-decoration: underline; }

.aib2b-prod-sku {
    font-size: 9px;
    color: #999;
    font-family: monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Variation chips */
.aib2b-var-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 2px 0;
}
.aib2b-var-chip {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 7px;
    border: 1px solid #d0d5dd;
    border-radius: 4px;
    background: #fff;
    color: #444;
    cursor: pointer;
    transition: all 0.12s;
    white-space: nowrap;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.aib2b-var-chip.active {
    background: #1F3A5F;
    border-color: #1F3A5F;
    color: #fff;
}
.aib2b-var-chip:hover:not(.active) {
    border-color: #1F3A5F;
    color: #1F3A5F;
}
.aib2b-var-oos { color: #e53935; font-size: 8px; }
.aib2b-var-more {
    font-size: 9px;
    color: #6a6af4;
    text-decoration: none;
    padding: 2px 6px;
    border: 1px solid #c8c8f8;
    border-radius: 4px;
    white-space: nowrap;
}
.aib2b-var-more:hover { background: #f0f0ff; }

/* Price */
.aib2b-prod-price {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    display: flex;
    align-items: baseline;
    gap: 5px;
    flex-wrap: wrap;
}
.aib2b-sale-price {
    font-size: 14px;
    font-weight: 700;
    color: #c0392b;
}
.aib2b-reg-price {
    font-size: 11px;
    font-weight: 400;
    color: #aaa;
    text-decoration: line-through;
}
.aib2b-login-for-price {
    font-size: 10px;
    color: #6a6af4;
    font-weight: 600;
    font-style: italic;
}

/* MOQ / Step tag */
.aib2b-moq-tag {
    font-size: 9px;
    font-weight: 600;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #f0e080;
    border-radius: 3px;
    padding: 2px 5px;
    display: inline-block;
    white-space: nowrap;
}

/* Actions */
.aib2b-prod-actions {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Qty control */
.aib2b-qty-ctrl {
    display: flex;
    align-items: center;
    border: 1.5px solid #1F3A5F;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}
.aib2b-qty-minus,
.aib2b-qty-plus {
    background: #fff;
    border: none;
    width: 26px;
    height: 26px;
    font-size: 16px;
    font-weight: 700;
    color: #1F3A5F;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}
.aib2b-qty-minus:hover,
.aib2b-qty-plus:hover { background: #eaf0f8; }
.aib2b-qty-minus:disabled,
.aib2b-qty-plus:disabled { color: #bbb; cursor: default; }

.aib2b-qty-inp {
    width: 36px;
    text-align: center;
    border: none;
    border-left: 1px solid #dce4ef;
    border-right: 1px solid #dce4ef;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
    background: #fff;
    padding: 0;
    height: 26px;
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
}
.aib2b-qty-inp::-webkit-inner-spin-button,
.aib2b-qty-inp::-webkit-outer-spin-button { -webkit-appearance: none; }
.aib2b-qty-inp:disabled { background: #f5f5f5; color: #bbb; }

/* Add to cart button */
.aib2b-add-btn {
    flex: 1;
    background: #1F3A5F;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0 10px;
    height: 28px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: background 0.15s, transform 0.1s;
    white-space: nowrap;
}
.aib2b-add-btn:hover:not(:disabled) { background: #162d4a; transform: translateY(-1px); }
.aib2b-add-btn:disabled { background: #ccc; cursor: not-allowed; }
.aib2b-add-btn.aib2b-adding { background: #3a5f8f; }

/* View button (logged out) */
.aib2b-view-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    border: 1.5px solid #1F3A5F;
    border-radius: 6px;
    color: #1F3A5F;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
    padding: 0 10px;
    white-space: nowrap;
}
.aib2b-view-btn:hover { background: #1F3A5F; color: #fff; }

/* ══ Category tile grid (home screen) ════════════════════════════════════ */
.aib2b-fs-cat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
@media (min-width: 480px) { .aib2b-fs-cat-grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 700px) { .aib2b-fs-cat-grid { grid-template-columns: repeat(7, 1fr); } }

.aib2b-cat-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    padding: 8px 4px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e8ecf0;
    transition: box-shadow 0.15s, transform 0.15s;
    cursor: pointer;
    text-align: center;
    overflow: hidden;
}
.aib2b-cat-tile:hover {
    box-shadow: 0 3px 12px rgba(0,0,0,.10);
    transform: translateY(-2px);
}
.aib2b-cat-tile img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 6px;
}
.aib2b-cat-tile span {
    font-size: 9px;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    hyphens: auto;
}
.aib2b-cat-emoji {
    font-size: 28px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f2f5;
    border-radius: 6px;
}

/* ── Category chips (in search results) ─────────────────────────────── */
.aib2b-fs-cat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 2px 0;
}
.aib2b-cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    background: #fff;
    border: 1px solid #dce0e8;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #1a1a2e;
    text-decoration: none;
    transition: all 0.15s;
}
.aib2b-cat-chip em {
    font-style: normal;
    font-size: 10px;
    color: #aaa;
    font-weight: 400;
}
.aib2b-cat-chip:hover {
    background: #1F3A5F;
    border-color: #1F3A5F;
    color: #fff;
}
.aib2b-cat-chip:hover em { color: rgba(255,255,255,.7); }

/* ══ Trending chips ══════════════════════════════════════════════════════ */
.aib2b-fs-trend-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.aib2b-trend-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}
.aib2b-trend-chip span {
    font-size: 10px;
    color: #e53935;
    font-weight: 700;
}
.aib2b-trend-chip:hover {
    background: #fff3e0;
    border-color: #ffb74d;
    color: #e65100;
}

/* ══ Suggestions ═════════════════════════════════════════════════════════ */
.aib2b-fs-sug {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    color: #1a1a2e;
    border-radius: 6px;
    transition: background 0.12s;
    user-select: none;
}
.aib2b-fs-sug:hover { background: #f0f4ff; }
.aib2b-fs-sug svg { color: #aaa; flex-shrink: 0; }

/* ══ Highlight ═══════════════════════════════════════════════════════════ */
mark {
    background: #fff3a3;
    color: inherit;
    font-weight: 700;
    border-radius: 2px;
    padding: 0 1px;
}

/* ══ View all ════════════════════════════════════════════════════════════ */
.aib2b-fs-view-all {
    padding: 16px 14px 4px;
    text-align: center;
}
.aib2b-fs-view-all a {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    color: #1F3A5F;
    text-decoration: none;
    padding: 10px 24px;
    border: 1.5px solid #1F3A5F;
    border-radius: 6px;
    transition: all 0.15s;
}
.aib2b-fs-view-all a:hover {
    background: #1F3A5F;
    color: #fff;
}

/* ══ Empty state ═════════════════════════════════════════════════════════ */
.aib2b-fs-empty {
    padding: 50px 20px;
    text-align: center;
    color: #555;
}
.aib2b-fs-empty-icon { font-size: 44px; margin-bottom: 12px; }
.aib2b-fs-empty p { margin: 4px 0; font-size: 14px; }
.aib2b-fs-empty-hint { font-size: 12px; color: #999; }

/* ══ Toast notification ══════════════════════════════════════════════════ */
.aib2b-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(26,26,46,.92);
    color: #fff;
    padding: 10px 22px;
    border-radius: 6px;
    z-index: 99999999;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    box-shadow: 0 4px 16px rgba(0,0,0,.22);
    pointer-events: none;
    white-space: nowrap;
    transition: opacity .28s;
}
.aib2b-toast-out { opacity: 0; }

/* ══ Shop loop B2B badges ════════════════════════════════════════════════ */
.aib2b-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 5px 0;
}
.aib2b-badge-sku {
    font-size: 9px;
    font-family: monospace;
    background: #f0f0f0;
    color: #555;
    padding: 2px 6px;
    border-radius: 3px;
}
.aib2b-badge-moq {
    font-size: 9px;
    font-weight: 700;
    background: #fff3cd;
    color: #856404;
    padding: 2px 6px;
    border-radius: 3px;
}

/* ══ MOQ notice on product page ══════════════════════════════════════════ */
.aib2b-moq-note {
    font-size: 12px;
    background: #fff3cd;
    color: #856404;
    border-radius: 5px;
    padding: 6px 12px;
    display: inline-block;
    margin-top: 6px;
    border: 1px solid #f0d060;
}

/* ══ Animations ══════════════════════════════════════════════════════════ */
@keyframes aib2b-spin  { to { transform: rotate(360deg); } }
@keyframes aib2b-pulse {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50%       { transform: translateY(-50%) scale(1.25); }
}
@keyframes aib2b-blink { 0%,100%{opacity:1} 50%{opacity:.55} }

/* ══ Responsive ══════════════════════════════════════════════════════════ */
@media (max-width: 380px) {
    .aib2b-prod-grid { grid-template-columns: repeat(2, 1fr); gap: 7px; }
    .aib2b-fs-cat-grid { grid-template-columns: repeat(3, 1fr); }
    .aib2b-prod-info { padding: 6px 7px 8px; }
    .aib2b-prod-name { font-size: 11px; }
    .aib2b-add-btn  { font-size: 11px; padding: 0 6px; }
    .aib2b-qty-inp  { width: 28px; font-size: 12px; }
    .aib2b-qty-minus,
    .aib2b-qty-plus { width: 22px; height: 26px; font-size: 14px; }
}
