/*
 * KIBERHUB | Mobile Performance & Floating Dock v2.0
 * Layer loaded AFTER the production bundle. No database or framework changes.
 */
:root {
  --kb-dock-height: 72px;
  --kb-dock-gap: 14px;
}
img, video, svg { max-width: 100%; }
img { vertical-align: middle; }
:where(.p-card, .pc2, .promo, .cat-tile, .sub-tile, .service-home-grid > a) { min-width: 0; }
:where(.p-name, .p-sp, .promo-text, .cat-tile, .sub-tile, .service-home-grid > a) { overflow-wrap: anywhere; }
.p-img img.kiber-product-photo, .pc2-img img.kiber-product-photo {
  max-width: 100%; max-height: 100%; object-fit: contain;
}
:where(.hero-bg, .promo-upload, .sh2-bg img, .sv2-hero-bg img) {
  display: block; object-fit: cover;
}
/* Avoid unpredictable font zooming and horizontal overflow on narrow devices. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { min-width: 0; }
@media (hover: none) and (pointer: coarse) {
  .p-card:hover, .promo:hover, .cat-tile:hover, .stat-card:hover {
    transform: none !important;
  }
  .p-card:hover::before, .promo:hover::before,
  .cat-tile:hover::before { opacity: 0; }
  .p-card, .promo, .cat-tile { -webkit-tap-highlight-color: transparent; }
}
/* Float the mobile dock above the bottom safe area (iOS gesture bar included). */
@media (max-width: 991.98px) {
  :root { --kb-dock-bottom: calc(var(--kb-dock-gap) + env(safe-area-inset-bottom, 0px)); }
  body, body.has-bottom-nav { padding-bottom: calc(var(--kb-dock-height) + 52px + env(safe-area-inset-bottom, 0px)); }
  .bottom-nav.d-lg-none {
    box-sizing: border-box;
    position: fixed;
    z-index: 1030;
    left: 50%;
    right: auto;
    bottom: var(--kb-dock-bottom);
    transform: translate3d(-50%, 0, 0);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    width: min(500px, calc(100% - 28px));
    height: var(--kb-dock-height);
    padding: 7px 7px 8px;
    border: 1px solid var(--line2);
    border-radius: 999px;
    background: var(--surface) !important;
    box-shadow: 0 12px 36px rgba(10, 26, 58, .20), 0 3px 8px rgba(10, 26, 58, .06);
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    isolation: isolate;
    overflow: visible;
  }
  /* Raised semi-circular cap ties the central search action to the floating dock. */
  .bottom-nav.d-lg-none::before {
    content: "";
    position: absolute;
    z-index: -1;
    left: 50%;
    top: -17px;
    width: 77px;
    height: 54px;
    transform: translateX(-50%);
    border: 1px solid var(--line2);
    border-bottom: 0;
    border-radius: 60px 60px 18px 18px;
    background: var(--surface);
    pointer-events: none;
  }
  .bottom-nav.d-lg-none > a,
  .bottom-nav.d-lg-none > button {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    align-self: stretch;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    padding: 7px 1px 5px;
    margin: 0;
    border: 0;
    border-radius: 20px;
    background: transparent;
    color: var(--mut);
    font-size: 10px;
    font-weight: 650;
    line-height: 1.2;
    text-decoration: none;
    text-align: center;
    transition: color .18s ease, background-color .18s ease, transform .18s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    cursor: pointer;
  }
  .bottom-nav.d-lg-none > :is(a, button) > i,
  .bottom-nav.d-lg-none .bn-ico > i { font-size: 19px; line-height: 23px; }
  .bottom-nav.d-lg-none > :is(a, button) > span:last-child {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .bottom-nav.d-lg-none > :is(a,button).active,
  .bottom-nav.d-lg-none > :is(a,button)[aria-current="page"] { color: var(--blue2); }
  .bottom-nav.d-lg-none > :is(a,button):focus-visible {
    outline: 2px solid var(--blue); outline-offset: 2px;
  }
  .bottom-nav.d-lg-none > :is(a,button):active { transform: scale(.96); }
  .bottom-nav.d-lg-none .bn-ico { position: relative; line-height: 23px; }
  .bottom-nav.d-lg-none .hdr-count {
    position: absolute; top: -8px; right: -13px;
    min-width: 16px; height: 16px; line-height: 16px; font-size: 9px;
  }
  .bottom-nav.d-lg-none > .bn-primary {
    position: relative;
    padding-top: 2px;
    overflow: visible;
    gap: 3px;
    color: var(--blue2);
  }
  .bottom-nav.d-lg-none .bn-primary-icon {
    flex: 0 0 auto;
    position: relative;
    display: grid;
    place-items: center;
    height: 56px;
    width: 56px;
    margin-top: -31px;
    border: 4px solid var(--surface);
    border-radius: 50%;
    background: linear-gradient(145deg, #318dff, #155de4);
    color: #fff;
    box-shadow: 0 6px 17px rgba(23, 97, 230, .30), inset 0 1px 2px rgba(255,255,255,.25);
  }
  .bottom-nav.d-lg-none .bn-primary-icon i { font-size: 19px; }
  .bottom-nav.d-lg-none > .bn-primary > span:last-child {
    transform: translateY(-2px);
    font-size: 10px;
    font-weight: 800;
  }
  .bottom-nav.d-lg-none > :is(a,button):not(.bn-primary):hover {
    color: var(--blue2);
    background: var(--tint2);
  }
  .to-top { bottom: calc(105px + env(safe-area-inset-bottom, 0px)); right: 16px; }
  .nx-toasts { bottom: calc(106px + env(safe-area-inset-bottom, 0px)); }
  .container, .container-fluid { min-width: 0; }
  .hdr-row, .hdr-actions, .slide-text, .promo-text { min-width: 0; }
  .hero-wrap { padding-top: 10px; }
  .hero { border-radius: 18px; }
  .hslide { min-height: clamp(320px, 72vw, 430px); padding: 24px 24px 42px; align-items: center; }
  .hslide.has-photo .slide-text { max-width: min(540px, 95%); }
  .hslide.has-photo .hero-bg { object-position: 58% center; }
  .hslide.has-photo .hero-shade {
    background: linear-gradient(90deg, rgba(4, 10, 24, .84) 0%, rgba(4, 10, 24, .64) 55%, rgba(4,10,24,.25) 100%);
  }
  .slide-text h1 { max-width: 100%; text-wrap: balance; }
  .slide-sub { max-width: 44ch; }
  .p-grid, .cat-tiles, .sub-tiles, .promos, .service-home-grid {
    min-width: 0;
  }
  .p-grid > *, .cat-tiles > *, .sub-tiles > *, .promos > * {
    min-width: 0;
  }
  .promo-upload { max-width: 52%; height: 100%; object-fit: contain; }
  .p-grid.list { grid-template-columns: minmax(0, 1fr); }
  .p-grid.list .p-card { max-width: 100%; }
  .p-grid.list .p-card > * { min-width: 0; }
  /* Turn off costly perpetual page decorations on touchscreens. */
  .ticker-track, .brands-track { animation: none !important; }
  .ticker { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .ticker::-webkit-scrollbar { display: none; }
  .fan, .hero .fan, .gallery-main .fan, .q-vis .fan {
    animation: none !important;
  }
}
@media (max-width: 767.98px) {
  .block { padding-left: 0; padding-right: 0; }
  .container { --bs-gutter-x: 24px; }
  .hero { border-radius: 16px; }
  .hslide { min-height: 360px; padding: 22px 20px 48px; }
  .hslide.has-photo .hero-bg { object-position: center; }
  .hslide.has-photo .hero-shade {
    background: linear-gradient(90deg, rgba(5,11,25,.86), rgba(5,11,25,.65) 67%, rgba(5,11,25,.33));
  }
  .hslide .slide-text { max-width: 100%; width: 100%; }
  .hslide .slide-text h1 { font-size: clamp(1.7rem, 5.3vw, 2.35rem); line-height: 1.12; }
  .hslide .slide-sub { font-size: .86rem; line-height: 1.55; }
  .slide-art { max-width: 65%; opacity: .28; }
  .cat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .p-grid.cols-6, .p-grid.cols-5, .p-grid.cols-4,
  .p-grid.cols-3, .p-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .p-card { display: flex; flex-direction: column; min-width: 0; border-radius: 15px; }
  .p-card .p-info { min-width: 0; flex: 1 1 auto; }
  .p-img { height: auto; min-height: 0; aspect-ratio: 1.28 / 1; }
  .p-img .art { max-height: 96%; }
  .p-img > img { width: 100%; height: 100%; object-fit: contain; }
  .p-card .p-name { overflow-wrap: anywhere; }
  .p-card .p-buy { margin-top: auto; }
  .p-card .p-price { min-width: 0; }
  .p-card .p-price b { font-size: clamp(14px, 3.7vw, 19px); white-space: nowrap; }
  .p-card .p-actions { min-width: 0; }
  .p-actions .btn-buy { min-width: 0; flex: 1 1 auto; }
  .p-actions .btn-buy span { display: inline; }
  .p-actions .btn-buy { font-size: 12px; gap: 5px; }
  .p-actions .btn-buy i { font-size: 13px; }
  .promos { grid-template-columns: minmax(0,1fr); }
  .promo { min-height: 190px; overflow: hidden; }
  .promo .promo-text { max-width: 62%; }
  .promo-upload { max-width: 45%; width: 45%; padding: 4px; object-fit: contain; }
  .service-home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery, .g-stage, .gallery-main { max-width: 100%; min-width: 0; }
  .gallery img { object-fit: contain; }
  .cart-canvas { max-width: 100vw; }
  .foot-main .row > * { min-width: 0; }
  .search input { font-size: 16px; } /* suppress iOS focus zoom */
}
@media (max-width: 430px) {
  :root { --kb-dock-height: 68px; --kb-dock-gap: 12px; }
  .bottom-nav.d-lg-none { width: calc(100% - 22px); padding-left: 4px; padding-right: 4px; }
  .bottom-nav.d-lg-none > a, .bottom-nav.d-lg-none > button { font-size: 9px; gap: 3px; }
  .bottom-nav.d-lg-none .bn-primary-icon { width: 54px; height: 54px; }
  .hslide { min-height: 340px; padding: 20px 16px 44px; }
  .hero-carousel .carousel-control-prev, .hero-carousel .carousel-control-next {
    top: auto; bottom: 8px; height: 36px; width: 36px; z-index: 5;
  }
  .hero-carousel .carousel-control-prev { left: 9px; }
  .hero-carousel .carousel-control-next { right: 9px; }
  .hero-carousel .carousel-indicators { margin-bottom: 14px; }
  .cat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cat-tile { min-width: 0; }
  .p-grid { gap: 9px !important; }
  .p-card .p-actions .btn-buy span { display: inline; }
  .p-card .p-actions { gap: 5px; }
  .p-card .p-actions .p-eye { flex: 0 0 31px; width: 31px; min-width: 31px; }
  .p-card .p-deliv { font-size: 10px; }
  .promo .promo-text { max-width: 62%; }
  .promo .promo-text b { font-size: 1.13rem; }
  .service-home-grid { gap: 9px; }
}
@media (max-width: 360px) {
  .bottom-nav.d-lg-none > a, .bottom-nav.d-lg-none > button { font-size: 8px; }
  .bottom-nav.d-lg-none .bn-primary-icon { width: 50px; height: 50px; }
  .p-card .p-actions .btn-buy span { display: none; }
  .hslide .slide-text h1 { font-size: 1.55rem; }
  .cat-tiles { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 992px) {
  .bottom-nav.d-lg-none { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .bottom-nav *, .p-card *, .promo * { animation: none !important; transition: none !important; }
  .ticker-track { animation: none !important; }
}
/* Low-power preference already detected by header.php; avoid compositor work. */
html.lite .bottom-nav,
html.lite .bottom-nav::before { box-shadow: 0 5px 15px rgba(10,26,58,.14); }
html.lite .hero::before, html.lite .hslide::before { animation: none !important; }

/* v3: narrow-screen layout safety for long CRM titles & catalogue cards. */
@media (max-width: 767.98px) {
  .hslide h1 span,
  .slide-text h1 span,
  .promo-text b { white-space: normal; overflow-wrap: anywhere; }
  /* Show the full six-card selection instead of silently hiding the last two. */
  .p-grid.cols-6 > :nth-child(n+5),
  .pop-pane .p-grid.cols-6 > :nth-child(n+5) { display: flex !important; }
  .bottom-nav.d-lg-none > :is(a, button) { min-height: 48px; }
  .gallery-main img,
  .g-stage img,
  .pp-stage img { max-width: 100%; height: auto; object-fit: contain; }
}
@media (max-width: 430px) {
  .p-grid.list .p-card { grid-template-columns: minmax(92px, 108px) minmax(0, 1fr); gap: 6px 10px; }
  .p-grid.list .p-img { height: 105px; }
  .p-grid.list .p-buy { grid-column: 1 / -1; }
  .bottom-nav.d-lg-none { max-width: 100%; }
}


/* ===== KIBERHUB v4 / Mobile Search Experience ===== */
@media (max-width: 991.98px) {
  /* No second oversized search row: the dock + header icon open a proper search view. */
  .site-header .hdr-row > .search { display: none !important; }
  .site-header .kb-head-search { display: inline-flex !important; width: 38px; height: 42px; align-items: center; justify-content: center; }
  .site-header .kb-head-search .hdr-ico { color: var(--blue2, #479aff); }
  .bottom-nav.d-lg-none { box-shadow: 0 20px 50px rgba(0, 0, 0, .3), 0 4px 16px rgba(35, 99, 230, .1); }
  .bottom-nav.d-lg-none > .bn-primary { color: var(--head, #fff); }
  .bottom-nav.d-lg-none .bn-primary-icon { background: linear-gradient(135deg, #53b5ff 0%, #266cff 51%, #174acf 100%); box-shadow: 0 9px 23px rgba(29, 103, 248, .4), inset 0 1px 2px rgba(255,255,255,.25); }
  body.kb-search-open { overflow: hidden !important; }
  body.kb-search-open > .bottom-nav, body.kb-search-open .bottom-nav.d-lg-none { visibility: hidden; pointer-events: none; }
  body.kb-search-open #siteHeader { pointer-events: none; }
  .kb-search-overlay:not([hidden]) { display: flex; }
}
.kb-search-overlay[hidden] { display: none !important; }
.kb-search-overlay { display: none; }
@media (max-width: 991.98px) {
  .kb-search-overlay {
    position: fixed; inset: 0; z-index: 2400; width: 100%;
    height: 100vh; height: 100dvh;
    min-width: 0; margin: 0;
    background: var(--bg, #080f1f);
    color: var(--txt, #e5eaf8);
    overflow: hidden;
    isolation: isolate;
  }
  .kb-search-overlay::before {
    content: ''; position: absolute; z-index: -1; pointer-events: none;
    top: -170px; right: -160px; width: 440px; height: 440px; border-radius: 50%;
    background: radial-gradient(circle, rgba(39, 116, 255, .20), rgba(39, 116, 255, .06) 42%, transparent 70%);
  }
  .kb-search-shell { box-sizing: border-box; width: 100%; min-height: 0; max-width: 660px; margin: 0 auto; display: flex; flex-direction: column; padding: calc(18px + env(safe-area-inset-top, 0px)) 18px max(16px, env(safe-area-inset-bottom, 0px)); }
  .kb-search-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: 0 0 auto; }
  .kb-search-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--head, #fff); font-weight: 900; font-size: 19px; letter-spacing: .03em; line-height: 1.15; text-decoration: none; }
  .kb-search-brand:hover { color: var(--head, #fff); }
  .kb-search-brand-icon { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid rgba(91, 157, 255, .33); border-radius: 13px; background: rgba(41, 120, 255, .11); color: #589fff; font-size: 17px; }
  .kb-search-brand-accent { color: #4599ff; }
  .kb-search-brand small { display: block; margin-top: 4px; letter-spacing: .09em; font-size: 8px; font-weight: 750; color: var(--mut, #8a99b4); }
  .kb-search-close { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 14px; border: 1px solid var(--line2, #273958); color: var(--txt, #fff); background: var(--surface, #111a2a); font-size: 18px; transition: background .15s ease; }
  .kb-search-close:active { transform: scale(.96); }
  .kb-search-intro { margin: clamp(26px, 5vh, 54px) 0 22px; flex: 0 0 auto; }
  .kb-search-eyebrow { display: flex; align-items: center; gap: 8px; color: #5eaaff; font-size: 10px; font-weight: 850; letter-spacing: .13em; }
  .kb-search-eyebrow span { width: 6px; height: 6px; border-radius: 50%; background: #55a5ff; box-shadow: 0 0 10px rgba(80,165,255,.65); }
  .kb-search-intro h2 { margin: 10px 0 8px; color: var(--head, #fff); font-size: clamp(29px, 8vw, 42px); letter-spacing: -.04em; line-height: 1.09; font-weight: 900; }
  .kb-search-intro h2 em { font-style: normal; color: #469bff; }
  .kb-search-intro p { max-width: 370px; color: var(--mut, #a0adbd); font-size: 13px; line-height: 1.5; margin: 0; }
  .kb-search-form { display: flex; align-items: center; position: relative; flex: 0 0 auto; width: 100%; height: 61px; padding: 5px 5px 5px 15px; border-radius: 19px; background: var(--surface, #121e34); border: 1px solid rgba(76, 148, 255, .5); box-shadow: 0 5px 28px rgba(36, 105, 235, .13), 0 0 0 3px rgba(50, 129, 255, .055); }
  .kb-search-form:focus-within { border-color: #448fff; box-shadow: 0 5px 26px rgba(36, 105, 235, .15), 0 0 0 3px rgba(44, 121, 254, .10); }
  .kb-search-input-icon { flex: none; color: #4a96ff; font-size: 17px; margin-right: 12px; }
  .kb-search-form #kbSearchInput { outline: none; border: 0; min-width: 0; width: 100%; flex: 1 1 auto; height: 100%; background: transparent; box-shadow: none; color: var(--head, #fff); font-size: 16px; font-weight: 600; padding: 0; -webkit-appearance: none; appearance: none; }
  .kb-search-form #kbSearchInput::placeholder { color: var(--mut, #8e9aac); font-weight: 450; font-size: 13px; }
  .kb-search-form #kbSearchInput::-webkit-search-cancel-button { display: none; }
  .kb-search-clear { flex: none; width: 30px; height: 34px; border: 0; background: transparent; color: var(--mut, #8e9aac); }
  .kb-search-clear[hidden] { display: none; }
  .kb-search-go { flex: none; width: 48px; height: 48px; border: 0; border-radius: 14px; background: linear-gradient(135deg, #429fff, #2061ed); color: #fff; box-shadow: 0 5px 12px rgba(22, 91, 222, .26); display: grid; place-items: center; font-size: 17px; }
  .kb-search-main { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; margin-top: 22px; padding: 16px 12px 10px; border: 1px solid var(--line2, #273755); border-radius: 23px; background: var(--card, #0d172c); }
  .kb-search-hint { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 6px 10px; border-bottom: 1px solid var(--line, #253249); color: var(--txt2, #a2b1c8); font-size: 11px; font-weight: 600; }
  .kb-search-hint i { margin-right: 5px; color: #65acff; }
  .kb-search-live-dot { color: #42dca5; border-radius: 99px; background: rgba(38, 191, 141, .12); font-size: 9px; letter-spacing: .09em; padding: 5px 7px; }
  .search-dd.kb-search-results { display: block; position: static; min-height: 0; max-height: none; flex: 1 1 auto; width: 100%; border: none; background: transparent; box-shadow: none !important; margin: 0; padding: 10px 1px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; -webkit-overflow-scrolling: touch; animation: none !important; scrollbar-width: thin; }
  .kb-search-results .sd-title { padding: 10px 9px 9px; font-size: 10px; letter-spacing: .12em; }
  .kb-search-results .sd-item { padding: 10px 9px; gap: 11px; min-height: 60px; border-radius: 13px; animation: none; }
  .kb-search-results .sd-ico { width: 44px; height: 44px; border-radius: 12px; }
  .kb-search-results .sd-ico img { display: block; width: 100%; height: 100%; object-fit: contain; }
  .kb-search-results .sd-name { min-width: 0; font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
  .kb-search-results .sd-name small { margin-top: 3px; font-size: 11px; font-weight: 450; }
  .kb-search-results .sd-price { font-size: 12px; flex: none; }
  .kb-search-results .sd-tags { gap: 9px; padding: 0 8px 15px; }
  .kb-search-results .sd-tags a { font-weight: 600; font-size: 12px; padding: 8px 12px; background: var(--surface, #19263b); border-color: var(--line2); }
  .kb-search-results .sd-recent { padding: 11px 10px; font-size: 13px; }
  .kb-search-results .sd-all { margin: 8px 4px; padding: 13px 15px; border-radius: 13px; font-size: 13px; }
  .kb-search-bottom { display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto; gap: 10px; padding: 14px 3px 0; font-size: 11px; color: var(--mut, #8e9aac); }
  .kb-search-bottom a { color: #589eff; font-weight: 700; text-decoration: none; }
  .kb-search-bottom a i { margin-right: 5px; }
  .kb-search-bottom > span i { color: #e9b647; }
  .kb-search-close:focus-visible, .kb-search-go:focus-visible, .kb-search-clear:focus-visible, .kb-search-results a:focus-visible { outline: 2px solid #5eaaff; outline-offset: 2px; }
}
@media (max-width: 390px) {
  .kb-search-shell { padding-left: 12px; padding-right: 12px; }
  .kb-search-intro { margin-top: 26px; }
  .kb-search-intro h2 { font-size: 30px; }
  .kb-search-main { margin-top: 16px; padding: 12px 8px 8px; }
  .kb-search-bottom > span { display: none; }
  .kb-search-results .sd-price { max-width: 94px; white-space: normal; text-align: right; }
  .kb-search-results .sd-item { padding-left: 5px; padding-right: 5px; gap: 7px; }
}
@media (max-width: 991.98px) and (max-height: 670px) {
  .kb-search-intro { margin: 14px 0 12px; }
  .kb-search-intro p { display: none; }
  .kb-search-form { height: 55px; }
  .kb-search-go { width: 44px; height: 44px; }
  .kb-search-main { margin-top: 14px; }
}
@media (min-width: 992px) { .kb-search-overlay { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .kb-search-overlay *, .bottom-nav.d-lg-none * { animation: none !important; transition: none !important; } }
