/* Оптимизация для различных размеров ноутбуков (13.3, 14, 15.6, 16 и 17.3 дюймов) */

/* Основные настройки для контейнеров */
.container, .container-fluid {
    max-width: 1600px;
    margin: 0 auto;
}

/* Оптимизация размеров шрифтов */
body {
    font-size: 14px;
}

h1 {
    font-size: 1.8rem;
}

h2 {
    font-size: 1.6rem;
}

h3 {
    font-size: 1.4rem;
}

h4, h5, h6 {
    font-size: 1.2rem;
}

/* Оптимизация карточек товаров */
.products-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.trending-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.top-sellers-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

/* Оптимизация навигации */
.navbar .full-width-container {
    padding: 8px 12px;
}

.nav-link {
    padding: 6px 12px;
}

/* Оптимизация кнопок */
.btn {
    padding: 6px 12px;
    font-size: 0.9rem;
}

/* Оптимизация форм */
.form-control {
    padding: 8px 12px;
    font-size: 0.9rem;
}

/* Оптимизация таблиц */
.table {
    font-size: 0.9rem;
}

.table td, .table th {
    padding: 0.5rem;
}

/* Оптимизация модальных окон */
.modal-dialog {
    max-width: 800px;
}

/* Оптимизация для маленьких ноутбуков (13.3 дюймов - 1366x768) */
@media (max-width: 1366px) {
    body {
        font-size: 13px;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    h2 {
        font-size: 1.4rem;
    }
    
    h3 {
        font-size: 1.2rem;
    }
    
    h4, h5, h6 {
        font-size: 1.1rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    
    .trending-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    
    .top-sellers-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    /* Уменьшаем отступы */
    .card {
        padding: 0.5rem;
    }
    
    /* Уменьшаем высоту баннера */
    #bannerCarousel {
        height: 180px !important;
    }
    
    /* Уменьшаем размер логотипа */
    .navbar-brand img {
        height: 30px !important;
    }
    
    /* Компактная боковая панель в админке */
    .sidebar {
        width: 180px;
    }
    
    .content-wrapper {
        margin-left: 180px;
        width: calc(100% - 180px);
    }
    
    /* Более компактные таблицы */
    .table td, .table th {
        padding: 0.3rem;
        font-size: 0.8rem;
    }
}

/* Оптимизация для ноутбуков 14 дюймов (1920x1080) */
@media (min-width: 1367px) and (max-width: 1600px) {
    body {
        font-size: 13.5px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    }
    
    .trending-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    }
    
    .top-sellers-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    /* Уменьшаем высоту баннера */
    #bannerCarousel {
        height: 190px !important;
    }
    
    /* Компактная боковая панель в админке */
    .sidebar {
        width: 200px;
    }
    
    .content-wrapper {
        margin-left: 200px;
        width: calc(100% - 200px);
    }
}

/* Оптимизация для ноутбуков 15.6 дюймов (1920x1080) */
@media (min-width: 1601px) and (max-width: 1920px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
    
    .trending-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .top-sellers-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    
    /* Компактная боковая панель в админке */
    .sidebar {
        width: 220px;
    }
    
    .content-wrapper {
        margin-left: 220px;
        width: calc(100% - 220px);
    }
}

/* Оптимизация для ноутбуков 16 дюймов (2560x1600) */
@media (min-width: 1921px) and (max-width: 2560px) {
    body {
        font-size: 15px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    
    .trending-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
    
    .top-sellers-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    /* Увеличиваем высоту баннера */
    #bannerCarousel {
        height: 250px !important;
    }
    
    /* Стандартная боковая панель в админке */
    .sidebar {
        width: 250px;
    }
    
    .content-wrapper {
        margin-left: 250px;
        width: calc(100% - 250px);
    }
}

/* Оптимизация для больших ноутбуков 17.3 дюймов (2560x1440 и выше) */
@media (min-width: 2561px) {
    body {
        font-size: 16px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    h3 {
        font-size: 1.6rem;
    }
    
    h4, h5, h6 {
        font-size: 1.4rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .trending-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
    
    .top-sellers-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    
    /* Увеличиваем высоту баннера */
    #bannerCarousel {
        height: 300px !important;
    }
    
    /* Увеличиваем размер логотипа */
    .navbar-brand img {
        height: 45px !important;
    }
    
    /* Стандартная боковая панель в админке */
    .sidebar {
        width: 280px;
    }
    
    .content-wrapper {
        margin-left: 280px;
        width: calc(100% - 280px);
    }
    
    /* Увеличиваем размеры таблиц */
    .table td, .table th {
        padding: 0.7rem;
        font-size: 1rem;
    }
}

/* Оптимизация для админской панели */
.admin-content {
    padding: 1rem;
}

.admin-content .card {
    margin-bottom: 1rem;
}

.admin-content .table-responsive {
    overflow-x: auto;
}

/* Оптимизация для чата */
.chat-container {
    height: calc(100vh - 200px);
}

.message-list {
    max-height: calc(100vh - 250px);
}

/* Улучшенная видимость текста */
.card-title, .card-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Оптимизация для страницы товара */
.product-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 1366px) {
    .product-details {
        grid-template-columns: 1fr;
    }
}

/* Оптимизация для профиля пользователя */
.profile-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
}

@media (max-width: 1366px) {
    .profile-container {
        grid-template-columns: 1fr;
    }
}

/* Дополнительные оптимизации */

/* Улучшение отображения транзакций в админке */
.admin-content .table th, 
.admin-content .table td {
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
}

/* Компактные кнопки в админке */
.admin-content .btn-sm {
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
}

/* Оптимизация карточек в админке */
.admin-content .card-body {
    padding: 0.75rem;
}

/* Оптимизация форм поиска */
.input-group {
    max-width: 500px;
}

/* Оптимизация высоты строк в таблицах */
.table tr {
    height: 40px;
}

/* Оптимизация отображения бейджей */
.badge {
    padding: 0.35em 0.65em;
    font-size: 0.75em;
}

/* Оптимизация отображения пагинации */
.pagination .page-link {
    padding: 0.375rem 0.75rem;
    font-size: 0.85rem;
}

/* Оптимизация модальных окон */
.modal-body {
    padding: 0.75rem;
}

/* Оптимизация отображения сообщений в чате */
.message-bubble {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}

/* Оптимизация отображения карточек товаров */
.product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card .card-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.product-card .card-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.product-card .card-text {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.product-card .card-footer {
    padding: 0.5rem 0.75rem;
}

/* Оптимизация отображения изображений */
.product-image-container {
    height: 150px;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Оптимизация для страницы транзакций */
.transactions-table th:nth-child(1), /* ID */
.transactions-table td:nth-child(1) {
    width: 60px;
}

.transactions-table th:nth-child(4), /* Seller */
.transactions-table td:nth-child(4),
.transactions-table th:nth-child(3), /* Buyer */
.transactions-table td:nth-child(3) {
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transactions-table th:nth-child(5), /* Amount */
.transactions-table td:nth-child(5) {
    width: 80px;
}

.transactions-table th:nth-child(6), /* Status */
.transactions-table td:nth-child(6) {
    width: 90px;
}

.transactions-table th:nth-child(7), /* Age */
.transactions-table td:nth-child(7) {
    width: 70px;
}

.transactions-table th:nth-child(8), /* Created */
.transactions-table td:nth-child(8),
.transactions-table th:nth-child(9), /* Updated */
.transactions-table td:nth-child(9) {
    width: 110px;
}

.transactions-table th:nth-child(10), /* Actions */
.transactions-table td:nth-child(10) {
    width: 120px;
}
