* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}
#con__main {
    padding: 15px;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: white;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header - белый, с синим текстом, всё в одну строку */
header {
    background: white;
    color: #002266;
    padding: 15px 40px;
    border-bottom: 3px solid #cc0000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    line-height: 1;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}
.logo__text {
    display:flex;
    flex-direction: column;
    gap: 0px;
}
.logo-img {
    height: 65px;
    width: auto;
    object-fit: contain;
}

.logo h1 {
    font-size: 28px;
    letter-spacing: 2px;
    color: #cc0000;
}

.logo p {
    font-size: 12px;
    opacity: 0.8;
    color: #002266;
}

/* Навигация по центру */
.header-nav {
    display: flex;
    gap: 30px;
}

.header-nav a {
    color: #002266;
    text-decoration: none;
    font-weight: bold;
    font-size: 18px;
    transition: 0.3s;
    padding: 8px 16px;
    border-radius: 8px;
}

.header-nav a:hover {
    background: #cc0000;
    color: white;
}

/* Контакты справа */
.header-contacts {
    text-align: right;
    font-weight: bold;
    color: #002266;
}

.header-contacts a {
    margin: 3px 0;
    font-size: 18px;
    color: #002266;
}

/* Контейнер (каталог) */
.container {
    flex: 1;
    max-width: 1300px;
    margin: 30px auto;
    padding: 0 20px;
    display: flex;
    gap: 30px;
    width: 100%;
}

/* Боковая панель */
.sidebar {
    width: 250px;
    background: #f8f8f8;
    padding: 20px;
    border-radius: 12px;
}

.sidebar h3 {
    color: #cc0000;
    margin-bottom: 15px;
}

.categories {
    list-style: none;
}

.categories li {
    margin-bottom: 12px;
}

.categories a {
    text-decoration: none;
    color: #0044aa;
    font-weight: 500;
    transition: 0.2s;
}

.categories a:hover {
    color: #cc0000;
    padding-left: 5px;
}

/* Контент */
.content {
    flex: 1;
}

.content h2 {
    color: #cc0000;
    border-bottom: 2px solid #0044aa;
    display: inline-block;
    margin-bottom: 25px;
    padding-bottom: 5px;
}

.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* Карточка товара — кнопка всегда внизу */
.card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-color: #cc0000;
}

.card-img {
    font-size: 48px;
    margin-bottom: 12px;
}

.card h3 {
    color: #0044aa;
    margin: 10px 0;
}

.card p {
    flex-grow: 1;
    margin-bottom: 15px;
    color: #666;
}

.price-block {
    margin: 12px 0;
    display: flex;
    flex-direction: column;
}

.price {
    font-size: 24px;
    font-weight: bold;
    color: #cc0000;
}

.old-price {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
    margin-right: 10px;
    opacity: 0.7;
}

.new-price {
    font-size: 24px;
    font-weight: bold;
    color: #cc0000;
}

.btn {
    background: #cc0000;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
    width: 100%;
    margin-top: auto;
}

.btn:hover {
    background: #990000;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    width: 400px;
    max-width: 90%;
    position: relative;
    border-top: 5px solid #cc0000;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #cc0000;
}

.modal-content h3 {
    color: #002266;
    margin-bottom: 20px;
    font-size: 24px;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.modal-content input:focus {
    outline: none;
    border-color: #cc0000;
}

.modal-btn {
    background: #cc0000;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    font-size: 16px;
}

.modal-btn:hover {
    background: #990000;
}

/* Страница контактов */
.contacts-page {
    flex-direction: column;
}

.contact-info {
    display: flex;
    gap: 40px;
    margin: 40px;
    flex-wrap: wrap;
}

.info-block {
    background: #f2f2f2;
    padding: 20px;
    border-radius: 12px;
    flex: 1;
}

.info-block h2 {
    color: #0044aa;
    margin-bottom: 15px;
}

.branches {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    padding: 20px 0;
    margin: 0 auto;
}

.branch-card {
    background: #ffffff;
    border: 1px solid #ccc;
    border-radius: 12px;
    padding: 20px;
    width: 280px;
}

.branch-card h3 {
    color: #cc0000;
    margin-bottom: 12px;
}

.map-placeholder {
    margin: 30px;
    background: #eef2ff;
    padding: 30px;
    text-align: center;
    border-radius: 12px;
}

.fake-map {
    background: white;
    padding: 30px;
    margin-top: 15px;
    border-radius: 12px;
    font-weight: bold;
    color: #0044aa;
}

/* Footer */
footer {
    background: #002266;
    color: white;
    padding: 40px 40px 20px 40px;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1300px;
    margin: 0 auto;
}

.footer-section h4 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #cc0000;
}

