/* mobile.css - Оптимизированные стили для мобильных устройств */

/* Рекомендуемые товары - полная ширина на всех устройствах */
#recommendedStrip.full-bleed {
  width: 100vw !important;
  margin-left: calc(-50vw + 50%) !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  left: 0 !important;
  right: 0 !important;
}

/* Фильтры в shop - небольшой отступ от края на всех устройствах */
/* Исключаем header из этих стилей */
.shop-page main .container-fluid {
  padding-left: 12px !important;
  padding-right: 0 !important;
}

/* Секция с товарами на мобильных - полная ширина */
@media (max-width: 768px) {
  .shop-page section.col-lg-10 {
    padding-left: 8px !important;
    padding-right: 0 !important;
  }
  
  #productsGrid {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Секция товаров на мобильных */
@media (max-width: 768px) {
  .shop-page section.col-lg-10 {
    padding-right: 8px !important;
    padding-left: 8px !important;
  }
  
  /* Кнопка фильтров к левому краю */
  .mobile-filters-btn {
    margin-left: -8px !important;
    margin-right: auto !important;
    display: block !important;
    width: fit-content !important;
  }
}

@media (max-width: 576px) {
  .shop-page section.col-lg-10 {
    padding-right: 4px !important;
    padding-left: 4px !important;
  }
  
  /* Кнопка фильтров к левому краю на очень маленьких экранах */
  .mobile-filters-btn {
    margin-left: -4px !important;
  }
}

/* ===== ОСНОВНЫЕ МОБИЛЬНЫЕ СТИЛИ ===== */

/* Предотвращение зума на iOS */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="search"],
textarea,
select {
  font-size: 16px !important;
}

/* Улучшенная навигация для мобильных */
@media (max-width: 768px) {
  /* Компактная навигация */
  .navbar {
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  }
  
  /* Изменяем расположение элементов */
  .navbar .container-fluid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    position: relative;
    padding: 0 0.75rem;
  }
  
  /* Логотип смещен левее */
  .navbar-brand-container {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    order: 2;
    padding-left: 3rem;
  }
  
  .navbar-brand img {
    height: 35px;
  }
  
  .navbar-brand {
    font-size: 1.1rem;
  }
  
  /* Кнопка меню в левом верхнем углу */
  .navbar-toggler {
    padding: 0.25rem 0.5rem;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 0.375rem;
    order: 1;
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
  }
  
  .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
  }
  
  /* Переключатель языка чуть левее корзины */
  .navbar .dropdown {
    order: 3;
    position: absolute;
    right: 3.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: block !important;
  }
  
  .navbar .dropdown .btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.7rem;
    min-width: auto;
  }
  
  /* Корзина в правом верхнем углу (опущена ниже) */
  .cart-container {
    order: 4;
    position: absolute;
    right: 0.75rem;
    top: 60%;
    transform: translateY(-50%);
    z-index: 10;
  }
  
  /* Остальные элементы справа (скрываем на мобильных) */
  .navbar .social-links-header,
  .navbar #userMenuContainer,
  .navbar #loginButton {
    display: none !important;
  }
  
  /* Компактные элементы в шапке */
  .social-links-header {
    gap: 6px;
  }
  
  .social-link-header {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }
  
  .language-switcher {
    padding: 3px;
  }
  
  .lang-btn {
    padding: 6px 10px;
    font-size: 0.8rem;
    min-width: 32px;
  }
  
  /* Компактная корзина */
  .cart-container .bi-cart {
    font-size: 1.3rem;
  }
  
  .cart-count {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    min-width: 18px;
    height: 18px;
  }
  
  /* Скрываем десктопное меню */
  .desktop-nav {
    display: none !important;
  }
  
  /* Кнопка личного кабинета в мобильном меню */
  .mobile-user-section {
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
  }
  
  .mobile-user-section .btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
  }
  
  .mobile-user-section .btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
  }
  
  .mobile-user-section .btn i {
    font-size: 1.2rem;
  }
}



