* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --blue: #0A84FF;
  --orange: #FF6B00;
  --bg: #111111;
  --surface: #1C1C1E;
  --surface2: #2C2C2E;
  --text: #FFFFFF;
  --text2: #AEAEB2;
  --header: 56px;
}

body {
  background-color: #111;
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(255,107,0,0.06) 0px, rgba(255,107,0,0.06) 1px,
      transparent 1px, transparent 10px
    ),
    repeating-linear-gradient(
      -45deg,
      rgba(255,107,0,0.06) 0px, rgba(255,107,0,0.06) 1px,
      transparent 1px, transparent 10px
    );
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

.app-wrapper {
  background-color: #111;
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(255,107,0,0.04) 0px, rgba(255,107,0,0.04) 1px,
      transparent 1px, transparent 10px
    ),
    repeating-linear-gradient(
      -45deg,
      rgba(255,107,0,0.04) 0px, rgba(255,107,0,0.04) 1px,
      transparent 1px, transparent 10px
    );
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  position: relative;
}

/* ШАПКА — фиксированная */
.header {
  height: var(--header);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid #222;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  cursor: pointer;
  display: flex;
  align-items: center;
}

.logo-img {
  height: 48px;
  width: auto;
  object-fit: contain;
}

/* ГАМБУРГЕР */
.btn-menu {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  width: 36px;
}

.btn-menu span {
  display: block;
  height: 2px;
  background: var(--orange);
  border-radius: 2px;
  transition: all 0.3s;
}

.btn-menu span:first-child { width: 100%; }
.btn-menu span:nth-child(2) { width: 75%; }
.btn-menu span:last-child { width: 50%; }

/* КОРЗИНА */
.btn-cart {
  background: none;
  border: none;
  color: var(--orange);
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  padding: 4px;
}

.cart-count {
  position: absolute;
  top: -2px;
  right: -4px;
  background: var(--orange);
  color: white;
  border-radius: 10px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}

/* БОКОВОЕ МЕНЮ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
}

.sidebar-overlay.open { display: block; }

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  background: #0a0a0a;
  border-right: 1px solid #222;
  z-index: 300;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar.open { transform: translateX(0); }

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #222;
}

.sidebar-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.sidebar-close {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
}

.sidebar-section {
  padding: 20px 16px 8px;
  border-bottom: 1px solid #1a1a1a;
}

.sidebar-label {
  font-size: 11px;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  margin-bottom: 12px;
}

.sidebar-cat-btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
  padding: 10px 0;
  font-size: 15px;
  cursor: pointer;
  border-bottom: 1px solid #1a1a1a;
}

.sidebar-cat-btn:last-child { border-bottom: none; }
.sidebar-cat-btn:active { color: var(--orange); }

.sidebar-link {
  display: block;
  color: var(--text2);
  text-decoration: none;
  padding: 10px 0;
  font-size: 14px;
  border-bottom: 1px solid #1a1a1a;
}

.sidebar-link:last-child { border-bottom: none; }

.sidebar-about {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
  padding: 4px 0;
}

/* КНОПКА НАЗАД НА СТРАНИЦАХ */
.btn-back-page {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 15px;
  cursor: pointer;
  padding: 0 0 16px 0;
  display: block;
}

/* СТРАНИЦЫ */
.page {
  display: none;
  padding: 16px;
  min-height: calc(100vh - var(--header));
}

.page.active { display: block; }

/* КАТЕГОРИИ */
.categories {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: none;
}

.categories::-webkit-scrollbar { display: none; }

.cat-tab {
  background: var(--surface);
  border: 1px solid var(--surface2);
  color: var(--text2);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.cat-tab.active {
  background: var(--orange);
  color: white;
  border-color: var(--orange);
}

/* СПИСОК ТОВАРОВ */
.products {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.product-card {
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
}

.product-card:active { transform: scale(0.97); }

.product-card img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  background: var(--surface2);
  padding: 8px;
}

.product-card .no-photo {
  width: 100%;
  height: 140px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
}

.photo-count {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
}

.card-body { padding: 10px; }

.card-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--orange);
}

.card-stock {
  font-size: 11px;
  color: var(--text2);
  margin-top: 2px;
}

