/* Responsive styles */

/* Large tablets and small desktops */
@media (max-width: 1200px) {
  :root {
    --page-padding: 20px;
  }

  .container {
    padding: 0 20px;
  }
  
  .carousel .card {
    flex-basis: 100%;
  }
  .carousel .card img {
    height: 380px;
  }
  .carousel-hero {
    padding: 70px 0 44px;
  }
  .carousel-hero.carousel-full {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  .carousel-hero .carousel-viewport {
    overflow: hidden;
    width: 100%;
  }
  .carousel-hero .carousel-track {
    padding: 0;
    gap: 0;
  }
  .carousel-hero .hero-slide {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
  }
  .hero-slide {
    padding: 64px 64px;
    min-height: 420px;
  }
  .hero-slide h2 {
    font-size: 46px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #ffffff;
    /* Balanced readable text styling */
    text-shadow: 
      0 2px 16px rgba(0, 0, 0, 0.5),
      0 1px 8px rgba(0, 0, 0, 0.6),
      0 4px 20px rgba(0, 0, 0, 0.35);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }
  .hero-slide p {
    font-size: 19px;
    font-weight: 700;
    color: #ffffff;
    /* Balanced readable text styling */
    text-shadow: 
      0 1px 12px rgba(0, 0, 0, 0.45),
      0 1px 6px rgba(0, 0, 0, 0.55),
      0 3px 16px rgba(0, 0, 0, 0.3);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }
  .pricing-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .pricing-all-floating {
    display: none;
  }
  .tariff-speed span {
    font-size: 36px;
  }
  .news {
    padding: 80px 0;
  }
  .news-inner {
    gap: 36px;
  }
  .news-item {
    grid-template-columns: minmax(130px, 180px) minmax(0, 1fr);
    padding: 20px 24px;
  }
}

/* Tablets */
@media (max-width: 1024px) {
  :root {
    --page-padding: 16px;
  }

  .container {
    padding: 0 16px;
  }
  .pricing-layout__aside[data-pricing-arrow] {
    position: static;
    transform: none;
    margin-top: 20px;
    pointer-events: auto;
  }
  
}

/* Tablets (narrow) - improve addon-callout layout */
@media (max-width: 990px) {
  .addon-callout {
    padding: 24px;
    gap: 20px;
  }

  .addon-content {
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: start;
  }

  .addon-callout .addon-head {
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: start;
  }

  .addon-callout .addon-head__side {
    width: 100%;
    justify-items: start;
  }

  .addon-callout .addon-head__side .btn {
    justify-self: start;
    width: 100%;
  }

  .addon-callout .addon-price-aside {
    width: 100%;
    min-width: 0;
  }

  .addon-callout .addon-features {
    grid-template-columns: 1fr;
  }

  .addon-cta-mobile-wrapper {
    display: none;
  }
}

/* Tablets in landscape orientation - Hide background settings button (1025px - 1366px) */
@media (min-width: 1025px) and (max-width: 1366px) {
  /* Prevent horizontal scrolling */
  html {
    overflow-x: clip;
    max-width: 100vw;
  }
  
  /* Hide background settings button on tablets in landscape */
  .bg-settings-toggle {
    display: none !important;
  }
  
  /* Fix footer bottom to prevent overflow */
  .footer-bottom {
    flex-wrap: wrap;
    gap: 12px;
    min-width: 0;
  }
  
  .footer-links {
    flex-wrap: wrap;
    gap: 12px;
    min-width: 0;
  }
  
  .footer-icon-link {
    flex-shrink: 0;
    min-width: 42px;
  }
  
  /* Ensure footer doesn't overflow */
  .site-footer {
    max-width: 100vw;
  }
  
  .about .facts-cloud {
    width: 100%;
    margin-left: 0;
    background: transparent;
    box-sizing: border-box;
  }
  
  /* Убираем любой фон у секции about на планшетах */
  .about {
    background: transparent !important;
  }
  
  .about-inner {
    background: transparent !important;
  }
  
  .pricing-layout {
    width: 100%;
    margin-left: 0;
  }
  
  /* Ensure container doesn't overflow */
  /* Убрали overflow-x: hidden, так как оно создает новый контекст наложения и влияет на фон */
  /* Используем overflow-x: clip на html (уже есть в base.css) для предотвращения горизонтальной прокрутки */
  .container {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }
  
  /* Prevent images and media from causing overflow */
  img, video, iframe {
    max-width: 100%;
    height: auto;
  }
  
  /* Fix carousel for tablets in landscape */
  .carousel-hero {
    padding: 70px 0 44px;
  }
  .carousel-hero.carousel-full {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  .carousel-hero .carousel-viewport {
    overflow: hidden;
    width: 100%;
  }
  .carousel-hero .carousel-track {
    padding: 0;
    gap: 0;
  }
  .carousel-hero .hero-slide {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
  }
  
  /* Improve text visibility on tablets in landscape */
  .hero-slide h2 {
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #ffffff;
    /* Balanced readable text styling */
    text-shadow: 
      0 2px 16px rgba(0, 0, 0, 0.5),
      0 1px 8px rgba(0, 0, 0, 0.6),
      0 4px 20px rgba(0, 0, 0, 0.35);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }
  .hero-slide p {
    font-weight: 700;
    color: #ffffff;
    /* Balanced readable text styling */
    text-shadow: 
      0 1px 12px rgba(0, 0, 0, 0.45),
      0 1px 6px rgba(0, 0, 0, 0.55),
      0 3px 16px rgba(0, 0, 0, 0.3);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }
  
    /* Tariffs use inline arrow on tablet/desktop widths. */
    .pricing-all-mobile {
      display: none !important;
    }
  
}

/* Tablets - Desktop navigation style (801px - 1024px) */
@media (min-width: 801px) and (max-width: 1024px) {
  /* Prevent horizontal scrolling */
  /* Используем clip на html в base.css, body не ограничиваем по overflow-x */
  
  /* Tariffs use inline arrow on tablet/desktop widths. */
  .pricing-all-mobile {
    display: none !important;
  }
  
  /* Hide background settings button */
  .bg-settings-toggle {
    display: none !important;
  }
}

/* Tablets - Mobile menu style (641px - 800px) */
@media (min-width: 641px) and (max-width: 800px) {
  /* Prevent horizontal scrolling */
  /* Используем clip на html в base.css, body не ограничиваем по overflow-x */
  
  /* Tariffs use inline arrow on tablet/desktop widths. */
  .pricing-all-mobile {
    display: none !important;
  }
  
  /* Hide background settings button */
  .bg-settings-toggle {
    display: none !important;
  }
  
  .about .facts-cloud {
    width: 100%;
    margin-left: 0;
    box-sizing: border-box;
  }
  
  .pricing-layout {
    width: 100%;
    margin-left: 0;
  }
  
  /* Ensure container doesn't overflow */
  .container {
    max-width: 100%;
  }
  
  /* Prevent images and media from causing overflow */
  img, video, iframe {
    max-width: 100%;
    height: auto;
  }

  /* Hero adjustments */
  .hero {
    padding: 80px 0 48px;
  }
  .hero h1 {
    font-size: 48px;
  }
  .hero-features {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
  .carousel-hero {
    padding: 60px 0 40px;
  }
  .carousel-hero.carousel-full {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  .carousel-hero .carousel-viewport {
    overflow: hidden;
    width: 100%;
  }
  .carousel-hero .carousel-track {
    padding: 0;
    gap: 0;
  }
  .carousel-hero .hero-slide {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
  }
  .hero-slide {
    padding: 56px 48px;
    min-height: 400px;
  }
  .hero-slide h2 {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #ffffff;
    /* Balanced readable text styling */
    text-shadow: 
      0 2px 16px rgba(0, 0, 0, 0.5),
      0 1px 8px rgba(0, 0, 0, 0.6),
      0 4px 20px rgba(0, 0, 0, 0.35);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }
  .hero-slide p {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    /* Balanced readable text styling */
    text-shadow: 
      0 1px 12px rgba(0, 0, 0, 0.45),
      0 1px 6px rgba(0, 0, 0, 0.55),
      0 3px 16px rgba(0, 0, 0, 0.3);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }

  /* Cards and sections */
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .service-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .about .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .site-footer--dark .footer-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-docs h4 {
    font-size: 20px;
  }
  .footer-docs-links {
    grid-template-columns: 1fr;
  }
  .site-footer--dark .footer-city {
    grid-column: auto;
    grid-row: auto;
  }
  .site-footer--dark .footer-docs {
    grid-column: 1 / -1;
    grid-row: auto;
  }
  .carousel .card {
    flex-basis: 100%;
  }
  .carousel .card img {
    height: 340px;
  }
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  .pricing-all-floating {
    position: static;
    transform: none;
    margin-top: 12px;
    justify-content: flex-end;
  }
  .tariff-speed span {
    font-size: 34px;
  }
  .news-subtitle {
    font-size: 18px;
  }
  .section-head p {
    font-size: 18px;
  }
  .news-item {
    padding: 20px;
    gap: 20px;
  }
  .news-item__content {
    gap: 18px;
  }
  /* About */
  .about-layout {
    grid-template-columns: 1fr;
  }
  .about-accordion__panel {
    padding-left: 56px;
  }
}

/* Small tablets */
@media (max-width: 768px) {
  :root {
    --page-padding: 12px;
  }

  .container {
    padding: 0 12px;
  }
  
  /* Hero */
  .hero {
    padding: 64px 0 40px;
  }
  .hero h1 {
    font-size: 40px;
  }
  .hero p {
    font-size: 16px;
  }
  .hero-cta {
    flex-direction: column;
    gap: 12px;
  }
  .hero-features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .carousel-hero {
    padding: 50px 0 36px;
  }
  .carousel-hero.carousel-full {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  .carousel-hero .carousel-viewport {
    overflow: hidden;
    width: 100%;
  }
  .carousel-hero .carousel-track {
    padding: 0;
    gap: 0;
  }
  .carousel-hero .hero-slide {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
  }
  .hero-slide {
    padding: 44px 32px;
    min-height: 360px;
  }
  .hero-slide h2 {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #ffffff;
    /* Balanced readable text styling */
    text-shadow: 
      0 2px 16px rgba(0, 0, 0, 0.5),
      0 1px 8px rgba(0, 0, 0, 0.6),
      0 4px 20px rgba(0, 0, 0, 0.35);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }
  .hero-slide p {
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    /* Balanced readable text styling */
    text-shadow: 
      0 1px 12px rgba(0, 0, 0, 0.45),
      0 1px 6px rgba(0, 0, 0, 0.55),
      0 3px 16px rgba(0, 0, 0, 0.3);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }
  .btn-hero {
    padding: 12px 24px;
  }

  /* Sections */
  .section-head h2 {
    font-size: 24px;
  }
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .service-cards {
    grid-template-columns: 1fr;
  }
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  .tariff-head {
    gap: 8px;
  }
  .tariff-icon {
    width: 38px;
    height: 38px;
  }
  .tariff-speed span {
    font-size: 32px;
  }
  .about .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .stat {
    padding: 16px;
  }
  .carousel .card {
    flex-basis: 100%;
  }
  .carousel .card img {
    height: 300px;
  }
  .bundle-switch {
    width: 100%;
    justify-content: space-between;
  }
  .bundle-switch__btn {
    flex: 1;
    text-align: center;
  }
  .bundle-extra__price {
    font-size: 13px;
  }
  .bundle-toggle {
    grid-template-columns: auto auto;
    gap: 8px;
  }
  .antivirus-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .antivirus-card {
    padding: 18px;
  }
  .addon-callout {
    grid-template-columns: 1fr;
    padding: 20px;
    backdrop-filter: blur(10px);
  }
  .addon-content {
    grid-template-columns: auto 1fr; /* icon + content */
    gap: 12px;
    align-items: start;
  }
  /* Keep normal structure for heading */
  .addon-callout .addon-head { 
    grid-template-columns: 1fr auto; 
    align-items: start; 
    grid-template-rows: auto auto auto; /* h3, p, features+price */
  }
  /* Flatten addon-head__text to allow features to escape, but keep h3 and p in normal position */
  .addon-callout .addon-head__text {
    display: contents;
  }
  /* Heading in column 1, row 1 */
  .addon-callout .addon-head__text h3 {
    grid-column: 1;
    grid-row: 1;
    margin: 0 0 8px;
  }
  /* Subtitle in column 1, row 2 */
  .addon-callout .addon-head__text p {
    grid-column: 1;
    grid-row: 2;
    margin: 0;
  }
  /* Features start from left edge (column 1 of addon-head, row 3) */
  .addon-callout .addon-features {
    grid-column: 1;
    grid-row: 3;
    margin-top: 16px;
    margin-left: calc(-1 * (var(--page-padding, 24px) + 20px + 12px + 48px + 12px)); /* negative margin to reach left edge */
    padding-left: calc(var(--page-padding, 24px) + 20px + 12px + 48px + 12px); /* restore padding */
    width: calc(100% + var(--page-padding, 24px) + 20px + 12px + 48px + 12px);
  }
  /* Price on same level as features but in column 2 */
  .addon-callout .addon-head__side { 
    grid-column: 2; 
    grid-row: 3; 
    align-self: start; 
    margin-top: 16px; 
  }
  /* Full-width CTA below */
  .addon-callout .addon-cta { 
    grid-column: 1 / -1; 
    width: calc(100% + var(--page-padding, 24px) + 20px); 
    margin-left: calc(-1 * (var(--page-padding, 24px) + 20px)); /* negative margin to reach left edge */
    padding-left: calc(var(--page-padding, 24px) + 20px); /* restore padding */
    justify-self: stretch; 
    display: inline-flex; 
  }
  .addon-callout .addon-cta-mobile-wrapper {
    grid-column: 1 / -1;
    grid-row: 4;
    width: 100%;
  }
  .addon-callout .addon-cta {
    width: 100%;
    margin-left: 0;
    padding-left: 0;
  }
  .addon-cta-desktop { display: none; }
  .addon-cta-mobile-wrapper { display: grid; }
  .addon-features { gap: 12px; }
  .addon-line { min-height: auto; }
  .addon-line__text strong { font-size: 16px; }
  .addon-line__text span { font-size: 14px; }
  .addon-body h3 { font-size: 24px; }
  .addon-price-aside { padding: 12px 14px; backdrop-filter: blur(4px); }
  .addon-price-aside__value { font-size: 32px; }
  .addon-icon {
    width: 48px;
    height: 48px;
  }
  .addon-callout .btn {
    justify-self: stretch;
  }
  .news {
    padding: 64px 0;
  }
  .news-inner {
    gap: 28px;
  }
  .news-subtitle {
    font-size: 17px;
  }
  .section-head p {
    font-size: 17px;
  }
  .news-item {
    grid-template-columns: 1fr;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 20px;
  }
  .news-item__meta {
    order: -1;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px 12px;
    font-size: 13px;
  }
  .news-item__meta time {
    font-size: 15px;
  }
  .news-item__content {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .news-item__arrow {
    width: 32px;
    height: 32px;
  }
  /* Footer */
  .footer-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .site-footer--dark .footer-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .footer-docs-list {
    gap: 24px;
  }
  .footer-docs-links {
    grid-template-columns: 1fr;
  }
  .footer-docs-group-title {
    font-size: 14px;
  }
  .site-footer--dark .footer-city {
    grid-column: auto;
    grid-row: auto;
  }
  .site-footer--dark .footer-docs {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

/* Mobile devices */
@media (max-width: 640px) {
  :root {
    --page-padding: 16px;
  }

  .container {
    padding: 0 16px;
  }

  /* Hero */
  .hero {
    padding: 48px 0 32px;
  }
  .hero--split {
    padding: 56px 0;
  }
  .hero h1 {
    font-size: 32px;
    line-height: 1.1;
  }
  .hero p {
    font-size: 15px;
  }
  .hero-cta {
    gap: 8px;
  }
  .hero-features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
  }
  .hero-card {
    padding: 24px;
    border-radius: 22px;
  }
  .hero-card__badge {
    font-size: 12px;
    padding: 6px 12px;
  }
  .hero-card__features {
    gap: 8px;
  }
  .hero-card__features li {
    padding: 10px 12px;
    gap: 12px;
    border-radius: 16px;
  }
  .hero-card__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }
  .hero-card h1 {
    font-size: 30px;
  }
  .hero-card h2 {
    font-size: 26px;
  }
  .hero-card__features h3 {
    font-size: 16px;
  }
  .hero-card__features p {
    font-size: 13px;
  }
  .hero-features .feature:nth-child(3) {
    grid-column: 1 / -1;
  }
  /* Pill-style cards specifically for hero features */
  .hero-features .feature {
    padding: 16px 18px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    text-align: center;
    align-items: center;
    background: linear-gradient(135deg, #f9fbff 0%, #eef4ff 100%);
    border: 1px solid #e6eaf5;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.08);
  }
  .hero-features .feature .feature-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto;
    grid-row: auto;
    background: #fff;
    border: 1px solid #e6eaf5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  }
  .hero-features .feature h3 {
    font-size: 17px;
    font-weight: 700;
    margin: 0;
  }
  .hero-features .feature p {
    font-size: 15px;
    margin: 0;
    color: var(--muted);
  }

  /* Sections */
  .section-head {
    margin-bottom: 20px;
  }
  .section-head h2 {
    font-size: 22px;
  }
  .cards {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .service-cards {
    grid-template-columns: 1fr;
  }
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  .tariff-icon {
    width: 36px;
    height: 36px;
  }
  .tariff-speed span {
    font-size: 30px;
  }
  .tariff-note::after {
    min-width: 200px;
    max-width: 240px;
  }
  .about .stats {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .stat {
    padding: 16px;
  }
  .stat-num {
    font-size: 20px;
  }
  .carousel-btn.prev {
    left: 4px;
  }
  .carousel-btn.next {
    right: 4px;
  }
  .carousel .card img {
    height: 260px;
  }
  .bundle-switch {
    flex-direction: column;
    padding: 6px;
    gap: 6px;
  }
  .bundle-switch__btn {
    width: 100%;
  }
  .bundle-extra__chips {
    gap: 6px;
  }

  .bundle-overlay__dialog {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 24px;
  }

  .bundle-overlay__media {
    width: 64px;
    height: 64px;
    justify-self: flex-start;
  }

  .bundle-overlay__title {
    font-size: 22px;
  }

  .bundle-overlay__chips {
    gap: 8px;
  }

  .bundle-overlay__action {
    width: 100%;
  }

  .bundle-dock {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px;
  }

  .bundle-dock__media {
    width: 60px;
    height: 60px;
  }

  .bundle-dock__title {
    font-size: 20px;
  }

  .bundle-dock__text {
    font-size: 13px;
  }
  .antivirus-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .antivirus-card {
    padding: 16px;
  }
  .antivirus-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .antivirus-actions .btn {
    width: 100%;
  }
  .addon-callout {
    padding: 18px;
    gap: 12px;
  }
  /* Иконка телефона перед заголовком и подзаголовком */
  .addon-content {
    grid-template-columns: auto 1fr; /* иконка + контент */
    gap: 12px;
    align-items: start;
  }
  .addon-icon {
    display: flex; /* показываем иконку на мобильных */
    width: 44px;
    height: 44px;
    min-width: 44px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    align-self: start; /* выравниваем по верху, на уровне заголовка */
    margin-top: 0;
  }
  /* Структура: заголовок+подзаголовок на всю ширину, затем пункты слева и цена справа на одном уровне, кнопка под ними */
  .addon-callout .addon-head {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto auto; /* h3, p, features+price, button */
    gap: 0;
    align-items: start;
  }
  /* Используем display: contents чтобы вынести элементы из addon-head__text */
  .addon-callout .addon-head__text {
    display: contents;
  }
  /* Заголовок на всю ширину */
  .addon-callout .addon-head__text h3 {
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100%;
    margin: 0 0 8px;
    font-size: 20px;
  }
  /* Подзаголовок на всю ширину */
  .addon-callout .addon-head__text p {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    margin: 0 0 24px; /* разделитель между заголовком и остальным контентом */
  }
  /* Пункты слева, на уровне иконки (выходят за пределы grid-колонки addon-body) */
  .addon-callout .addon-features {
    grid-column: 1;
    grid-row: 3;
    width: calc(100% + 44px + 12px); /* ширина + иконка + gap */
    margin-top: 0;
    margin-left: calc(-1 * (44px + 12px)); /* отрицательный отступ = иконка + gap, чтобы начать на уровне иконки */
    padding-left: 0;
    gap: 16px;
    align-self: start; /* выравниваем по верху */
  }
  .addon-callout .addon-line {
    grid-template-columns: 36px 1fr; /* уменьшаем размер иконки в пунктах */
    gap: 12px;
    min-height: auto;
    padding: 0;
  }
  .addon-callout .addon-dot {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
  }
  .addon-callout .addon-line__text {
    width: 100%;
  }
  .addon-callout .addon-line__text strong { 
    font-size: 15px; 
  }
  .addon-callout .addon-line__text span { 
    font-size: 13px; 
  }
  /* Цена справа от пунктов, на том же уровне (grid-row: 3) */
  .addon-callout .addon-head__side {
    grid-column: 2;
    grid-row: 3;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-end;
    align-self: start; /* выравниваем по верху, на уровне пунктов */
    margin-left: 16px;
    margin-top: 0;
    justify-self: end;
  }
  .addon-callout .addon-price-aside {
    align-self: flex-end;
  }
  /* Кнопка под пунктами и ценой (grid-row: 4) */
  .addon-callout .addon-cta { 
    grid-column: 1 / -1;
    grid-row: 4;
    display: inline-flex;
    width: calc(100% + 44px + 12px); /* на всю ширину, включая область иконки */
    margin-left: calc(-1 * (44px + 12px)); /* выравниваем с пунктами */
    padding: 14px 20px !important; /* фиксируем padding, чтобы кнопка не увеличивалась */
    justify-content: center;
    font-size: 20px; /* увеличиваем размер текста на мобильных */
    line-height: 1.3; /* улучшаем читаемость */
    min-height: auto; /* убираем минимальную высоту */
  }
  .addon-callout .addon-cta-mobile-wrapper {
    grid-column: 1 / -1;
    grid-row: 4;
    width: 100%;
  }
  .addon-callout .addon-cta {
    width: 100%;
    margin-left: 0;
  }
  .addon-cta-desktop { 
    display: none; 
  }
  .addon-body h3 { 
    font-size: 20px; 
  }
  .addon-price-aside__value { 
    font-size: 28px; 
  }
  .addon-callout .btn {
    width: 100%;
  }
  .news {
    padding: 56px 0;
  }
  .news-title {
    font-size: 22px;
    padding-left: 0;
  }
  .news-title::before {
    width: 50px;
  }
  .news-subtitle {
    font-size: 15px;
  }
  .section-head p {
    font-size: 15px;
  }
  .news-item {
    padding: 16px 18px;
    gap: 14px;
  }
  .news-item__arrow {
    display: none; /* Убираем стрелку на мобильных, весь блок новости кликабельный */
  }
  .news-item__title {
    font-size: 20px;
  }
  .news-footer {
    justify-content: center;
  }
  .news-view-all {
    width: 100%;
    text-align: center;
  }
  /* About */
  .about {
    padding: 64px 0 !important;
  }
  .about-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .about-accordion__item summary {
    padding: 14px;
  }
  .about-accordion__panel {
    padding: 0 14px 14px 54px;
  }

  /* Services tabs */
  .tabs {
    padding: 8px;
  }
  .tablist {
    flex-direction: column;
    gap: 4px;
  }
  .tablist [role="tab"] {
    padding: 12px;
  }

  /* Contacts */
  .contacts .grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Footer */
  .footer-top {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .site-footer--dark .footer-top {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .site-footer--dark .footer-card {
    padding: 18px;
  }
  .footer-docs h4 {
    font-size: 18px;
  }
  .footer-docs-list {
    gap: 20px;
  }
  .footer-docs-links {
    gap: 8px;
    grid-template-columns: 1fr;
  }
  .footer-links {
    justify-content: center;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  .footer-bottom .footer-controls {
    justify-content: center;
  }
  .footer-icon-link {
    order: -1;
    width: 54px;
    height: 54px;
  }
  .site-footer--dark .footer-docs {
    grid-column: auto;
    grid-row: auto;
  }
  .footer-about {
    padding-inline: 28px;
  }
  .footer-docs {
    padding-inline: 28px;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  :root {
    --page-padding: 12px;
  }

  .container {
    padding: 0 12px;
  }
  
  /* Keep the 2-column look, third spans full width */
  .hero-features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .hero-features .feature:nth-child(3) {
    grid-column: 1 / -1;
  }
  .hero-features .feature {
    padding: 14px 16px;
  }
  .hero-features .feature .feature-icon {
    width: 52px;
    height: 52px;
  }


  .section-head h2 {
    font-size: 20px;
  }

  .btn {
    padding: 10px 14px;
    font-size: 14px;
  }

  /* На очень маленьких экранах: пункты слева, цена справа на том же уровне, кнопка под ними */
  .addon-callout .addon-head {
    grid-template-columns: 1fr auto; /* сохраняем две колонки: пункты и цена */
    grid-template-rows: auto auto auto auto; /* h3, p, features+price, button */
  }
  .addon-callout .addon-head__text {
    display: contents;
  }
  .addon-callout .addon-head__text h3 {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .addon-callout .addon-head__text p {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-bottom: 24px;
  }
  /* Пункты остаются на уровне иконки */
  .addon-callout .addon-features {
    grid-column: 1;
    grid-row: 3;
    width: calc(100% + 44px + 12px);
    margin-left: calc(-1 * (44px + 12px));
    align-self: start;
  }
  /* Цена справа от пунктов, на том же уровне (grid-row: 3) */
  .addon-callout .addon-head__side {
    grid-column: 2;
    grid-row: 3;
    margin-left: 12px; /* небольшой отступ от пунктов */
    margin-top: 0;
    align-items: flex-end;
    align-self: start; /* выравниваем по верху, на уровне пунктов */
    width: auto;
    justify-self: end;
  }
  /* Кнопка под пунктами и ценой (grid-row: 4) */
  .addon-callout .addon-cta {
    grid-column: 1 / -1;
    grid-row: 4;
    margin-left: calc(-1 * (44px + 12px)); /* кнопка на уровне иконки */
    width: calc(100% + 44px + 12px);
    font-size: 18px; /* увеличиваем размер текста на очень маленьких экранах */
    padding: 14px 20px !important; /* фиксируем padding, чтобы кнопка не увеличивалась */
    line-height: 1.3; /* улучшаем читаемость */
    min-height: auto; /* убираем минимальную высоту */
  }
  .addon-callout .addon-cta-mobile-wrapper {
    grid-column: 1 / -1;
    grid-row: 4;
    width: 100%;
  }
  .addon-callout .addon-cta {
    width: 100%;
    margin-left: 0;
  }

  .footer-about {
    padding-inline: 24px;
  }
  .footer-docs {
    padding-inline: 24px;
  }
}

@media (max-width: 360px) {
  .hero-features {
    grid-template-columns: 1fr;
  }
  .hero-features .feature:nth-child(3) {
    grid-column: auto;
  }
}

@media (min-width: 1024px) {
  .contact-fab {
    display: inline-flex;
  }
}

@media (max-width: 1023px) {
  .contact-fab {
    display: none;
  }
}


/* Medium screens: restore footer horizontal padding (641px - 1365px) */
@media (min-width: 641px) and (max-width: 1365px) {
  .site-footer .container {
    padding-left: clamp(12px, 2vw, 24px);
    padding-right: clamp(12px, 2vw, 24px);
  }
}

/* Fix for 1366px and above - prevent overflow and horizontal scrolling */
@media (min-width: 1366px) {
  /* Prevent horizontal scrolling */
  html {
    overflow-x: clip;
    max-width: 100vw;
  }
  
  /* Fix footer bottom to prevent overflow */
  .footer-bottom {
    flex-wrap: wrap;
    gap: 12px;
    min-width: 0;
  }
  
  .footer-links {
    flex-wrap: wrap;
    gap: 12px;
    min-width: 0;
  }
  
  .footer-links a {
    font-size: clamp(12px, 1vw, 14px);
    white-space: nowrap;
  }
  
  /* Fix contact-fab to not overflow */
  .contact-fab {
    right: max(12px, min(24px, 2vw));
    bottom: max(12px, min(24px, 2vw));
  }
  
  /* Ensure container doesn't overflow */
  .container {
    max-width: min(100%, var(--container-max, 1200px));
    padding-left: clamp(16px, 2vw, 24px);
    padding-right: clamp(16px, 2vw, 24px);
  }
  
  /* Fix pricing layout */
  .pricing-layout {
    width: 100%;
    margin-left: 0;
    max-width: 100%;
  }
  
  /* Fix footer icon link to prevent overflow */
  .footer-icon-link {
    flex-shrink: 0;
    min-width: 42px;
  }
  
  /* Prevent images and media from causing overflow */
  img, video, iframe {
    max-width: 100%;
    height: auto;
  }
  
  /* Ensure footer doesn't overflow */
  .site-footer {
    max-width: 100vw;
  }
}


@media (max-width: 960px) {
  .bundle-overlay__dialog {
    grid-template-columns: 1fr;
    padding: 28px;
  }

  .bundle-overlay__media {
    width: 72px;
    height: 72px;
  }

  .bundle-dock {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .pricing-layout__spacer {
    display: none;
  }

  .pricing-grid {
    margin: 0 auto;
  }

  .pricing-layout__aside[data-pricing-arrow] {
    display: none;
  }

  .pricing-all-mobile:not([hidden]) {
    display: block;
    padding: 0 var(--page-padding, 16px);
  }
}

@media (max-width: 639px) {
  .carousel-btn {
    display: none;
  }
}

/* Tariffs: use inline arrow above mobile breakpoint and hide mobile CTA */
@media (min-width: 641px) {
  .pricing-all-mobile {
    display: none !important;
  }
}

/* Stacked tariffs keep the plain constructor button. */
@media (max-width: 800px) {
  .pricing-all-mobile:not([hidden]) {
    display: block !important;
    width: min(100%, 420px);
    margin: 28px auto 0;
    padding: 0 var(--page-padding, 16px);
  }
}

/* Three cards in a row: one shelf under the whole group. */
@media (min-width: 801px) {
  .tariff-shelf {
    display: grid;
  }

  .pricing-all-mobile {
    display: none !important;
  }
}

/* City phone card: allow full-width mobile CTA without icon column affecting bottom row */
@media (max-width: 768px) {
  .addon-callout--city-phone .addon-content {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 16px 12px;
    align-items: start;
  }

  .addon-callout--city-phone .addon-head {
    margin-bottom: 0;
  }

  .addon-callout--city-phone .addon-icon {
    grid-column: 1;
    grid-row: 1;
  }

  .addon-callout--city-phone .addon-body {
    grid-column: 2;
    grid-row: 1;
  }

  .addon-callout--city-phone .addon-cta-mobile-wrapper {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .addon-callout--city-phone .addon-cta {
    width: 100%;
    margin-left: 0;
  }
}

/* City phone card: align icon with title only, keep body full-width on tablets */
@media (min-width: 769px) and (max-width: 990px) {
  .addon-callout--city-phone .addon-content {
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: start;
  }

  .addon-callout--city-phone .addon-icon {
    grid-column: 1;
    grid-row: 1;
    z-index: 3;
  }

  .addon-callout--city-phone .addon-body {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .addon-callout--city-phone .addon-head__text h3 {
    padding-left: calc(64px + 14px);
    min-height: 64px;
    display: flex;
    align-items: center;
  }
}