/* ===== УЛУЧШЕННЫЕ КАРТОЧКИ ТОВАРОВ ===== */

@media (max-width: 768px) {
  .product-tile {
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 100%;
  }
  
  .product-tile .tile-img {
    border-radius: 0.375rem;
    overflow: hidden;
  }
  
  .product-tile .tile-img img {
    height: 120px;
    transition: transform 0.3s ease;
  }
  
  .product-tile .tile-title a {
    font-size: 0.9rem;
    line-height: 1.3;
    font-weight: 600;
    color: #2c3e50;
  }
  
  .product-tile .price-block {
    font-size: 1rem;
    font-weight: 700;
    color: #e74c3c;
  }
  
  .product-tile .btn {
    font-size: 0.7rem !important;
    padding: 0.4rem 0.6rem !important;
    border-radius: 0.375rem;
    font-weight: 600;
    width: 100% !important;
    height: 40px !important;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  /* Улучшенная сетка */
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    justify-items: stretch;
    justify-content: center;
    padding: 0 0.5rem;
    margin: 0;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
  }
  
  .row.tiles-row .col {
    margin-bottom: 1rem;
  }
  
  /* Равномерные отступы для плиток */
  .row.tiles-row {
    margin: 0 !important;
    padding: 0 0.5rem !important;
  }
  
  .row.tiles-row .col {
    padding-left: 0.125rem !important;
    padding-right: 0.125rem !important;
  }
  

  
  /* Центрирование всех элементов на мобильных */
  .sorting-panel {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
    left: 0;
    right: 0;
  }
  
  .sorting-panel .row {
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    flex-wrap: nowrap;
    box-sizing: border-box;
    position: relative;
    left: 0;
    right: 0;
  }
  
  .sorting-panel .col-md-6 {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    flex: 1;
    margin: 0;
    padding: 0 0.25rem;
    min-width: 0; /* Предотвращаем переполнение */
    box-sizing: border-box;
    gap: 0.25rem;
  }
  
  .sorting-panel .col-md-6:last-child {
    justify-content: flex-end;
  }
  
  .sorting-panel .col-md-6:first-child {
    margin-bottom: 0;
  }
  
  .sorting-panel .d-flex {
    justify-content: flex-start;
    align-items: center;
    flex-direction: row;
    gap: 0.25rem;
  }
  
  .sorting-panel .col-md-6:last-child .d-flex {
    justify-content: flex-end;
  }
  
  .sorting-panel .justify-content-md-end {
    justify-content: center !important;
  }
  
  /* Принудительное центрирование всех элементов сортировки */
  .sorting-panel .form-label {
    text-align: left;
    margin: 0;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
    min-width: auto;
  }
  
  .sorting-panel .form-select {
    margin: 0;
    text-align: left;
    font-size: 0.75rem;
    padding: 0.2rem 0.3rem;
    max-width: 100px;
    min-width: 80px;
    flex: 1;
  }
  
  .sorting-panel .btn-group {
    margin: 0;
    display: flex;
    justify-content: flex-start;
    flex-shrink: 0;
  }
  
  .sorting-panel .col-md-6:last-child .btn-group {
    justify-content: flex-end;
  }
  
  .sorting-panel .btn-group .btn {
    font-size: 0.7rem;
    padding: 0.15rem 0.3rem;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  /* Центрирование заголовка */
  #pageTitle {
    text-align: center;
  }
  
  /* Центрирование кнопки фильтров */
  .btn-outline-secondary[data-bs-toggle="offcanvas"] {
    display: block;
    margin: 0 auto 1rem auto;
  }
  
  /* Исправление отступов секции на мобильных */
  section.col-12.col-lg-10 {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  
  /* Равномерные отступы для контента */
  section.col-12.col-lg-10 > *:not(.row.tiles-row):not(#productsGrid) {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Специально для панели сортировки */
  section.col-12.col-lg-10 .sorting-panel {
    padding: 0.5rem;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
    left: 0;
    right: 0;
    transform: none;
  }
  
  /* Контейнер карточек товаров */
  #productsGrid {
    padding: 0 !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  
    /* Принудительное центрирование плиток */
  #productsGrid .row.tiles-row {
    margin: 0 !important;
    padding: 0 0.25rem !important;
    justify-content: stretch;
    display: flex !important;
    flex-wrap: wrap !important;
  }

  #productsGrid .row.tiles-row .col {
    padding-left: 0.125rem !important;
    padding-right: 0.125rem !important;
    flex: 1 1 calc(50% - 0.25rem) !important;
    max-width: calc(50% - 0.25rem) !important;
    width: calc(50% - 0.25rem) !important;
    min-width: calc(50% - 0.25rem) !important;
  }
  
  /* Принудительно 2 колонки на мобильных - переопределяем Bootstrap */
  #productsGrid .row.tiles-row.row-cols-2.row-cols-md-4.row-cols-lg-5 > .col {
    flex: 0 0 calc(50% - 0.25rem) !important;
    max-width: calc(50% - 0.25rem) !important;
    width: calc(50% - 0.25rem) !important;
  }
}