.card-stock.instock { color: #30d158; }

/* КНОПКА КОРЗИНЫ НА КАРТОЧКЕ */
.card-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.card-cart-btn {
  background: none;
  border: none;
  color: var(--orange);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* ИНЛАЙН +/- НА КАРТОЧКЕ */
.card-cart-controls {
  display: none;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  gap: 6px;
}

.card-cart-controls.visible { display: flex; }

.card-confirm-btn {
  background: var(--orange);
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* РАЗДЕЛИТЕЛИ КАТЕГОРИЙ */
.cat-separator {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}

.cat-sep-line {
  flex: 1;
  height: 1px;
}

.cat-sep-line:first-child {
  background: linear-gradient(to right, transparent, rgba(255,107,0,0.5));
}

.cat-sep-line:last-child {
  background: linear-gradient(to left, transparent, rgba(255,107,0,0.5));
}

.cat-separator span {
  font-size: 11px;
  font-weight: 700;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  white-space: nowrap;
}

/* КАРТОЧКА ТОВАРА */
.swiper {
  border-radius: 12px;
  overflow: hidden;
  margin: 0 -16px;
}

.swiper-slide img {
  width: 100%;
  height: 280px;
  object-fit: contain;
  background: var(--surface);
  cursor: zoom-in;
}

.swiper-slide .no-photo {
  width: 100%;
  height: 280px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
}

.swiper-pagination-bullet {
  background: rgba(255,255,255,0.4);
  width: 8px;
  height: 8px;
}
.swiper-pagination-bullet-active { background: var(--orange); }

.swiper-button-next,
.swiper-button-prev {
  color: var(--orange) !important;
  background: rgba(0,0,0,0.4);
  border-radius: 50%;
  width: 36px !important;
  height: 36px !important;
}

.swiper-button-next::after,
.swiper-button-prev::after {
  font-size: 14px !important;
  font-weight: 900;
}

.swiper-button-disabled { opacity: 0.2 !important; }

/* LIGHTBOX */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 999;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 100%;
  max-height: 100vh;
  object-fit: contain;
}

.product-info { padding: 16px 0; }

.product-category {
  font-size: 12px;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.product-name {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
}

.product-desc {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.5;
  margin-bottom: 16px;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.product-price {
  font-size: 26px;
  font-weight: 800;
  color: var(--orange);
}

.product-stock { font-size: 13px; color: var(--text2); }

.product-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.product-qty-total {
  font-size: 20px;
  font-weight: 800;
  color: var(--orange);
}

/* КНОПКИ */
.btn-primary {
  width: 100%;
  background: var(--orange);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-primary:active { opacity: 0.8; }
.btn-primary:disabled {
  background: var(--surface2);
  color: var(--text2);
  cursor: not-allowed;
}

/* КОРЗИНА */
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 16px;
  text-align: center;
}

.empty-cart-icon { width: 80px; height: 80px; }
.cart-content { display: flex; flex-direction: column; gap: 12px; }

.cart-item {
  background: var(--surface);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.cart-item-name { font-size: 14px; font-weight: 600; flex: 1; line-height: 1.3; }

.cart-item-mode {
  margin-top: 3px;
  color: var(--orange);
  font-size: 11px;
  font-weight: 600;
}

.cart-item-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface2);
  border-radius: 8px;
  overflow: hidden;
}

.btn-qty {
  background: none;
  border: none;
  color: var(--orange);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  width: 36px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-value {
  font-size: 14px;
  font-weight: 700;
  min-width: 28px;
  text-align: center;
}

.cart-item-price { font-size: 15px; color: var(--orange); font-weight: 700; }

.btn-remove {
  background: none;
  border: none;
  color: var(--text2);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 4px;
  flex-shrink: 0;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 700;
  padding: 16px;
  background: var(--surface);
  border-radius: 12px;
}

.cart-payable {
  border: 1px solid rgba(255,107,0,0.35);
  color: var(--orange);
}

.token-panel {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(255,107,0,0.25);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,107,0,0.12), var(--surface));
}

.token-panel-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.token-panel-top strong { color: var(--orange); }

.token-panel-note {
  margin-top: 5px;
  color: var(--text2);
  font-size: 12px;
  line-height: 1.4;
}

.btn-token {
  width: 100%;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid var(--orange);
  border-radius: 10px;
  background: transparent;
  color: var(--orange);
  font-size: 14px;
  font-weight: 700;
}

.btn-token.active {
  background: var(--orange);
  color: #fff;
}

.btn-token:disabled {
  border-color: var(--surface2);
  color: var(--text2);
}

.card-compat-row {
  display: flex;
  justify-content: flex-end;
  min-height: 34px;
  margin-top: 4px;
}

.product-offers {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 9px;
}

.offer-block {
  padding: 10px;
  border-radius: 11px;
}

.offer-stock {
  border: 1px solid rgba(255,107,0,0.55);
  background: linear-gradient(145deg, rgba(255,107,0,0.17), rgba(255,107,0,0.06));
}

.offer-preorder {
  border: 1px solid rgba(41,139,235,0.7);
  background: linear-gradient(145deg, rgba(23,116,211,0.3), rgba(13,55,108,0.35));
}

.offer-heading,
.offer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.offer-label {
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.offer-preorder .offer-label { color: #8fc9ff; }
.offer-stock .offer-label { color: #ffad70; }

.offer-price {
  flex: none;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  white-space: nowrap;
}

.offer-note {
  margin: 4px 0 9px;
  color: rgba(255,255,255,0.64);
  font-size: 9px;
  line-height: 1.25;
}

.offer-actions .qty-controls {
  flex: 1;
  min-width: 0;
  background: rgba(0,0,0,0.2);
}

.offer-add {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  min-width: 76px;
  padding: 8px 9px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.offer-add-stock { background: var(--orange); }
.offer-add-preorder { background: #258ce8; }

.stock-unavailable {
  padding: 9px 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.035);
  color: var(--text2);
  font-size: 10px;
  font-weight: 700;
}

@media (max-width: 600px) {
  .offer-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .offer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .offer-actions .qty-controls {
    justify-content: space-between;
    width: 100%;
  }

  .offer-add {
    width: 100%;
  }
}

.btn-preorder-product {
  width: 100%;
  margin-top: 10px;
  padding: 13px 14px;
  border: 1px solid var(--orange);
  border-radius: 12px;
  background: rgba(255,107,0,0.1);
  color: var(--orange);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* ФОРМА ЗАКАЗА */
.order-form { display: flex; flex-direction: column; gap: 16px; }
.order-form h2 { font-size: 20px; }

.order-summary {
  background: var(--surface);
  border-radius: 12px;
  padding: 14px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.8;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; color: var(--text2); }

.form-group input {
  background: var(--surface);
  border: 1px solid var(--surface2);
  border-radius: 10px;
  padding: 14px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus { border-color: var(--orange); }

/* СПЛЭШ ЭКРАН */
@keyframes splash-pulse {
  0%   { opacity: 0; transform: scale(0.88); }
  18%  { opacity: 1; transform: scale(1); }
  45%  { opacity: 1; transform: scale(1); }
  62%  { opacity: 0; transform: scale(0.88); }
  100% { opacity: 0; transform: scale(0.88); }
}

.splash-screen {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.4s ease;
}
.splash-screen.hide { opacity: 0; pointer-events: none; }

.splash-bikes {
  display: grid;
  place-items: center;
}
.splash-bike {
  grid-area: 1 / 1;
  width: 240px;
  height: auto;
  opacity: 0;
}
.splash-monster { animation: splash-pulse 1.1s ease-in-out infinite; }
.splash-u2      { animation: splash-pulse 1.1s ease-in-out infinite 0.55s; }
.splash-label {
  color: #FF6B00;
  font-size: 11px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-top: 28px;
  opacity: 0.55;
}

/* ИКОНКА СОВМЕСТИМОСТИ НА КАРТОЧКЕ */
.compat-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 38px;
  background: rgba(0,0,0,0.55);
  border-radius: 7px;
  padding: 4px 5px 3px;
  backdrop-filter: blur(4px);
}
.compat-badge img {
  width: 100%;
  height: auto;
  display: block;
}
.compat-badge-both {
  width: auto;
  display: flex;
  gap: 3px;
  padding: 3px 5px;
}
.compat-badge-both img {
  width: 32px;
}

/* БЛОК СОВМЕСТИМОСТИ В КАРТОЧКЕ ТОВАРА */
.compat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 4px;
}
.compat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 1;
}
.compat-item img {
  width: 80px;
  height: auto;
  display: block;
}
.compat-item span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.compat-yes img   { opacity: 1; }
.compat-yes span  { color: #4CD964; }
.compat-no img    { opacity: 0.25; filter: grayscale(1); }
.compat-no span   { color: #555; }
.compat-sep {
  font-size: 20px;
  color: #444;
  flex-shrink: 0;
}

/* ЛОАДЕР СИЛУЭТОВ В СЛАЙДЕРЕ */
.loader-bikes {
  display: grid;
  place-items: center;
}
.loader-bike {
  grid-area: 1 / 1;
  width: 160px;
  height: auto;
  opacity: 0;
}
.loader-monster { animation: splash-pulse 1.1s ease-in-out infinite; }
.loader-u2      { animation: splash-pulse 1.1s ease-in-out infinite 0.55s; }

/* УСПЕХ */
.success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  gap: 16px;
  text-align: center;
}

.success-icon { font-size: 72px; }
.success h2 { font-size: 22px; }
.success p { color: var(--text2); }

/* ПОИСК */
#pageCatalog { padding-top: 10px; }

.search-bar {
  padding: 0 0 10px;
}
.search-bar input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 107, 0, 0.22);
  border: 1.5px solid rgba(255, 107, 0, 0.6);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 15px;
  color: var(--text);
  outline: none;
  box-shadow: 0 4px 14px rgba(255, 107, 0, 0.25), 0 2px 4px rgba(0,0,0,0.2);
}
.search-bar input::placeholder { color: rgba(255,107,0,0.6); }
.search-bar input:focus {
  background: rgba(255, 107, 0, 0.28);
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(255, 107, 0, 0.35), 0 2px 5px rgba(0,0,0,0.22);
}

/* АРТИКУЛ В КАРТОЧКЕ ТОВАРА */
.product-sku {
  font-size: 11px;
  color: var(--text2);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* КНОПКА ЗАПРОСА ЗАПЧАСТИ */
.not-found-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 20px 40px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.not-found-text {
  font-size: 13px;
  color: var(--text2);
  margin: 0;
}
.btn-request {
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  max-width: 320px;
}
