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

html {
  overflow-y: scroll;
  overscroll-behavior-y: none;
  scroll-behavior: smooth;
}

body {
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  background: var(--tg-theme-bg-color, #171a23);
  color: var(--tg-theme-text-color, #c8ccd8);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--tg-theme-link-color, #96a8d8);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #b8c8f0;
  text-decoration: underline;
}

@media (hover: none) {
  a:hover {
    color: var(--tg-theme-link-color, #96a8d8);
    text-decoration: none;
  }
  a:active {
    opacity: 0.7;
  }
}

/* Header */
.header {
  background: rgba(23, 26, 35, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #252834;
  padding: 14px 0 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header .container {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 16px;
}

.logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--tg-theme-text-color, #eaedf5);
  letter-spacing: -0.3px;
  white-space: nowrap;
  text-align: left;
  padding-bottom: 12px;
}

.nav {
  display: flex;
  border-top: 1px solid #252834;
}

.nav a {
  flex: 1;
  text-align: center;
  color: var(--tg-theme-hint-color, #7a809e);
  font-size: 12px;
  font-weight: 500;
  padding: 10px 0;
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.nav a:hover {
  color: var(--tg-theme-text-color, #eaedf5);
  background: rgba(255, 255, 255, 0.03);
  text-decoration: none;
}

.nav a.active {
  color: #96a8d8;
  border-bottom-color: #96a8d8;
}

@media (hover: none) {
  .nav a:hover {
    color: var(--tg-theme-hint-color, #7a809e);
    background: none;
  }
  .nav a:active {
    color: var(--tg-theme-text-color, #eaedf5);
    background: rgba(255, 255, 255, 0.05);
  }
}

/* Container */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Products */
.products {
  padding: 28px 0 48px;
  flex: 1;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.product-card {
  background: var(--tg-theme-secondary-bg-color, #1e2130);
  border-radius: 14px;
  border: 1px solid #272b3a;
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  border-color: #3a3f56;
}

@media (hover: none) {
  .product-card:hover {
    border-color: #272b3a;
    transform: none;
    box-shadow: none;
  }
  .product-card:active {
    transform: scale(0.98);
    transition-duration: 0.1s;
  }
}

.product-img {
  width: 100%;
  height: 140px;
  background: #1a1d28;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #272b3a;
}

.product-img img {
  width: 56px;
  height: 56px;
  opacity: 0.35;
  filter: invert(1);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.product-card:hover .product-img img {
  opacity: 0.5;
}

.product-info {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-info h3 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 4px;
  color: var(--tg-theme-text-color, #eaedf5);
}

.product-info .specs {
  font-size: 13px;
  line-height: 1.4;
  color: var(--tg-theme-hint-color, #7a809e);
  margin-bottom: 12px;
  flex: 1;
}

.product-info .price {
  font-size: 18px;
  font-weight: 700;
  color: var(--tg-theme-text-color, #eaedf5);
  letter-spacing: -0.3px;
}

/* Company info */
.company-section {
  background: var(--tg-theme-secondary-bg-color, #1e2130);
  border-top: 1px solid #252834;
  padding: 40px 0;
}

.company-section h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--tg-theme-text-color, #eaedf5);
}

/* Company details (about page) */
.company-details {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 8px;
}

.company-details .detail-group {
  padding: 16px 0;
  border-bottom: 1px solid #252834;
}

.company-details .detail-group:last-child {
  border-bottom: none;
}

.company-details .detail-group h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--tg-theme-hint-color, #7a809e);
  margin-bottom: 6px;
  font-weight: 600;
}

.company-details .detail-group p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--tg-theme-text-color, #c8ccd8);
}

/* Footer */
.footer {
  background: #13151c;
  padding: 28px 0 32px;
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
  font-size: 13px;
  border-top: 1px solid #252834;
  margin-top: auto;
}

.footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.footer-top {
  display: flex;
  justify-content: center;
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: #7a809e;
  font-size: 13px;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--tg-theme-link-color, #96a8d8);
  text-decoration: none;
}

@media (hover: none) {
  .footer-links a:hover {
    color: #7a809e;
  }
  .footer-links a:active {
    color: var(--tg-theme-link-color, #96a8d8);
  }
}

.footer-copy {
  text-align: center;
  color: #505570;
  font-size: 12px;
  line-height: 1.5;
}

/* Legal pages */
.legal-page {
  padding: 32px 0 56px;
  flex: 1;
}

.legal-page h1 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
  color: var(--tg-theme-text-color, #eaedf5);
}

.legal-page .updated {
  color: var(--tg-theme-hint-color, #7a809e);
  font-size: 13px;
  margin-bottom: 32px;
}

.legal-page h2 {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  margin-top: 36px;
  margin-bottom: 14px;
  color: #dde0ea;
  padding-bottom: 8px;
  border-bottom: 1px solid #252834;
}

.legal-page h2:first-of-type {
  margin-top: 0;
}

.legal-page p,
.legal-page ul,
.legal-page ol {
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.7;
  color: #a0a5ba;
}

.legal-page ul,
.legal-page ol {
  padding-left: 24px;
}

.legal-page li {
  margin-bottom: 6px;
  line-height: 1.65;
}

.legal-page strong {
  color: #c8ccd8;
  font-weight: 600;
}

.legal-page a {
  color: var(--tg-theme-link-color, #96a8d8);
}

.legal-page a:hover {
  color: #b8c8f0;
}

/* Telegram redirect page */
.tg-redirect {
  position: fixed;
  inset: 0;
  background: #171a23;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.tg-redirect-inner {
  text-align: center;
  padding: 32px;
}

.tg-redirect-logo {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: #1e2130;
  color: #8b9fd4;
  font-size: 40px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  border: 1px solid #252834;
}

.tg-redirect h1 {
  color: #eaedf5;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.tg-redirect p {
  color: #7a809e;
  font-size: 16px;
  margin-bottom: 32px;
}

.tg-redirect-btn {
  display: inline-block;
  background: #fff;
  color: #171a23;
  font-size: 16px;
  font-weight: 600;
  padding: 14px 48px;
  border-radius: 12px;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.tg-redirect-btn:hover {
  opacity: 0.9;
  text-decoration: none;
  color: #171a23;
}

/* Responsive: phones */
@media (max-width: 600px) {
  .container {
    padding: 0 16px;
  }

  .header {
    padding: 14px 0;
  }

  .header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .logo {
    font-size: 17px;
  }

  .nav {
    gap: 16px;
  }

  .nav a {
    font-size: 13px;
    min-height: 36px;
  }

  .products {
    padding: 20px 0 36px;
  }

  .products-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .product-card:hover {
    transform: none;
    box-shadow: none;
  }

  .product-img {
    height: 100px;
  }

  .product-img img {
    width: 40px;
    height: 40px;
  }

  .product-info {
    padding: 12px 12px 14px;
  }

  .product-info h3 {
    font-size: 13px;
    line-height: 1.3;
    margin-bottom: 2px;
  }

  .product-info .specs {
    font-size: 11px;
    margin-bottom: 8px;
  }

  .product-info .price {
    font-size: 15px;
  }

  .footer {
    padding: 24px 0 28px;
  }

  .footer .container {
    text-align: center;
  }

  .footer-links {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .footer-copy {
    font-size: 11px;
  }

  .legal-page {
    padding: 24px 0 40px;
  }

  .legal-page h1 {
    font-size: 20px;
  }

  .legal-page h2 {
    font-size: 15px;
    margin-top: 28px;
    margin-bottom: 12px;
  }

  .legal-page p,
  .legal-page ul,
  .legal-page ol {
    font-size: 13px;
    line-height: 1.65;
  }

  .company-details .detail-group {
    padding: 12px 0;
  }

  .company-details .detail-group p {
    font-size: 13px;
  }
}

/* Extra-small screens (375px) */
@media (max-width: 390px) {
  .container {
    padding: 0 14px;
  }

  .products-grid {
    gap: 8px;
  }

  .product-info {
    padding: 10px 10px 12px;
  }

  .product-info h3 {
    font-size: 12.5px;
  }

  .product-info .specs {
    font-size: 10.5px;
  }

  .product-info .price {
    font-size: 14px;
  }

  .footer-links a {
    font-size: 12px;
  }
}