@media (max-width: 576px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem;
    justify-items: stretch;
    justify-content: center;
    padding: 0 0.25rem;
    margin: 0;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
  }
  
  .product-tile .tile-img img {
    height: 100px;
  }
  
  .product-tile .tile-title a {
    font-size: 0.85rem;
  }
  
  .product-tile .price-block {
    font-size: 0.9rem;
  }
  
  /* Дополнительное центрирование для очень маленьких экранов */
  .sorting-panel {
    padding: 0.25rem;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
    left: 0;
    right: 0;
    transform: none;
  }
  
  .sorting-panel .row {
    max-width: 100%;
    gap: 0.25rem;
    margin: 0 auto;
    box-sizing: border-box;
    position: relative;
    left: 0;
    right: 0;
  }
  
  /* Равномерные отступы для контента на маленьких экранах */
  section.col-12.col-lg-10 > *:not(.row.tiles-row):not(#productsGrid) {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  /* Контейнер карточек товаров на маленьких экранах */
  #productsGrid {
    padding: 0 !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  
    /* Принудительное центрирование плиток на маленьких экранах */
  #productsGrid .row.tiles-row {
    margin: 0 !important;
    padding: 0 0.125rem !important;
    justify-content: stretch;
    display: flex !important;
    flex-wrap: wrap !important;
  }

  #productsGrid .row.tiles-row .col {
    padding-left: 0.0625rem !important;
    padding-right: 0.0625rem !important;
    flex: 1 1 calc(50% - 0.125rem) !important;
    max-width: calc(50% - 0.125rem) !important;
    width: calc(50% - 0.125rem) !important;
    min-width: calc(50% - 0.125rem) !important;
  }
  
  /* Принудительно 2 колонки на очень маленьких экранах - переопределяем Bootstrap */
  #productsGrid .row.tiles-row.row-cols-2.row-cols-md-4.row-cols-lg-5 > .col {
    flex: 0 0 calc(50% - 0.125rem) !important;
    max-width: calc(50% - 0.125rem) !important;
    width: calc(50% - 0.125rem) !important;
  }
  
  /* Убираем дублирующие стили - уже настроены выше */
  
  .row.tiles-row .col {
    padding-left: 0.0625rem !important;
    padding-right: 0.0625rem !important;
  }
  

  
  .sorting-panel .form-select {
    max-width: 90px;
    min-width: 70px;
    font-size: 0.7rem;
    padding: 0.15rem 0.25rem;
  }
  
  .sorting-panel .btn-group .btn {
    font-size: 0.65rem;
    padding: 0.1rem 0.25rem;
    min-width: 24px;
    height: 24px;
  }
  
  .sorting-panel .form-label {
    font-size: 0.7rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
  }
}

/* ===== УЛУЧШЕННАЯ КАРУСЕЛЬ ===== */

