/* Адаптивные стили для всех устройств */

/* Планшеты (992px - 768px) */
@media (max-width: 991.98px) {
  /* Header */
  .site-header {
    padding: 10px 15px;
  }
  
  .site-header .logo img {
    height: 50px;
  }
  
  /* Navigation */
  .site-header nav {
    flex-direction: column;
    align-items: flex-end !important;
  }
  
  .site-header nav .me-4 {
    margin-bottom: 10px;
    margin-right: 0 !important;
  }
  
  .site-header nav .me-4 a {
    font-size: 14px;
    margin: 0 8px !important;
  }
  
  /* Hero section */
  .hero {
    flex-direction: column;
  }
  
  .hero-left {
    flex-basis: auto;
    padding: 2rem;
    min-height: 200px;
  }
  
  .hero-right {
    height: 40vh;
  }
  
  /* Business blocks */
  .business-block {
    padding: 24px 0;
  }
  
  .business-block .col-lg-5,
  .business-block .col-lg-7 {
    margin-bottom: 20px;
  }
  
  .business-title {
    font-size: 1.3rem !important;
  }
  
  /* Contact section */
  .contact-section .row > [class*='col-'] {
    margin-bottom: 18px;
  }
  
  /* Footer */
  footer .col-lg-4 {
    text-align: center !important;
    margin-bottom: 20px;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }
  
  /* Социальные ссылки - горизонтальное расположение на планшетах */
  footer .col-lg-4:nth-child(3) > div:last-child {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 15px !important;
    width: 100% !important;
  }
  
  footer .col-lg-4:nth-child(3) > div:last-child > a > div {
    width: 38px !important;
    height: 38px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  footer .col-lg-4:nth-child(3) > div:last-child > a > div i {
    font-size: 20px !important;
  }
}

/* Мобильные устройства (768px - 576px) */
@media (max-width: 767.98px) {
  /* Социальные иконки - принудительно горизонтально */
  footer .mb-4:last-child > div:last-child,
  footer .col-lg-4:last-child > div:last-child {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
  }
  /* Header */
  .site-header {
    padding: 8px 10px;
  }
  
  .site-header .logo img {
    height: 40px;
  }
  
  /* Центрируем логотип на мобильных */
  .site-header > .container > .d-flex {
    flex-direction: column;
    align-items: center !important;
  }
  
  .site-header .logo {
    margin-bottom: 10px;
    text-align: center;
    width: 100%;
  }
  
  .site-header .d-flex {
    flex-wrap: wrap;
  }
  
  .site-header nav {
    width: 100%;
    margin-top: 10px;
    order: 2;
  }
  
  .site-header nav .me-4 {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }
  
  .site-header nav .me-4 a {
    font-size: 13px;
    margin: 5px !important;
    padding: 5px 10px;
    background: #f8f9fa;
    border-radius: 4px;
  }
  
  /* Icons in header */
  .site-header .d-flex.align-items-center {
    margin-top: 10px;
    justify-content: center;
    width: 100%;
  }
  
  .site-header .fs-5 {
    font-size: 1.1rem !important;
  }
  
  /* Search box */
  #searchBox {
    right: 10px !important;
    top: 60px !important;
    width: calc(100% - 20px) !important;
  }
  
  #searchBox input {
    width: 100% !important;
  }
  
  /* Hero section */
  .hero-left .text {
    font-size: 24px !important;
  }
  
  .hero-right {
    height: 30vh;
  }
  
  /* Hero mobile - без стилей hero-right */
  .hero-mobile {
    height: 30vh;
    overflow: hidden;
  }
  
  .hero-mobile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  /* Section titles */
  .section-title {
    font-size: 18px;
    padding: 10px 15px;
    margin-bottom: 1.5rem;
  }
  
  /* Уменьшаем отступ сверху у секции Our Business */
  section.py-5 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
  
  /* Business blocks */
  .business-block {
    padding: 20px 0;
  }
  
  .business-title {
    font-size: 1.1rem !important;
    margin-bottom: 0.5rem;
  }
  
  .business-desc {
    font-size: 14px;
  }
  
  .readmore-btn {
    padding: 8px 16px;
    font-size: 13px;
    margin: 10px 0;
  }
  
  /* Order fix for mobile */
  .order-lg-1, .order-lg-2 {
    order: initial !important;
  }
  
  /* Contact form */
  .contact-form {
    padding: 20px !important;
  }
  
  .contact-form h4 {
    font-size: 1.2rem;
  }
  
  .contact-form .form-control {
    font-size: 14px;
  }
  
  .contact-form .btn-send {
    padding: 10px 20px;
    font-size: 14px;
  }
  
  /* Contact info */
  .contact-info {
    padding: 20px !important;
  }
  
  .contact-info .info-item i {
    font-size: 24px !important;
  }
  
  /* Footer */
  footer {
    padding: 20px 0 10px !important;
    text-align: center !important;
  }
  
  footer img {
    height: 50px !important;
    margin: 0 auto;
  }
  
  footer h6 {
    font-size: 16px;
    text-align: center !important;
  }
  
  footer p, footer div {
    text-align: center !important;
  }
  
  /* Социальные ссылки - горизонтальное расположение */
  footer .col-lg-4:nth-child(3) > div:last-child {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 12px !important;
    width: 100% !important;
    margin: 0 auto !important;
  }
  
  footer .col-lg-4:nth-child(3) > div:last-child > a {
    display: inline-block !important;
  }
  
  footer .col-lg-4:nth-child(3) > div:last-child > a > div {
    width: 35px !important;
    height: 35px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 5px !important;
  }
  
  footer .col-lg-4:nth-child(3) > div:last-child > a > div i {
    font-size: 18px !important;
  }
  
  /* Service pages */
  .service-section {
    padding: 30px 0;
  }
  
  .service-image {
    margin-bottom: 20px;
  }
  
  .service-content {
    font-size: 14px;
    line-height: 1.6;
  }
  
  .service-content h3 {
    font-size: 1.2rem;
    margin: 20px 0 10px;
  }
}

