:root {
  --brand-color: #0d6efd;
}

body {
  font-family: 'Segoe UI', Roboto, Arial, sans-serif;
}

/* ---------- Header (одна строка: логотип, поиск, телефон, консультация, корзина) ---------- */
.site-header {
  background: #fff;
}
.header-top-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 0;
}
.header-col-logo {
  flex: 0 0 auto;
}
.header-col-search {
  flex: 1 1 auto;
  min-width: 0;
}
.header-col-phone {
  flex: 0 0 auto;
}
.header-col-consult {
  flex: 0 0 auto;
}
.header-col-cart {
  flex: 0 0 auto;
}
.header-cart-link {
  display: flex;
  align-items: center;
  gap: .4rem;
  text-decoration: none;
  color: #212529;
  font-weight: 500;
  white-space: nowrap;
}
.header-cart-link .badge {
  position: relative;
  top: -8px;
}
.header-phone {
  font-weight: 600;
  font-size: 1.05rem;
  color: #212529;
  text-decoration: none;
  white-space: nowrap;
}
.header-consult-btn {
  white-space: nowrap;
}
.header-nav-row {
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
}
.header-nav-menu {
  gap: .5rem;
}
.header-nav-menu .nav-link {
  font-size: 1.08rem;
  font-weight: 500;
  padding-top: .75rem;
  padding-bottom: .75rem;
}

@media (max-width: 991.98px) {
  .header-top-row { display: none; }
}

.header-mobile-bar { min-height: 52px; }
.header-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  color: #212529;
  border-radius: 50%;
}
.header-icon-btn:hover { background: #f1f3f5; }
.header-icon-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: .65rem;
  padding: .2em .4em;
}
.header-mobile-phone .header-phone { font-size: 1rem; }
.header-mobile-search-wrap { position: relative; }

/* ---------- WhatsApp float button ---------- */
.whatsapp-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #25D366;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  z-index: 1050;
}