@media (max-width: 768px) {
  /* Дополнительные стили для сенсорных устройств */
  .hero-carousel {
    touch-action: pan-x;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }
  
  .hero-slide {
    touch-action: pan-x;
  }
  
  .hero-slide img {
    touch-action: pan-x;
    pointer-events: none;
  }
  
  .hero-arrow:hover {
    background: rgba(0,0,0,0.7);
    transform: translateY(-50%) scale(1.05);
  }
}

@media (max-width: 576px) {
  /* Дополнительная оптимизация для маленьких экранов */
  .hero-slide:hover img {
    transform: none; /* Отключаем hover эффекты на мобильных */
  }
}

/* ===== УЛУЧШЕННЫЕ ФОРМЫ ===== */

@media (max-width: 768px) {
  .form-control,
  .form-select {
    font-size: 16px;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
  }
  
  .form-control:focus,
  .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
  }
  
  .form-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
  }
  
  /* Компактные модальные окна */
  .modal-content {
    border-radius: 0.75rem;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  }
  
  .modal-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #dee2e6;
  }
  
  .modal-body {
    padding: 1.25rem;
  }
  
  .modal-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid #dee2e6;
  }
  
  /* Адаптация таблиц */
  .table-responsive {
    border-radius: 0.5rem;
    overflow: hidden;
  }
  
  .table {
    font-size: 0.85rem;
    margin-bottom: 0;
  }
  
  .table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    padding: 0.75rem 0.5rem;
  }
  
  .table td {
    padding: 0.75rem 0.5rem;
    vertical-align: middle;
  }
}

/* ===== УЛУЧШЕННЫЕ КНОПКИ ===== */

@media (max-width: 768px) {
  .btn {
    font-size: 0.85rem;
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
  }
  
  .btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    box-shadow: 0 2px 8px rgba(0,123,255,0.3);
  }
  
  .btn-primary:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.4);
  }
  
  .btn-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    border: none;
    box-shadow: 0 2px 8px rgba(40,167,69,0.3);
  }
  
  .btn-success:hover {
    background: linear-gradient(135deg, #1e7e34 0%, #155724 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40,167,69,0.4);
  }
  
  .btn-outline-primary {
    border: 2px solid #007bff;
    color: #007bff;
    background: transparent;
  }
  
  .btn-outline-primary:hover {
    background: #007bff;
    color: white;
    transform: translateY(-1px);
  }
}

/* ===== УЛУЧШЕННЫЕ КАРТОЧКИ ===== */

@media (max-width: 768px) {
  .strip-card {
    border-radius: 12px !important;
    margin-bottom: 1rem;
  }
  
  .strip-card::before {
    border-radius: 12px !important;
  }
  
  .strip-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 12px 25px rgba(0,0,0,0.15) !important;
  }
  
  .card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1rem;
  }
  
  .card:hover {
    transform: none; /* Отключаем hover на мобильных для strip-card */
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  }
  
  .card-body {
    padding: 1.25rem;
  }
  
  .card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    line-height: 1.3;
  }
  
  .card-text {
    font-size: 0.9rem;
    color: #6c757d;
    line-height: 1.5;
  }
  
  .card-img-top {
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
  }
  
  /* Специальные стили для карточек товаров */
  .product-tile {
    height: auto;
    min-height: 280px;
    display: flex;
    flex-direction: column;
  }
  
  .product-tile .tile-bottom {
    margin-top: auto;
    padding: 0.75rem;
  }
  
  .product-tile .tile-title {
    padding: 0.5rem 0.75rem 0;
    min-height: 3rem;
    display: flex;
    align-items: center;
  }
  
  .product-tile .tile-title a {
    font-size: 0.85rem;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* Для очень маленьких экранов */
  @media (max-width: 480px) {
    .product-tile {
      min-height: 260px;
    }
    
    .product-tile .tile-title a {
      font-size: 0.8rem;
    }
    
    .product-tile .tile-bottom {
      padding: 0.5rem;
    }
  }
}

/* ===== УЛУЧШЕННЫЙ ФУТЕР ===== */

