@media (max-width: 768px) {
    /* Безопасная адаптация для таблицы цен */
    .price-table-container {
        margin-left: 0;              /* Убираем опасные отрицательные отступы */
        margin-right: 0;
        width: 100%;                 /* Вместо calc(100% + 20px) */
        padding: 1rem;
        box-sizing: border-box;      /* Важно для правильного расчета ширины */
        border-radius: 8px;          /* Сохраняем скругления */
    }
    
    /* Центрирование таблицы внутри контейнера */
    .price-table {
        margin: 0 auto;
        width: 100%;
    }
    
    /* Убеждаемся, что контейнер страницы имеет правильные отступы */
    .container {
        padding-left: 15px;
        padding-right: 15px;
        overflow-x: hidden;          /* Предотвращаем горизонтальную прокрутку */
    }
    
    /* Центрирование основного контента */
    main {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    /* Стили для таблиц пищевой ценности на мобильных устройствах */
    .nutritional-table-container {
        margin: 0 -15px !important;
        padding: 0 15px !important;
        width: calc(100% + 30px) !important;
        max-width: none !important;
    }
    
    .nutritional-table {
        font-size: 0.75rem !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 10px 0 !important;
        border-collapse: collapse !important;
        table-layout: fixed !important;
    }
    
    .nutritional-table th,
    .nutritional-table td {
        padding: 4px 2px !important;
        font-size: 0.7rem !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        hyphens: auto !important;
    }
    
    .nutritional-table th:first-child,
    .nutritional-table td:first-child {
        width: 40% !important;
        min-width: 80px !important;
    }
    
    .nutritional-table th:not(:first-child),
    .nutritional-table td:not(:first-child) {
        width: 15% !important;
        text-align: center !important;
    }
}

@media (max-width: 480px) {
    .price-table-container {
        padding: 0.8rem;
    }
    
    /* Дополнительные улучшения для очень маленьких экранов */
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Кнопки "Sužinoti daugiau" для очень маленьких экранов на страницах категорий */
    .products-container .product-link {
        padding: 5px 10px !important;
        font-size: 0.75rem !important;
        margin-top: 5px !important;
    }
    
    /* Дополнительные стили для таблиц на очень маленьких экранах */
    .nutritional-table-container {
        margin: 0 -10px !important;
        padding: 0 10px !important;
        width: calc(100% + 20px) !important;
    }
    
    .nutritional-table {
        font-size: 0.65rem !important;
    }
    
    .nutritional-table th,
    .nutritional-table td {
        padding: 3px 1px !important;
        font-size: 0.6rem !important;
    }
    
    .nutritional-table th:first-child,
    .nutritional-table td:first-child {
        width: 45% !important;
        min-width: 70px !important;
    }
    
    .nutritional-table th:not(:first-child),
    .nutritional-table td:not(:first-child) {
        width: 13.75% !important;
    }
}

/* Мобильные стили для категорий продуктов */
@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    /* Мобильные стили для кнопок "Sužinoti daugiau" на страницах категорий */
    .products-container .product-link {
        padding: 6px 12px !important;
        font-size: 0.8rem !important;
        margin-top: 6px !important;
    }
    
    .category-card {
        margin-bottom: 1rem !important;
    }
    
    .category-image {
        height: 200px !important;
    }
    
    .category-info {
        padding: 1.2rem !important;
    }
    
    .category-info h3 {
        font-size: 1.1rem !important;
    }
    
    .category-info p {
        font-size: 0.9rem !important;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        gap: 1rem !important;
    }
    
    .category-image {
        height: 180px !important;
    }
    
    .category-info {
        padding: 1rem !important;
    }
    
    .category-info h3 {
        font-size: 1rem !important;
    }
    
    .category-info p {
        font-size: 0.85rem !important;
    }
    
    /* Top bar mobile styles */
    .top-bar {
        padding: 0.2rem 0;
        font-size: 0.6rem;
    }
    
    .top-bar-content {
        padding: 0 0.5rem;
    }
}