@media (max-width: 768px) {
  body {
    font-size: 16px;
    overflow-x: hidden;
  }

  .section-container {
    padding: 15px;
  }

  .header {
    padding: 8px 15px;
    height: 100px;
  }

  .navbar {
    position: relative;
    width: 100%;
    z-index: 1000;
  }

  .navbar-brand {
    font-size: 1.3rem;
  }

  .navbar-nav {
    display: none;
  }

  .navbar-mobile {
    position: fixed;
    top: 60px;
    left: 0;
    width: 100%;
    background: var(--modal-bg);
    backdrop-filter: blur(8px);
    flex-direction: column;
    padding: 20px;
    transition: var(--transition);
    z-index: 999;
    overflow-y: auto;
  }

  .navbar-mobile.active {
    display: block;
  }

  .mobile-nav-item {
    margin: 0.75rem 0;
    width: 100%;
  }

  .mobile-nav-link {
    font-size: 1.1rem;
    color: var(--text-color);
    padding: 0.5rem 1rem;
    text-align: center;
    width: 100%;
    display: block;
    border-bottom: 1px solid var(--card-border);
  }

  .mobile-nav-item:last-child .mobile-nav-link {
    border-bottom: none;
  }

  .burger-menu {
    display: block;
    cursor: pointer;
    font-size: 1.4rem;
    color: var(--text-color);
    z-index: 1001;
  }

  .header .d-flex {
    align-items: center;
    gap: 10px;
  }

  #themeToggle {
    padding: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .desktop-only {
    display: none;
  }

  .floating-action-panel {
    display: none;
  }

  .fab-container {
    position: fixed;
    bottom: 15px;
    right: 15px;
    z-index: 1000;
  }

  .fab-main {
    width: 50px;
    height: 50px;
    background: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: var(--transition);
  }

  .fab-main i {
    color: #fff;
    font-size: 1.5rem;
  }

  .fab-main.active {
    transform: rotate(45deg);
  }

  .fab-items {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 8px;
  }

  .fab-items.active {
    display: flex;
  }

  .fab-item {
    width: 40px;
    height: 40px;
    background: rgb(231, 114, 114);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
  }

  .fab-item i {
    color: var(--text-color);
    font-size: 1rem;
  }

  .fab-item:nth-child(1) {
    transform: translateY(0);
  }

  .fab-item:nth-child(2) {
    transform: translateY(-50px);
  }

  .fab-item:nth-child(3) {
    transform: translateY(-100px);
  }

  .fab-items.active .fab-item {
    transform: translateY(0);
  }

  .hero-section {
    padding: 80px 0 40px;
  }

  .hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 15px;
  }

  .hero-text {
    margin-bottom: 15px;
    width: 100%;
  }

  .hero-title {
    font-size: 1.8rem;
    line-height: 1.2;
    margin-bottom: 0.5rem;
  }

  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }

  .hero-description {
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .stat-card {
    padding: 8px;
    border-radius: 0.5rem;
  }

  .stat-number {
    font-size: 1.2rem;
  }

  .stat-label {
    font-size: 0.7rem;
  }

  .carousel-container {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .carousel-item img {
    height: 180px;
    object-fit: cover;
    border-radius: 0.5rem;
  }

  .carousel-control-prev,
  .carousel-control-next {
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.7;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .carousel-control-prev i,
  .carousel-control-next i {
    font-size: 1.2rem;
  }

  .poligrafiya-content {
    padding: 0;
  }

  .service-slide {
    padding: 15px;
  }

  .service-slide i {
    font-size: 1.8rem;
  }

  .service-slide h4 {
    font-size: 1rem;
  }

  .service-slide p {
    font-size: 0.8rem;
  }

  .services-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .service-card {
    padding: 12px;
    height: auto;
  }

  .service-icon {
    font-size: 1.8rem;
  }

  .service-title {
    font-size: 1rem;
  }

  .service-description {
    font-size: 0.8rem;
  }

  .service-features .feature-item {
    font-size: 0.75rem;
  }

  .comfort-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .comfort-card {
    padding: 12px;
    height: auto;
  }

  .comfort-icon {
    font-size: 1.8rem;
  }

  .comfort-title {
    font-size: 1rem;
  }

  .comfort-description {
    font-size: 0.8rem;
  }

  .products-section {
    padding: 40px 0;
  }

  .product-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  .product-info {
    margin-bottom: 0;
    width: 100%;
  }

  .product-card {
    padding: 12px;
    border-radius: 8px;
    height: auto;
    min-height: 150px;
  }

  .product-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }

  .product-description {
    font-size: 0.8rem;
    line-height: 1.4;
  }

  .video-container {
    width: 100%;
    height: 180px;
    border-radius: 8px;
    overflow: hidden;
  }

  .video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .carousel-controls {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
  }

  .control-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .carousel-indicators-custom {
    gap: 6px;
  }

  .indicator-dot {
    width: 10px;
    height: 10px;
  }

 .team-section {
    padding: 40px 0;
    min-height: auto;
  }

  .team-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 0; /* No gap between cards for seamless transition */
    animation: infiniteScrollLeft 20s linear infinite; /* Left to right scrolling */
    width: max-content;
    padding: 0;
    overflow: hidden;
  }

  .team-grid:hover {
    animation-play-state: paused;
  }

  .team-card {
    width: 100vw; /* Full viewport width for one card per screen */
    height: calc(100vh - 180px); /* Full viewport height minus header and padding */
    flex: 0 0 auto;
    padding: 20px;
    border-radius: 8px;
    background: var(--card-bg);
    backdrop-filter: blur(5px);
    border: 1px solid var(--card-border);
    text-align: center;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .team-card:hover {
    transform: scale(1.02); /* Slightly reduced scale for mobile */
  }

  .team-card img {
    width: 120px; /* Larger image for better visibility */
    height: 120px;
    border-radius: 50%;
    margin-bottom: 1rem;
    border: 3px solid #3b82f6;
    object-fit: cover;
  }

  .team-card h3 {
    font-size: 1.2rem; /* Larger name for readability */
    margin-bottom: 0.5rem;
    color: var(--text-color);
  }

  .team-card p {
    font-size: 0.9rem; /* Larger position text */
    margin-bottom: 0.5rem;
    color: var(--link-color);
  }

  .clients-section {
    padding: 40px 0;
    min-height: auto;
  }

  .infinite-scroll-wrapper {
    overflow: hidden;
    width: 100%;
  }

  .clients-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    animation: infiniteScrollRight 25s linear infinite;
    width: fit-content; /* Use fit-content to avoid extra width */
    padding: 10px 0;
    will-change: transform; /* Optimize animation performance */
  }

  .clients-grid:hover {
    animation-play-state: paused;
  }

  .client-card {
    width: 180px;
    flex: 0 0 auto;
    padding: 12px;
    border-radius: 8px;
    background: var(--card-bg);
    backdrop-filter: blur(5px);
    border: 1px solid var(--card-border);
    text-align: center;
    transition: transform 0.3s ease;
    cursor: pointer;
  }

  .client-card:hover {
    transform: scale(1.1);
  }

  .client-card img {
    max-height: 50px;
    margin-bottom: 0.5rem;
    transition: transform 0.3s ease;
  }

  .client-card:hover img {
    transform: scale(1.1);
  }

  .client-card h3 {
    font-size: 0.95rem;
    color: var(--text-color);
  }

  .client-card p {
    font-size: 0.8rem;
    color: var(--secondary-text-color);
  }

  /* Stats Bar */
  .stats-bar {
    flex-direction: column;
    gap: 10px;
    padding: 15px;
    background: var(--card-bg);
    border-radius: 8px;
    margin-top: 20px;
  }

  .stat-item {
    text-align: center;
  }

  .stats-bar .stat-number {
    font-size: 1.5rem;
    color: var(--link-color);
  }

  .stats-bar .stat-label {
    font-size: 0.8rem;
    color: var(--secondary-text-color);
  }

  .faq-section {
    padding: 40px 0;
    min-height: auto;
  }

  .faq-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: visible;
    animation: none;
  }

  .faq-card {
    padding: 12px;
    border-radius: 8px;
    background: var(--card-bg);
    backdrop-filter: blur(5px);
    border: 1px solid var(--card-border);
    cursor: pointer;
    transition: var(--transition);
  }

  .faq-card:hover {
    transform: translateY(-5px);
  }

  .faq-question {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .faq-question i {
    font-size: 0.9rem;
    color: #3b82f6;
  }

  .faq-answer {
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--secondary-text-color);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
  }

  .faq-card[aria-expanded="true"] .faq-answer {
    max-height: 150px;
    padding-top: 0.75rem;
  }

  .footer-content {
    flex-direction: column;
    gap: 15px;
  }

  .footer-column {
    width: 100%;
  }

  .footer-links li {
    margin: 8px 0;
  }

  .footer-social {
    justify-content: center;
    gap: 12px;
  }

  .social-link {
    font-size: 1.4rem;
  }

  .modal-dialog {
    margin: 8px;
    max-width: 95%;
  }

  .modal-content {
    padding: 12px;
    border-radius: 10px;
  }

  .modal-body {
    font-size: 0.85rem;
  }

  .modal-body img {
    max-height: 70px;
  }

  #locationModal iframe {
    height: 250px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .section-container {
    padding: 25px;
  }

  .navbar-brand {
    font-size: 1.6rem;
  }

  .navbar-mobile {
    width: 300px;
    padding: 20px;
    top: 80px;
  }

  .mobile-nav-item .mobile-nav-link {
    font-size: 1.2rem;
  }

  .mobile-nav-item .btn-modern.btn-red {
    padding: 12px;
    font-size: 1.1rem;
  }

  .hero-section {
    padding: 100px 0 60px;
  }

  .hero-content {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-subtitle {
    font-size: 1.2rem;
  }

  .hero-description {
    font-size: 0.95rem;
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }

  .stat-card {
    padding: 10px;
  }

  .stat-number {
    font-size: 1.4rem;
  }

  .carousel-item img {
    height: 250px;
  }

  .service-slide {
    padding: 20px;
  }

  .service-slide i {
    font-size: 2rem;
  }

  .service-slide h4 {
    font-size: 1.2rem;
  }

  .service-slide p {
    font-size: 0.9rem;
  }

  .services-grid {
    grid-template-columns: 1fr 1fr;
  }

  .service-card {
    padding: 15px;
  }

  .service-title {
    font-size: 1.2rem;
  }

  .service-description {
    font-size: 0.9rem;
  }

  .comfort-grid {
    grid-template-columns: 1fr 1fr;
  }

  .comfort-card {
    padding: 15px;
  }

  .comfort-title {
    font-size: 1.2rem;
  }

  .comfort-description {
    font-size: 0.9rem;
  }

  .product-content {
    flex-direction: row;
    gap: 15px;
  }

  .product-info,
  .video-container {
    width: 50%;
  }

  .product-card {
    padding: 15px;
    height: 200px;
  }

  .product-title {
    font-size: 1.2rem;
  }

  .product-description {
    font-size: 0.9rem;
  }

  .video-container {
    height: 250px;
  }

  .clients-grid {
    grid-template-columns: 1fr 1fr;
    gap: 15px;
  }

  .client-card {
    max-width: 100%;
  }

  .client-logo {
    max-height: 60px;
  }

  .team-grid {
    grid-template-columns: 1fr 1fr;
    gap: 15px;
  }

  .team-card {
    max-width: 100%;
  }

  .team-card img {
    width: 100px;
    height: 100px;
  }

  .team-name {
    font-size: 1.1rem;
  }

  .team-position {
    font-size: 0.9rem;
  }

  .team-description {
    font-size: 0.85rem;
  }

  .faq-grid {
    grid-template-columns: 1fr 1fr;
    gap: 15px;
  }

  .faq-question {
    font-size: 1rem;
  }

  .faq-answer {
    font-size: 0.9rem;
  }

  .footer-content {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 20px;
  }

  .footer-column {
    width: 50%;
  }

  #locationModal iframe {
    height: 350px;
  }
}

@keyframes infiniteScrollLeft {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(0); }
}

@keyframes infiniteScrollRight {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}