@media (max-width: 768px) {
  .site-footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
    padding: 2rem 0;
  }
  
  .site-footer .container {
    padding: 0 1rem;
  }
  
  .footer-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 1rem;
    text-align: center;
  }
  
  .footer-link {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 0.9rem;
  }
  
  .footer-link:hover {
    color: #fff;
  }
  
  .footer-social {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    transition: all 0.2s ease;
  }
  
  .footer-social:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
    color: #fff;
  }
  
  .footer-pay-pill {
    background: rgba(255,255,255,0.1);
    color: #fff;
    padding: 0.3rem 0.6rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
  }
}

/* ===== УЛУЧШЕННЫЕ УВЕДОМЛЕНИЯ ===== */

@media (max-width: 768px) {
  .toast-notification {
    right: 10px;
    bottom: 10px;
    max-width: calc(100vw - 20px);
    font-size: 0.85rem;
    padding: 12px 16px;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  }
  
  .alert {
    border-radius: 0.5rem;
    border: none;
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
  }
  
  .alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
  }
  
  .alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
  }
  
  .alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
  }
}

/* ===== УЛУЧШЕННЫЕ АНИМАЦИИ ===== */

@media (max-width: 768px) {
  /* Плавные переходы для мобильных */
  .card,
  .product-tile,
  .btn,
  .nav-link {
    transition: all 0.2s ease;
  }
  
  /* Отключаем тяжелые анимации на мобильных */
  .card:hover,
  .product-tile:hover {
    transform: none;
  }
  
  /* Улучшенные hover эффекты */
  .btn:hover {
    transform: translateY(-1px);
  }
  
  .nav-link:hover {
    color: #007bff;
  }
}

/* ===== УЛУЧШЕННАЯ ДОСТУПНОСТЬ ===== */

@media (max-width: 768px) {
  /* Улучшения для доступности */
  .btn:focus,
  .form-control:focus,
  .form-select:focus,
  .nav-link:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
  }
  
  /* Минимальные размеры для кликабельных элементов */
  .btn,
  .nav-link,
  .social-link-header {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Улучшенная читаемость */
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  
  /* Улучшенный контраст */
  .text-muted {
    color: #6c757d !important;
  }
  
  .text-secondary {
    color: #6c757d !important;
  }
}

/* ===== ОПТИМИЗАЦИИ ПРОИЗВОДИТЕЛЬНОСТИ ===== */

@media (max-width: 768px) {
  /* Оптимизации для мобильных устройств */
  * {
    -webkit-tap-highlight-color: transparent;
  }
  
  /* Аппаратное ускорение */
  .card,
  .product-tile,
  .btn,
  .hero-carousel,
  .carousel {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }
  
  /* Оптимизация скролла */
  .offcanvas,
  .modal {
    -webkit-overflow-scrolling: touch;
  }
}

/* ===== ДОПОЛНИТЕЛЬНЫЕ УЛУЧШЕНИЯ ===== */

/* Улучшенная поддержка жестов */
@media (max-width: 768px) {
  .carousel,
  .hero-carousel {
    touch-action: pan-x pan-y;
    -webkit-tap-highlight-color: transparent;
  }
  
  .hero-track {
    touch-action: pan-x pan-y;
    -webkit-tap-highlight-color: transparent;
  }
  
  .hero-slide {
    touch-action: pan-x pan-y;
    -webkit-tap-highlight-color: transparent;
  }
  
  .strip-viewport {
    touch-action: pan-x pan-y;
    padding: 6px 0 4px 0 !important; /* Отступы для видимости границ на мобильных */
  }
  
  .home-strip {
    padding-top: 8px !important;
  }
  
  /* Улучшенная обработка касаний для карточек в каруселях */
  .strip-card {
    touch-action: pan-x pan-y;
    -webkit-tap-highlight-color: transparent;
  }
  
  .strip-card img {
    pointer-events: none;
  }
  
  /* Улучшенная отзывчивость карточек */
  .strip-card {
    transition: transform 0.2s ease;
  }
  
  .strip-card:active {
    transform: scale(0.98);
  }
  
  .offcanvas {
    touch-action: pan-x;
  }
}

