/* =====================================================
   Biottek Product Grid Widget — Styles
   assets/product-grid.css
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

.bk-grid-wrapper {
    font-family: 'Plus Jakarta Sans', sans-serif;
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden; /* prevent cards bleeding outside */
}

/* ── Filter bar ─────────────────────────────────────── */
.bk-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.bk-filter-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.bk-filter-chip {
    padding: 8px 20px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid #C8D8E8;
    background: #FFFFFF;
    color: #6B7B8E;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: all .18s;
    white-space: nowrap;
    line-height: 1.4;
    /* Count bubble layout */
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

/* ── Count bubble ───────────────────────────────────── */
.bk-chip-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #EBF4FF;
    color: #6B7B8E;
    font-size: 10px;
    font-weight: 700;
    font-family: 'Plus Jakarta Sans', sans-serif;
    line-height: 1;
    flex-shrink: 0;
    transition: background .18s, color .18s;
}

.bk-filter-chip.bk-active .bk-chip-count {
    background: rgba(255, 255, 255, 0.20);
    color: #FFFFFF;
}

.bk-filter-chip:hover .bk-chip-count {
    background: rgba(13, 46, 110, 0.10);
    color: #0D2E6E;
}

.bk-filter-chip.bk-active:hover .bk-chip-count {
    background: rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
}

.bk-filter-chip:hover {
    border-color: #0D2E6E;
    color: #0D2E6E;
}

.bk-filter-chip.bk-active {
    background: #0D2E6E;
    color: #FFFFFF;
    border-color: #0D2E6E;
}

.bk-sort-select {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1.5px solid #C8D8E8;
    background: #FFFFFF;
    font-size: 13px;
    color: #1A2733;
    font-family: 'Plus Jakarta Sans', sans-serif;
    cursor: pointer;
    min-width: 160px;
}

/* ── Grid columns ───────────────────────────────────── */
/*
 * minmax(0, 1fr) es crítico: el valor mínimo 0 evita que el
 * contenido de las celdas empuje las columnas más allá del
 * ancho disponible (el bug clásico de overflow en CSS Grid).
 * width: 100% + box-sizing en el wrapper garantizan que el
 * grid nunca supere el ancho de su columna de Elementor.
 */
.bk-grid {
    display: grid;
    gap: 16px;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
    /* Prevent any child from stretching the grid beyond its container */
    min-width: 0;
}

.bk-grid--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bk-grid--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bk-grid--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1200px) {
    .bk-grid--cols-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
    .bk-grid--cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bk-grid--cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
    .bk-grid--cols-4,
    .bk-grid--cols-3,
    .bk-grid--cols-2 { grid-template-columns: minmax(0, 1fr); }
    .bk-filter-bar   { flex-direction: column; align-items: stretch; }
    .bk-sort-select  { width: 100%; }
    .bk-filter-chips { flex-wrap: wrap; }
}

/* ── Product Card ───────────────────────────────────── */
.bk-product-card {
    background: #fff;
    border: 1.5px solid #C8D8E8;
    border-radius: 18px;
    padding: 20px 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color .2s, box-shadow .2s;
    height: 100%;
    /* Critical: prevent card content from pushing column width */
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
    /* Prevent long words / SKUs from overflowing */
    overflow-wrap: break-word;
    word-break: break-word;
}

.bk-product-card:hover {
    border-color: #4F91E0;
    box-shadow: 0 6px 28px rgba(13, 46, 110, .09);
}

.bk-product-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    min-width: 0; /* allow flex children to shrink */
}

.bk-product-header__text {
    flex: 1;
    min-width: 0; /* allow truncation/wrapping inside */
    overflow: hidden;
}
.bk-product-header__badge { flex-shrink: 0; }

/* ── Title link ─────────────────────────────────────── */
.bk-product-title-link {
    text-decoration: none;
    display: block;
    color: inherit;
}

