/* KIBERHUB v6: фото без растяжения, плоское нижнее меню, мобильная полировка */

/* ---------- Галерея товара: фото не растягивается и не обрезается ---------- */
.gallery-main { aspect-ratio: 1 / .92; background-color: var(--card, #fff); }
.gallery-main .g-stage { display: grid; place-items: center; width: 100%; height: 100%; padding: 4%; box-sizing: border-box; transform: none !important; filter: none !important; }
.gallery-main .g-stage img.kiber-product-photo,
.gallery-main .g-stage img.g-art {
  width: auto !important; height: auto !important;
  max-width: 100% !important; max-height: 100% !important;
  object-fit: contain !important; object-position: center;
  background: transparent; border-radius: 10px;
  animation: none !important; filter: none !important;
}
.gallery-photos { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.gallery-photos::-webkit-scrollbar { display: none; }
.gallery-photos .thumb { flex: 0 0 auto; width: 68px; height: 68px; padding: 4px; border-radius: 12px; display: grid; place-items: center; overflow: hidden; background: var(--card, #fff); }
.gallery-photos .thumb img { width: 100%; height: 100%; object-fit: contain; }
.p-img img.kiber-product-photo, .pc2-img img.kiber-product-photo { object-fit: contain !important; width: auto; height: auto; max-width: 100%; max-height: 100%; }
.prod-desc-p { line-height: 1.7; margin: 0 0 12px; color: var(--txt2); }

/* ---------- Город: единственный, без выпадающего списка ---------- */
.city-static { cursor: default; pointer-events: none; }

/* ---------- Нижнее меню: ровная плавающая панель, поиск — в ряду ---------- */
@media (max-width: 991.98px) {
  .bottom-nav.d-lg-none {
    width: min(480px, calc(100% - 20px)) !important;
    height: 64px !important;
    padding: 6px !important;
    border-radius: 22px !important;
    display: grid !important;
    grid-template-columns: repeat(5, 1fr);
    align-items: stretch !important;
    gap: 2px !important;
    overflow: hidden !important;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    background: color-mix(in srgb, var(--surface, #fff) 94%, transparent) !important;
    border: 1px solid var(--line2, rgba(20,40,90,.12)) !important;
    box-shadow: 0 10px 30px rgba(10,26,58,.18), 0 2px 6px rgba(10,26,58,.06) !important;
  }
  .bottom-nav.d-lg-none::before { content: none !important; display: none !important; }
  .bottom-nav.d-lg-none > a, .bottom-nav.d-lg-none > button {
    min-width: 0; min-height: 0 !important; height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border-radius: 16px; font-size: 10px; font-weight: 700; padding: 0 2px;
    transition: background .2s, color .2s, transform .15s;
  }
  .bottom-nav.d-lg-none > :is(a,button).active, .bottom-nav.d-lg-none > :is(a,button)[aria-current="page"] {
    background: color-mix(in srgb, var(--blue, #1f6bff) 12%, transparent); color: var(--blue2, #1a62ef);
  }
  .bottom-nav.d-lg-none > .bn-primary { padding: 0 2px !important; overflow: visible; color: #fff !important; background: linear-gradient(145deg, #3b93ff, #1a5fe8) !important; box-shadow: 0 4px 12px rgba(26,95,232,.35); }
  .bottom-nav.d-lg-none > .bn-primary:active { transform: scale(.95); }
  .bottom-nav.d-lg-none .bn-primary-icon {
    width: auto !important; height: auto !important; margin: 0 !important; border: 0 !important;
    background: none !important; box-shadow: none !important; color: #fff; display: grid; place-items: center;
  }
  .bottom-nav.d-lg-none .bn-primary-icon i { font-size: 19px; line-height: 23px; }
  .bottom-nav.d-lg-none > .bn-primary > span:last-child { transform: none !important; color: #fff; font-size: 10px; font-weight: 800; }
  .bottom-nav.d-lg-none .hdr-count { top: -6px; right: -10px; }
  body { padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 380px) {
  .bottom-nav.d-lg-none > a, .bottom-nav.d-lg-none > button { font-size: 9px; }
}

/* ---------- Мобильная версия: удобнее и аккуратнее ---------- */
@media (max-width: 767.98px) {
  .container { padding-left: 14px; padding-right: 14px; }
  .p-grid { gap: 10px; }
  .p-card { border-radius: 18px; }
  .btn, .btn-buy, button.btn-main { min-height: 44px; }
  .panel { border-radius: 18px; padding: 16px; }
  .key-specs li { padding: 7px 0; font-size: 13px; }
  .spec-table th, .spec-table td { padding: 9px 10px; font-size: 13px; vertical-align: top; word-break: break-word; }
  .nx-tab-content { padding: 14px; }
  .nav-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .nav-tabs::-webkit-scrollbar { display: none; }
  .nav-tabs .nav-link { white-space: nowrap; }
  .city-btn { font-size: 12px; padding: 6px 10px; }
  .gallery-main { border-radius: 20px; aspect-ratio: 1 / .86; }
  .gallery-photos .thumb { width: 60px; height: 60px; }
}

/* ---------- Промо-блоки: загруженное фото заполняет блок целиком ---------- */
.promo:has(> .promo-upload) { padding: 0; }
.promo:has(> .promo-upload) .promo-text { position: relative; z-index: 3; padding: 1.6rem 1.7rem; max-width: 62%; }
.promo > img.promo-upload {
  position: absolute !important; inset: 0 !important;
  width: 100% !important; height: 100% !important; max-width: none !important;
  padding: 0 !important; margin: 0 !important;
  object-fit: cover !important; object-position: center !important;
  filter: none !important; z-index: 0 !important; border-radius: inherit;
}
.promo:has(> .promo-upload)::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgba(4,9,24,.78) 0%, rgba(4,9,24,.46) 42%, rgba(4,9,24,0) 72%);
}
.promo:has(> .promo-upload):hover > img.promo-upload { transform: scale(1.04); }
@media (max-width: 767.98px) {
  .promo:has(> .promo-upload) .promo-text { padding: 1.2rem 1.1rem; max-width: 66%; }
}