.footer-section p, .footer-section ul {
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.9;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section a {
    color: white;
    text-decoration: none;
}

.footer-section a:hover {
    text-decoration: underline;
    color: #ff9999;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    margin-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.2);
    font-size: 12px;
    max-width: 1300px;
    margin-left: auto;
    margin-right: auto;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.content-header h2 {
    margin-bottom: 0;
}

.sort-block {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 15px;
    border-radius: 8px;
}

.sort-block span {
    color: #002266;
    font-weight: 500;
}

.sort-block select {
    padding: 6px 12px;
    border: 1px solid #cc0000;
    border-radius: 6px;
    background: white;
    color: #002266;
    font-weight: 500;
    cursor: pointer;
}

.sort-block select:hover {
    background: #fff5f5;
}

/* Блок поиска */
.search-block {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.search-input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
}

.search-btn {
    width: 100%;
    background: #0044aa;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 5px;
}

.search-btn:hover {
    background: #002266;
}

.search-clear {
    display: inline-block;
    margin-top: 8px;
    font-size: 12px;
    color: #cc0000;
    text-decoration: none;
}

/* Блок фильтра */
.filter-block {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.brands-list {
    margin: 10px 0;
}

.brand-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    cursor: pointer;
}

.brand-checkbox input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.filter-clear {
    display: inline-block;
    margin-top: 8px;
    font-size: 12px;
    color: #cc0000;
    text-decoration: none;
}

/* Бренд на карточке */
.brand-tag {
    display: inline-block;
    background: #eef2ff;
    color: #0044aa;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 12px;
    margin-bottom: 10px;
    font-weight: 500;
}

/* Счётчик товаров */
.count-badge {
    background: #cc0000;
    color: white;
    font-size: 14px;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: 10px;
}

/* Активные фильтры */
.active-filters {
    background: #f5f5f5;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.active-filters span {
    font-size: 14px;
}

.filter-tag {
    background: #e0e0e0;
    padding: 4px 8px 4px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.remove-filter {
    color: #cc0000;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
}

.clear-all {
    color: #cc0000;
    text-decoration: none;
    font-size: 12px;
    margin-left: 5px;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 18px;
}

/* Карточка товара со ссылкой */
.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card-product-img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    margin-bottom: 10px;
}

/* Страница товара */
.product-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    flex: 1;
}

.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 50px;
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.product-image img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 12px;
}

.product-info h1 {
    font-size: 28px;
    color: #002266;
    margin-bottom: 10px;
}

.product-brand {
    color: #cc0000;
    font-weight: bold;
    margin-bottom: 20px;
    font-size: 16px;
}

.product-price-block {
    margin: 20px 0;
}

.product-price {
    font-size: 32px;
    font-weight: bold;
    color: #cc0000;
}

.product-old-price {
    font-size: 20px;
    color: #999;
    text-decoration: line-through;
    margin-right: 15px;
}

.product-new-price {
    font-size: 32px;
    font-weight: bold;
    color: #cc0000;
}

.discount-badge {
    background: #cc0000;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 14px;
    margin-left: 15px;
    display: inline-block;
}

.product-order-btn {
    background: #cc0000;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    margin: 20px 0;
    transition: 0.2s;
}

.product-order-btn:hover {
    background: #990000;
}

.product-description {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.product-description h3 {
    color: #002266;
    margin-bottom: 10px;
}

/* Вкладки */
.product-tabs {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-top: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.tab-buttons {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #eee;
    margin-bottom: 25px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    color: #666;
    transition: 0.2s;
}

.tab-btn.active {
    color: #cc0000;
    border-bottom: 2px solid #cc0000;
    margin-bottom: -2px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Таблица характеристик */
.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table tr {
    border-bottom: 1px solid #eee;
}

.specs-table td {
    padding: 12px;
}

.spec-name {
    font-weight: bold;
    color: #002266;
    width: 40%;
}

.spec-value {
    color: #555;
}

/* Информация о доставке */
.delivery-info ul, .warranty-info ul {
    margin: 15px 0;
    padding-left: 20px;
}

.delivery-info li, .warranty-info li {
    margin: 10px 0;
    line-height: 1.5;
}

.delivery-info h4, .warranty-info h4 {
    color: #002266;
    margin: 20px 0 10px 0;
}

/* Ссылка назад */
.back-to-catalog {
    margin-top: 30px;
    text-align: center;
}

.back-link {
    color: #002266;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    transition: .3s;
}

.back-link:hover {
    color: #cc0000;
}

/* Адаптив для страницы товара */
@media (max-width: 800px) {
    .product-detail {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .product-image img {
        max-height: 250px;
    }
    
    .tab-buttons {
        flex-wrap: wrap;
    }
    
    .tab-btn {
        flex: 1;
        text-align: center;
    }
}


/* Адаптив */
@media (max-width: 900px) {
    header {
        flex-direction: column;
        text-align: center;
        align-content: center;
    }
    .header-contacts {
        text-align: center;
    }
    .container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* ================= АДАПТИВ ПОД СМАРТФОНЫ (ВКЛЮЧАЯ IPHONE 14 PRO MAX) ================= */
@media (max-width: 768px) {
    
    /* Убираем любые вылеты на уровне всей страницы */
    html, body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        margin: 0;
        padding: 0;
    }

    /* Шапка: перестраиваем логотип, меню и телефон друг под друга */
    header {
        padding: 15px 20px !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center;
        gap: 15px !important;
    }

    .header-nav {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        margin: 5px 0;
        gap: 15px;
    }

    .header-nav a {
        margin: 0 !important; /* Сбрасываем десктопный отступ слева */
        font-size: 15px;
    }

    .header-contacts {
        flex-direction: column;
        gap: 5px !important;
    }

    /* Контакты: если блоки стояли в ряд (flex/grid), пускаем их в одну колонку */
    .container {
        /* padding: 0 15px !important;
        max-width: 100% !important;
        overflow: hidden; */
    }

    /* Фикс разметки страницы контактов */
    .contact-wrapper, 
    div[style*="display: flex"], 
    div[style*="display: grid"] {
        flex-direction: column !important;
        grid-template-columns: 1fr !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 20px !important;
    }

    /* Жесткий фикс для встроенной карты Яндекса, чтобы она не взрывала экран */
    .map-container, 
    .contacts-map, 
    ymaps {
        width: 100% !important;
        max-width: 100% !important;
        height: 300px !important; /* Уменьшаем высоту карты под мобильный экран */
    }

    /* Футер: перестраиваем сетку разделов в один столбец */
    footer .footer-grid, 
    .footer-columns {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
        text-align: center;
        gap: 20px;
        padding: 20px 10px !important;
    }
}