/* ---------- Live search ---------- */
.live-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: .375rem;
  max-height: 420px;
  overflow-y: auto;
  z-index: 1060;
  box-shadow: 0 8px 20px rgba(0,0,0,.12);
}
.live-search-item {
  display: flex;
  gap: .75rem;
  padding: .5rem .75rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #f1f1f1;
}
.live-search-item:hover { background: #f8f9fa; }
.live-search-item img { width: 48px; height: 48px; object-fit: cover; border-radius: .25rem; }

/* ---------- Mega menu ---------- */
.mega-menu-parent { position: relative; }
.mega-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100vw;
  max-width: 1140px;
  background: #fff;
  z-index: 1055;
  border-radius: 0 0 .5rem .5rem;
}
.mega-menu-parent:hover .mega-menu { display: block; }
.mega-menu-parent.open .mega-menu { display: block; }
.mega-menu-cats { border-right: 1px solid #eee; }
.mega-menu-cat-item {
  padding: .65rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f5;
}
.mega-menu-cat-item a { text-decoration: none; color: inherit; display: block; }
.mega-menu-cat-item.active,
.mega-menu-cat-item:hover { background: #f0f6ff; }
.mega-sub-link { text-decoration: none; color: #333; border-radius: .375rem; }
.mega-sub-link:hover { background: #f8f9fa; }

@media (max-width: 991.98px) {
  .mega-menu {
    position: static;
    width: 100%;
    max-width: none;
    box-shadow: none !important;
    border-top: 1px solid #eee;
  }
  .mega-menu-cats { border-right: none; border-bottom: 1px solid #eee; }
}

.category-card-img {
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #f8f9fa;
  padding: .5rem;
}
/* ---------- Popular products carousel (без стрелок, активная карточка по центру) ---------- */
.popular-products-wrap {
  position: relative;
}
.popular-products-swiper { padding: 0 4px; }

.drag-handle {
  cursor: grab;
  color: #adb5bd;
  font-size: 1.1rem;
}
.drag-handle:active { cursor: grabbing; }

.category-overview-card { overflow: hidden; }
.category-overview-img {
  width: 200px;
  height: 150px;
  object-fit: contain;
  background: #f8f9fa;
  padding: .5rem;
}
@media (max-width: 767.98px) {
  .category-overview-img { width: 100%; height: 180px; }
}

.category-overview-sublist {
  border-top: 1px solid #f0f0f0;
  padding-top: .75rem;
}
.category-overview-sublist li { padding: .2rem 0; }
.category-overview-sublist a {
  color: #495057;
  text-decoration: none;
}
.category-overview-sublist a:hover { color: var(--brand-color); text-decoration: underline; }

.video-item-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  pointer-events: none;
}

.subcategory-card.active {
  border: 2px solid var(--brand-color);
  box-shadow: 0 0 0 .15rem rgba(13,110,253,.15);
}

.product-card { position: relative; }
.badge-stack {
  position: absolute;
  top: .5rem;
  left: .5rem;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.badge-stack .badge { font-weight: 500; }

/* ---------- Product image swiper in card ---------- */
.product-card .card-img-swiper {
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.product-card .card-img-swiper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-card .card-img-wrap { position: relative; }
.card-img-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.85);
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  color: #333;
  opacity: 0;
  transition: opacity .15s;
}
.product-card:hover .card-img-nav { opacity: 1; }
.card-img-nav-prev { left: 8px; }
.card-img-nav-next { right: 8px; }
.card-img-nav:hover { background: #fff; }

/* ---------- Anchor nav on product page ---------- */
html { scroll-behavior: smooth; }
.product-anchor-nav { gap: .5rem; }
.product-anchor-nav .nav-link {
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 700;
  color: #000;
  background: #f1f3f5;
  border-radius: .5rem;
  padding: .6rem 1.25rem;
}
.product-anchor-nav .nav-link:hover { background: #e2e6ea; color: #000; }

/* ---------- Product description / specifications text ---------- */
#description, #specifications {
  font-size: 1.1rem;
  line-height: 1.7;
}

/* ---------- Product video poster (click-to-play, no lightbox black screen) ---------- */
.video-poster {
  position: relative;
  aspect-ratio: 16 / 9;
  background-color: #212529;
  background-image: linear-gradient(135deg, #343a40, #212529);
  background-size: cover;
  background-position: center;
  border-radius: .5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-poster-play {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255,255,255,.6);
}
.video-poster:hover .video-poster-play { background: rgba(255,255,255,.4); }
.video-poster-player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: .5rem;
  overflow: hidden;
  background: #000;
}
.video-poster-player-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Video thumb in the product page thumbnail row ---------- */
.product-thumb-video {
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-thumb-play {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

/* ---------- Main video embed (product page, replaces main image) ---------- */
#mainMediaContainer #mainProductImage {
  aspect-ratio: 1 / 1;
  width: 100%;
  object-fit: contain;
  background: #f8f9fa;
}
.main-video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: .5rem;
  overflow: hidden;
  background: #000;
}
.main-video-embed iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Video slide inside product card mini-swiper ---------- */
.card-video-slide {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
}
.card-video-slide iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.card-video-poster {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-video-poster .video-poster-play {
  width: 40px;
  height: 40px;
}
.product-thumb { transition: border-color .15s; }
.product-thumb.active { border-color: var(--brand-color) !important; border-width: 2px !important; }
#mainImageLink { cursor: zoom-in; display: block; }
.category-card { transition: box-shadow .15s, transform .15s; }
.category-card:hover { box-shadow: 0 8px 20px rgba(0,0,0,.12); transform: translateY(-2px); }

/* ---------- Admin ---------- */
.admin-sidebar { min-height: 100vh; }
.admin-sidebar .nav-link { color: #cfd6dd; }
.admin-sidebar .nav-link.active,
.admin-sidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,.08); border-radius: .375rem; }