.bk-product-title-link:hover .bk-product-title,
.bk-product-title-link:focus .bk-product-title {
    color: #0D2E6E;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

.bk-product-title {
    font-size: 15px;
    font-weight: 700;
    color: #1A2733;
    line-height: 1.3;
    margin: 0 0 3px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    /* Rompe palabras largas con guión al llegar al borde */
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    hyphenate-limit-chars: 6 3 3; /* mínimo 6 letras, 3 antes del guión, 3 después */
    hyphenate-limit-lines: 3;
}

/* Fallback: si el <html> o el <body> no tienen lang="es",
   forzar el idioma en el título para que hyphens:auto funcione */
:root { --bk-hyphens: auto; }
.bk-product-title:lang(es),
.bk-product-title { -webkit-hyphens: auto; hyphens: auto; }

.bk-product-sku {
    font-size: 10px;
    color: #9AAAB8;
    font-family: monospace;
}

/* ── Badge ──────────────────────────────────────────── */
.bk-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 11px;
    border-radius: 20px;
    white-space: nowrap;
    display: inline-block;
    font-family: 'Plus Jakarta Sans', sans-serif;
    line-height: 1.4;
}
.bk-badge--yellow { background: #FFF8E1; color: #8A6200; }
.bk-badge--green  { background: #E6F9F1; color: #007A45; }
.bk-badge--blue   { background: #E6EEFF; color: #185FA5; }

/* ── Description ────────────────────────────────────── */
.bk-product-desc {
    font-size: 13px;
    color: #6B7B8E;
    line-height: 1.65;
    flex: 1;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ── Meta tags ──────────────────────────────────────── */
.bk-meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bk-meta-tag {
    background: #F4F9FF;
    border: 1px solid #C8D8E8;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 11px;
    color: #6B7B8E;
    font-family: 'Plus Jakarta Sans', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1.4;
}

/* ── Footer ─────────────────────────────────────────── */
.bk-product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid #E8EFF5;
    margin-top: auto;
    gap: 10px;
}



/* ── Price ──────────────────────────────────────────── */
.bk-product-price { display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; }
.bk-product-price .woocommerce-Price-amount {
    font-size: 26px;
    font-weight: 800;
    color: #0D2E6E;
    letter-spacing: -1px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    line-height: 1;
}
.bk-product-price .woocommerce-Price-currencySymbol {
    font-size: 16px;
    vertical-align: super;
    font-weight: 700;
}
.bk-product-price del .woocommerce-Price-amount {
    font-size: 12px;
    color: #9AAAB8;
    font-weight: 400;
    letter-spacing: 0;
    text-decoration: line-through;
}
.bk-product-price ins { text-decoration: none; }

/* ── Add button ─────────────────────────────────────── */
.bk-add-btn {
    background: #0D2E6E;
    color: #fff;
    border: none;
    padding: 11px 22px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Plus Jakarta Sans', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: background .2s, transform .15s;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1;
}
.bk-add-btn:hover           { background: #1A4FA0; color: #fff; transform: translateY(-1px); }
.bk-add-btn:active          { transform: translateY(0); }
.bk-add-btn.loading         { opacity: .7; pointer-events: none; }
.bk-add-btn.added           { background: #009A57; }
.bk-add-btn i, .bk-add-btn svg { font-size: 13px; width: 13px; height: 13px; }

/* ── No results ─────────────────────────────────────── */
.bk-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;
    color: #9AAAB8;
    font-size: 14px;
}

/* ── Loading overlay ────────────────────────────────── */
.bk-grid-loading {
    position: absolute;
    inset: 0;
    background: rgba(244, 249, 255, .75);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.bk-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #C8D8E8;
    border-top-color: #0D2E6E;
    border-radius: 50%;
    animation: bk-spin .7s linear infinite;
}

@keyframes bk-spin { to { transform: rotate(360deg); } }

/* ── Load more button ───────────────────────────────── */
.bk-load-more-wrap {
    text-align: center;
    margin-top: 36px;
}

.bk-load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #0D2E6E;
    color: #fff;
    border: none;
    padding: 15px 44px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: background .2s;
    text-decoration: none;
}

.bk-load-more-btn:hover { background: #1A4FA0; color: #fff; }

.bk-load-more-btn .bk-arrow {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #00C472;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
    transition: background .2s;
}

.bk-load-more-btn.bk-loading .bk-arrow::after {
    content: '';
    display: block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bk-spin .6s linear infinite;
}

/* ── Zone / no-zone footer switching ────────────────────────
   PHP always renders BOTH footers:
     .bk-footer-zone   → precio + botón agregar
     .bk-footer-nozone → CTA "Selecciona tu sucursal"

   JS adds .bk-has-zone or .bk-no-zone to .bk-grid-wrapper.
   Default (no class yet) = no zone → show CTA.            */

/* Zone footer — PHP decides which div to render, CSS just lays it out */
.bk-footer-zone   { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid #EBEFF5; flex-wrap: wrap; }
.bk-footer-nozone { display: flex; justify-content: center; padding-top: 12px; border-top: 1px solid #EBEFF5; }

/* ── No-zone CTA button ───────────────────────────────────── */
.bk-no-zone-cta {
    width: 100%;
    background: #00C472;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Plus Jakarta Sans', sans-serif;
    cursor: pointer;
    transition: background .2s, transform .15s;
    text-align: center;
    line-height: 1.4;
}
.bk-no-zone-cta:hover  { background: #009A57; }
.bk-no-zone-cta:active { transform: scale(.98); }

/* ── Chip: empty state (0 products in zone) ──────────────── */
.bk-filter-chip.bk-chip-empty {
    opacity: .45;
    pointer-events: none;
}

/* ── Numbered pagination (AJAX) ──────────────────────────── */
.bk-pagination-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 32px;
}

/* Number buttons and dots container */
.bk-pages {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Every page button (numbers, Anterior, Siguiente) */
.bk-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    box-sizing: border-box;
    border-radius: 10px;
    border: 1.5px solid #C8D8E8;
    background: #fff;
    color: #6B7B8E;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Plus Jakarta Sans', sans-serif;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    line-height: 1;
}

.bk-page-btn:not([disabled]):hover {
    border-color: #0D2E6E;
    color: #0D2E6E;
}

.bk-page-btn.bk-page-current {
    background: #0D2E6E;
    color: #fff;
    border-color: #0D2E6E;
    cursor: default;
}

.bk-page-btn[disabled]:not(.bk-page-current) {
    opacity: .4;
    cursor: not-allowed;
}

.bk-page-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    color: #9AAAB8;
    font-size: 14px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}


/* ═════════════════════════════════════════════════════════
   Biottek Live Search — Styles
   ═════════════════════════════════════════════════════════ */

/* ── Search container ────────────────────────────────────── */
.bk-search-container {
    position: relative;
    width: 100%;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ── Input wrapper ───────────────────────────────────────── */
.bk-search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border: 1.5px solid #C8D8E8;
    border-radius: 50px;
    background: #fff;
    transition: border-color .18s, box-shadow .18s;
    cursor: text;
}

.bk-search-wrap.bk-focused {
    border-color: #0D2E6E;
    box-shadow: 0 0 0 3px rgba(13, 46, 110, .08);
}

/* Grid search bar variant — slightly different radius */
.bk-grid-search-bar .bk-search-wrap {
    border-radius: 14px;
}

.bk-search-icon {
    flex-shrink: 0;
    color: #9AAAB8;
    display: flex;
    align-items: center;
    transition: color .15s;
    pointer-events: none;
}
.bk-search-wrap.bk-focused .bk-search-icon { color: #0D2E6E; }

.bk-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: #1A2733;
    font-family: 'Plus Jakarta Sans', sans-serif;
    line-height: 1.4;
    min-width: 0;
}
.bk-search-input::placeholder { color: #9AAAB8; }
/* Remove native clear button on webkit */
.bk-search-input::-webkit-search-cancel-button { display: none; }

.bk-search-clear {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #9AAAB8;
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color .15s;
}
.bk-search-clear:hover { color: #0D2E6E; }

.bk-search-spinner {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border: 2px solid #C8D8E8;
    border-top-color: #0D2E6E;
    border-radius: 50%;
    animation: bk-spin .65s linear infinite;
}

/* ── Dropdown ────────────────────────────────────────────── */
.bk-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #FFFFFF !important;
    background-color: #FFFFFF !important;
    color: #1A2733 !important;
    border: 1.5px solid #C8D8E8;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(13, 46, 110, .12);
    z-index: 9999;
    overflow: hidden;
    /* Animation */
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .18s, transform .18s;
    pointer-events: none;
}
.bk-search-dropdown.bk-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ── Inside the grid, dropdown is full-width ─────────────── */
.bk-grid-search-bar .bk-search-dropdown {
    border-radius: 14px;
}

/* ── Section labels (CATEGORÍAS / PRODUCTOS) ─────────────── */
.bk-search-section-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #9AAAB8;
    padding: 12px 16px 4px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}
.bk-search-section-label:first-child { padding-top: 10px; }

/* ── Individual result row ───────────────────────────────── */
/* Use both a and button selectors to beat theme/plugin specificity */
a.bk-search-result,
button.bk-search-result,
.bk-search-result {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    text-decoration: none;
    transition: background .13s;
    outline: none;
    border: none;
    border-radius: 0;
    /* Explicit resets — beat WooCommerce/theme green button rules */
    background: #FFFFFF !important;
    background-color: #FFFFFF !important;
    color: #1A2733 !important;
    box-shadow: none !important;
    width: 100%;
    text-align: left;
    font-family: 'Plus Jakarta Sans', sans-serif;
}
a.bk-search-result:hover,
button.bk-search-result:hover,
.bk-search-result:hover,
a.bk-search-result.bk-focused,
button.bk-search-result.bk-focused,
.bk-search-result.bk-focused {
    background: #F4F9FF !important;
    background-color: #F4F9FF !important;
    color: #1A2733 !important;
}

.bk-search-result__icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #EBF4FF !important;
    background-color: #EBF4FF !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0D2E6E !important;
    font-size: 14px;
}

.bk-search-result__body { flex: 1; min-width: 0; }

.bk-search-result__name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1A2733;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Plus Jakarta Sans', sans-serif;
}
/* Highlight matching text */
.bk-search-result__name mark {
    background: transparent;
    color: #0D2E6E;
    font-weight: 800;
}

.bk-search-result__meta {
    display: block;
    font-size: 11px;
    color: #9AAAB8;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.bk-search-result__price {
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 700;
    color: #0D2E6E;
    font-family: 'Plus Jakarta Sans', sans-serif;
    white-space: nowrap;
}
.bk-search-result__price .woocommerce-Price-currencySymbol {
    font-size: 11px;
    vertical-align: super;
}

/* ── Category result (no price) ─────────────────────────── */
.bk-search-result--cat .bk-search-result__icon {
    background: #F0F4FF;
    color: #4F91E0;
}
.bk-search-result--cat .bk-search-result__count {
    flex-shrink: 0;
    font-size: 11px;
    color: #9AAAB8;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* ── History item ────────────────────────────────────────── */
.bk-search-history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    cursor: pointer;
    transition: background .13s;
    font-family: 'Plus Jakarta Sans', sans-serif;
}
.bk-search-history-item:hover { background: #F4F9FF; }

.bk-search-history-item__text {
    flex: 1;
    font-size: 13px;
    color: #6B7B8E;
}
.bk-search-history-item__remove {
    background: none;
    border: none;
    color: #C8D8E8;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 12px;
    border-radius: 4px;
    transition: color .13s;
    line-height: 1;
}
.bk-search-history-item__remove:hover { color: #EF4444; }

/* ── No results / notices ────────────────────────────────── */
.bk-search-empty,
.bk-search-no-zone {
    padding: 20px 16px;
    text-align: center;
    font-size: 13px;
    color: #9AAAB8;
    font-family: 'Plus Jakarta Sans', sans-serif;
    line-height: 1.6;
}

.bk-search-no-zone__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    background: #00C472;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Plus Jakarta Sans', sans-serif;
    cursor: pointer;
    transition: background .15s;
}
.bk-search-no-zone__btn:hover { background: #009A57; }

/* ── Divider between sections ────────────────────────────── */
.bk-search-divider {
    height: 1px;
    background: #EBF4FF;
    margin: 4px 0;
}

/* ── Grid search bar integration ─────────────────────────── */
.bk-grid-search-bar {
    margin-bottom: 16px;
}

/* ── Responsive ──────────────────────────────────────────── */
/* mobile handled below in unified rule */

/* ── Catalog widget responsive column classes ──────────────── */
@media (max-width: 1024px) {
    .bk-grid--tablet-cols-1 { grid-template-columns: minmax(0,1fr) !important; }
    .bk-grid--tablet-cols-2 { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
    .bk-grid--tablet-cols-3 { grid-template-columns: repeat(3,minmax(0,1fr)) !important; }
    .bk-grid--tablet-cols-4 { grid-template-columns: repeat(4,minmax(0,1fr)) !important; }
}
@media (max-width: 767px) {
    .bk-grid--mobile-cols-1 { grid-template-columns: minmax(0,1fr) !important; }
    .bk-grid--mobile-cols-2 { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
    .bk-grid--mobile-cols-3 { grid-template-columns: repeat(3,minmax(0,1fr)) !important; }
    .bk-grid--mobile-cols-4 { grid-template-columns: repeat(4,minmax(0,1fr)) !important; }
}
/* Catalog toolbar */
.bk-cat-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 16px;
}

/* ═══════════════════════════════════════════════════════════
   Catalog Widget — Scoped Search Bar (inline toggle)
═══════════════════════════════════════════════════════════ */

.bk-cat-search-bar {
    position: relative;
    margin-bottom: 14px;
}

/* ── Wrap: slightly squarer radius to fit the pill toggle ── */
.bk-cat-search-wrap {
    border-radius: 14px !important;
    /* Give the toggle button its natural width, don't compress it */
    gap: 6px;
}

.bk-cat-search-wrap .bk-search-input {
    min-width: 0;  /* allow input to shrink, not the button */
    flex: 1;
}

/* ── Inline mode toggle pill ─────────────────────────────── */
.bk-cat-mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    background: #EBF4FF;
    border: 1.5px solid #C8D8E8;
    border-radius: 20px;
    padding: 5px 12px 5px 10px;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: #0D2E6E;
    cursor: pointer;
    transition: all .18s;
    white-space: nowrap;
    line-height: 1.3;
    min-width: 0;          /* don't shrink below content */
    overflow: visible;     /* never clip */
}

.bk-cat-mode-toggle:hover {
    background: #0D2E6E;
    border-color: #0D2E6E;
    color: #fff;
}

/* Global mode active state */
.bk-cat-mode-toggle[data-search-mode="global"] {
    background: #0D2E6E;
    border-color: #0D2E6E;
    color: #fff;
}

.bk-cat-mode-toggle[data-search-mode="global"]:hover {
    background: #1A4FA0;
    border-color: #1A4FA0;
}

.bk-cat-mode-toggle__icon {
    font-size: 13px;
    flex-shrink: 0;
}

.bk-cat-mode-toggle__label {
    white-space: nowrap;
    overflow: visible;
    text-overflow: unset;
    max-width: none;       /* remove truncation */
}

.bk-cat-mode-toggle__chevron {
    flex-shrink: 0;
    opacity: .6;
    transition: transform .15s;
}

.bk-cat-mode-toggle[data-search-mode="global"] .bk-cat-mode-toggle__chevron {
    transform: rotate(180deg);
}

/* ── Dropdown ────────────────────────────────────────────── */
.bk-cat-search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 9999;
    /* Inherit all visual styles from .bk-search-dropdown */
    background: #FFFFFF !important;
    background-color: #FFFFFF !important;
    color: #1A2733 !important;
    border: 1.5px solid #C8D8E8;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(13,46,110,.12);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .18s, transform .18s;
    pointer-events: none;
}
.bk-cat-search-dropdown.bk-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Ensure the search bar itself doesn't clip the dropdown */
.bk-cat-search-bar {
    position: relative;
    margin-bottom: 14px;
    overflow: visible !important;
}

/* ── Mobile: drop below input (no bottom sheet) ────────────── */
@media (max-width: 600px) {
    /* Standalone search widget — also drop down, not bottom sheet */
    .bk-search-dropdown {
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        right: 0;
        bottom: auto;
        border-radius: 14px;
        max-height: 55vh;
        overflow-y: auto;
        transform: translateY(-6px);
    }
    .bk-search-dropdown.bk-visible {
        transform: translateY(0);
    }
    .bk-search-result__name { white-space: normal; }
}

/* ── Mobile: catalog dropdown also drops down ───────────────── */
@media (max-width: 600px) {
    .bk-cat-search-dropdown {
        position: absolute;
        top: calc(100% + 6px);
        left: 0;
        right: 0;
        bottom: auto;
        width: auto;
        border-radius: 14px;
        max-height: 55vh;
        overflow-y: auto;
        transform: translateY(-6px);
        opacity: 1;
    }
    .bk-cat-search-dropdown.bk-visible {
        transform: translateY(0);
        pointer-events: auto;
    }
}

/* ── Responsive: hide label on small screens ─────────────── */
@media (max-width: 480px) {
    .bk-cat-mode-toggle__label { display: none; }
    .bk-cat-mode-toggle { padding: 6px 8px; }
}