/* Улучшенная поддержка ориентации */
@media (max-width: 768px) and (orientation: landscape) {
  .hero-carousel {
    height: 150px !important;
  }
  
  .navbar {
    padding: 0.25rem 1rem;
  }
  
  .modal-dialog {
    margin: 0.5rem auto;
  }
}

/* Принудительные светлые стили для мобильных устройств */
@media (max-width: 768px) {
  /* Принудительно светлая навигация */
  .navbar {
    background-color: #fff !important;
    color: #333 !important;
  }
  
  .navbar-brand {
    color: #333 !important;
  }
  
  .navbar-nav .nav-link {
    color: #333 !important;
  }
  
  .navbar-nav .nav-link:hover {
    color: #007bff !important;
  }
  
  .navbar-toggler {
    border-color: rgba(0,0,0,0.1) !important;
  }
  
  .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2833, 37, 41, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='m4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
  }
  
  /* Принудительно светлые формы */
  .form-control,
  .form-select {
    background-color: #fff !important;
    border-color: #dee2e6 !important;
    color: #333 !important;
  }
  
  .form-control:focus,
  .form-select:focus {
    background-color: #fff !important;
    border-color: #007bff !important;
    color: #333 !important;
  }
  
  /* Принудительно светлые карточки */
  .card {
    background-color: #fff !important;
    border-color: #dee2e6 !important;
    color: #333 !important;
  }
  
  /* Принудительно светлые кнопки */
  .btn-outline-primary {
    border-color: #007bff !important;
    color: #007bff !important;
    background-color: transparent !important;
  }
  
  .btn-outline-primary:hover {
    background-color: #007bff !important;
    color: #fff !important;
  }
  
  /* Оптимизированный фон карусели для мобильных */
  .hero-carousel {
    background: #f8f9fa !important;
    cursor: grab;
  }
  
  .hero-carousel:active {
    cursor: grabbing;
  }
  
  .hero-slide {
    background: #f8f9fa !important;
    pointer-events: auto;
  }
  
  .hero-slide img {
    background: transparent !important;
    pointer-events: auto;
    object-fit: contain !important;
    object-position: center !important;
    height: auto !important;
  }
  
  .hero-track {
    cursor: grab;
  }
  
  .hero-track:active {
    cursor: grabbing;
  }
}

/* ===== СПЕЦИАЛЬНЫЕ СТИЛИ ДЛЯ ОЧЕНЬ МАЛЕНЬКИХ ЭКРАНОВ ===== */

@media (max-width: 480px) {
  /* Принудительно светлые стили для очень маленьких экранов */
  .navbar {
    background-color: #fff !important;
    color: #333 !important;
  }
  
  .hero-carousel {
    background: #f8f9fa !important;
  }
  
  .hero-slide {
    background: #f8f9fa !important;
  }
  
  .hero-slide img {
    background: transparent !important;
    object-fit: contain !important;
    object-position: center !important;
    height: auto !important;
  }
  
  .card {
    background-color: #fff !important;
    color: #333 !important;
  }
  /* Минимальные размеры */
  .container {
    padding: 0 8px;
  }
  
  .py-5 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }
  
  .mb-4 {
    margin-bottom: 1rem !important;
  }
  
  .mb-5 {
    margin-bottom: 1.5rem !important;
  }
  
  /* Компактные элементы */
  .navbar-brand img {
    height: 30px;
  }
  
  .navbar-brand {
    font-size: 1rem;
  }
  
  .social-link-header {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  
  .lang-btn {
    padding: 4px 6px;
    font-size: 0.75rem;
    min-width: 28px;
  }
  
  /* Минимальная карусель */
  .hero-carousel {
    height: 200px !important;
  }
  
  .hero-caption {
    padding: 8px 10px;
  }
  
  .hero-caption .h5 {
    font-size: 0.9rem;
  }
  
  .hero-caption .small {
    font-size: 0.75rem;
  }
  
  /* Компактные карточки */
  .card-body {
    padding: 0.75rem;
  }
  
  .card-title {
    font-size: 0.9rem;
  }
  
  .card-text {
    font-size: 0.8rem;
  }
  
  /* Маленькие кнопки */
  .btn {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
  }
  
  /* Компактный футер */
  .site-footer .container {
    padding: 0 8px;
  }
  
  .footer-title {
    font-size: 1rem;
  }
  
  .footer-link {
    font-size: 0.85rem;
  }
}