/* Маленькие мобильные устройства (менее 576px) */
@media (max-width: 575.98px) {
  /* Container padding */
  .container {
    padding-left: 10px;
    padding-right: 10px;
  }
  
  /* Header */
  .site-header {
    padding: 5px;
  }
  
  .site-header .logo img {
    height: 35px;
  }
  
  /* Центрируем логотип на маленьких экранах */
  .site-header .logo {
    display: flex;
    justify-content: center;
  }
  
  /* Еще меньше отступ до Our Business */
  section.py-5 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }
  
  .site-header nav .me-4 a {
    font-size: 12px;
    margin: 3px !important;
    padding: 4px 8px;
  }
  
  /* Hero */
  .hero-left {
    padding: 1.5rem;
    min-height: 150px;
  }
  
  .hero-left .text {
    font-size: 20px !important;
  }
  
  .hero-right {
    height: 25vh;
  }
  
  /* Carousel controls */
  .carousel-control-prev,
  .carousel-control-next {
    width: 30px;
  }
  
  /* Section title */
  .section-title {
    font-size: 16px;
    padding: 8px 10px;
  }
  
  /* Business blocks */
  .business-block {
    padding: 15px 0;
  }
  
  .business-title {
    font-size: 1rem !important;
  }
  
  .business-desc {
    font-size: 13px;
    margin-top: 8px !important;
  }
  
  .readmore-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  /* Contact section */
  .contact-section {
    padding: 30px 0 20px;
  }
  
  .contact-form {
    padding: 15px !important;
  }
  
  .contact-form h4 {
    font-size: 1rem;
    margin-bottom: 15px !important;
  }
  
  .contact-form .form-control {
    font-size: 13px;
    padding: 8px 10px;
  }
  
  .contact-form textarea {
    min-height: 80px;
  }
  
  .contact-form .btn-send {
    padding: 8px 16px;
    font-size: 13px;
  }
  
  /* Contact info */
  .contact-info .info-item {
    gap: 10px !important;
    margin-bottom: 15px !important;
  }
  
  .contact-info .info-item i {
    font-size: 20px !important;
  }
  
  .contact-info {
    font-size: 13px;
  }
  
  /* Footer */
  footer {
    padding: 15px 0 10px !important;
    text-align: center !important;
  }
  
  footer .row > div {
    text-align: center !important;
    margin-bottom: 15px !important;
  }
  
  footer img {
    height: 26px !important;
    display: inline-block;
  }
  
  footer h6 {
    font-size: 14px;
    margin-bottom: 8px !important;
    text-align: center !important;
  }
  
  footer p,
  footer a {
    font-size: 12px !important;
    text-align: center !important;
  }
  
  /* Социальные ссылки - горизонтальное расположение и уменьшенный размер */
  footer .col-lg-4:nth-child(3) > div:last-child {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    margin: 0 auto !important;
  }
  
  footer .col-lg-4:nth-child(3) > div:last-child > a {
    display: inline-block !important;
  }
  
  footer .col-lg-4:nth-child(3) > div:last-child > a > div {
    width: 30px !important;
    height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 28px !important;
  }
  
  footer .col-lg-4:nth-child(3) > div:last-child > a > div i {
    font-size: 15px !important;
  }
  
  /* Copyright */
  footer > div > div:last-child {
    margin-top: 20px !important;
    padding-top: 15px !important;
    font-size: 11px !important;
  }
  
  /* Service pages */
  .service-content {
    font-size: 13px;
  }
  
  .service-content h3 {
    font-size: 1.1rem;
  }
  
  .service-content ul li {
    margin-bottom: 5px;
    font-size: 13px;
  }
  
  /* About page */
  .about-content {
    font-size: 14px;
    line-height: 1.5;
  }
  
  .about-content h3 {
    font-size: 1.2rem;
  }
  
  /* Contact page */
  .contact-info-card {
    padding: 20px !important;
    margin-bottom: 15px !important;
  }
  
  .contact-info-card h4 {
    font-size: 1.1rem;
    margin-bottom: 15px !important;
  }
  
  .contact-detail {
    margin-bottom: 10px !important;
  }
  
  .contact-detail i {
    font-size: 16px !important;
    width: 25px !important;
  }
}