/* ===== ИСПРАВЛЕНИЕ КНОПКИ "ЗАБРОНИРОВАТЬ" НА МОБИЛЬНЫХ ===== */

@media (max-width: 768px) {
  /* Кнопка "Забронировать" - исправление вылезания текста */
  .btn-primary {
    font-size: 0.75rem !important;
    padding: 0.5rem 0.75rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 44px; /* Минимальная высота для удобного нажатия */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
  }
  
  /* Специально для кнопок в карточках товаров */
  .tile-bottom .btn-primary,
  .card .btn-primary {
    font-size: 0.7rem !important;
    padding: 0.4rem 0.6rem !important;
    line-height: 1.2;
    min-height: 40px;
    width: 100% !important;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* Специально для карточек товаров в shop.html */
  .product-tile .tile-bottom .btn-primary {
    font-size: 0.7rem !important;
    padding: 0.4rem 0.6rem !important;
    line-height: 1.1;
    min-height: 40px;
    width: 100% !important;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  /* Для очень маленьких экранов */
  @media (max-width: 480px) {
    .btn-primary {
      font-size: 0.65rem !important;
      padding: 0.35rem 0.5rem !important;
    }
    
    .tile-bottom .btn-primary,
    .card .btn-primary {
      font-size: 0.6rem !important;
      padding: 0.3rem 0.4rem !important;
      width: 100% !important;
    }
    
    .product-tile .tile-bottom .btn-primary {
      font-size: 0.6rem !important;
      padding: 0.3rem 0.4rem !important;
      min-height: 36px;
      width: 100% !important;
      text-align: center;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }
}

/* ===== ИСПРАВЛЕНИЕ МОДАЛЬНОГО ОКНА С КАРТИНКАМИ ===== */

@media (max-width: 768px) {
  /* Модальное окно с картинками */
  .modal-fullscreen {
    padding: 0 !important;
  }
  
  .modal-fullscreen .modal-content {
    border-radius: 0;
    height: 100vh;
    width: 100vw;
  }
  
  .modal-fullscreen .modal-body {
    padding: 0 !important;
    height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.95);
  }
  
  /* Контейнер для картинки */
  .zoom-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
  }
  
  /* Картинка в модальном окне */
  .zoom-modal-img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  }
  
  /* Кнопка закрытия */
  .modal-fullscreen .btn-outline-light {
    position: fixed !important;
    top: 10px !important;
    right: 10px !important;
    z-index: 1060;
    background-color: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
  }
  
  .modal-fullscreen .btn-outline-light:hover {
    background-color: rgba(0, 0, 0, 0.9);
    border-color: rgba(255, 255, 255, 0.5);
  }
  
  /* Дополнительные стили для очень маленьких экранов */
  @media (max-width: 480px) {
    .zoom-wrap {
      padding: 5px;
    }
    
    .zoom-modal-img {
      border-radius: 4px;
    }
    
    .modal-fullscreen .btn-outline-light {
      top: 5px !important;
      right: 5px !important;
      width: 35px;
      height: 35px;
      font-size: 1rem;
    }
  }
  
  /* Стили для ландшафтной ориентации */
  @media (max-width: 768px) and (orientation: landscape) {
    .zoom-modal-img {
      max-height: 90vh !important;
    }
    
    .modal-fullscreen .btn-outline-light {
      top: 5px !important;
      right: 5px !important;
    }
  }
}