/* Очень маленькие экраны (менее 400px) */
@media (max-width: 399.98px) {
  /* Социальные ссылки остаются как есть на очень маленьких экранах */
  footer .col-lg-4:nth-child(3) > div:last-child {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
  }
  /* Header logo */
  .site-header .logo img {
    height: 30px;
  }
  
  /* Navigation links */
  .site-header nav .me-4 a {
    font-size: 11px;
    padding: 3px 6px;
  }
  
  /* Hero text */
  .hero-left .text {
    font-size: 18px !important;
  }
  
  /* Business title */
  .business-title {
    font-size: 0.9rem !important;
  }
  
  /* Hide animation on very small screens for performance */
  .business-block::before {
    display: none;
  }
  
  .business-block img {
    transition: none;
  }
  
  /* Социальные ссылки - горизонтальное расположение на самых маленьких экранах */
  footer .col-lg-4:nth-child(3) > div:last-child {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    gap: 6px !important;
  }
  
  footer .col-lg-4:nth-child(3) > div:last-child > a {
    display: inline-block !important;
  }
  
  footer .col-lg-4:nth-child(3) > div:last-child > a > div {
    width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  footer .col-lg-4:nth-child(3) > div:last-child > a > div i {
    font-size: 14px !important;
  }
}

/* Landscape mode for mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-left {
    min-height: 100px;
    padding: 1rem;
  }
  
  .hero-right {
    height: 50vh;
  }
  
  .site-header {
    padding: 5px 10px;
  }
}

/* Fix for Bootstrap columns on mobile */
@media (max-width: 767.98px) {
  .col-lg-4,
  .col-lg-5,
  .col-lg-6,
  .col-lg-7,
  .col-lg-8 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* Hamburger menu for mobile (optional enhancement) */
@media (max-width: 767.98px) {
  .mobile-menu-toggle {
    display: block;
    background: var(--cvp-blue);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 20px;
    cursor: pointer;
  }
  
  .mobile-menu-toggle:hover {
    background: var(--cvp-dark);
  }
}

/* Print styles */
@media print {
  .site-header nav .d-flex.align-items-center,
  #searchBox,
  .carousel-control-prev,
  .carousel-control-next,
  .contact-form,
  footer .socials {
    display: none !important;
  }
  
  .business-block {
    page-break-inside: avoid;
  }
}