/* ===== БАЗОВЫЕ СТИЛИ ДЛЯ ВСЕХ УСТРОЙСТВ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    line-height: 1.6;
    color: #1e293b;
    background: #fff;
}

.container {
    width: 100%;
    padding: 0 15px;
    margin: 0 auto;
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== ДЕСКТОПНАЯ ВЕРСИЯ (ШИРИНА > 1024px) ===== */
@media (min-width: 1025px) {
    .container {
        max-width: 1200px;
        padding: 0 20px;
    }
    
    /* Шапка */
    .header-main-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 30px;
        padding: 20px 0;
    }
    
    .header-logo-col {
        flex: 0 0 auto;
    }
    
    .header-logo-col img {
        max-height: 60px;
    }
    
    .header-search-col {
        flex: 1;
        max-width: 500px;
    }
    
    .header-search-col #search {
        width: 100%;
    }
    
    .header-search-col input {
        width: 100%;
        padding: 12px 20px;
        border: 2px solid #e2e8f0;
        border-radius: 30px;
        font-size: 14px;
    }
    
    .header-actions-col {
        flex: 0 0 auto;
    }
    
    .user-actions {
        display: flex;
        align-items: center;
        gap: 25px;
    }
    
    .action-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        color: #1e293b;
        text-decoration: none;
    }
    
    .action-icon {
        font-size: 24px;
        position: relative;
    }
    
    .action-label {
        font-size: 12px;
        font-weight: 500;
    }
    
    .cart-count {
        position: absolute;
        top: -8px;
        right: -12px;
        background: #f44336;
        color: white;
        font-size: 10px;
        font-weight: 600;
        min-width: 18px;
        height: 18px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 4px;
    }
    
    /* Кнопка каталога */
    .catalog-open-btn {
        display: flex;
        align-items: center;
        gap: 10px;
        background: #1e88e5;
        color: #fff;
        padding: 12px 24px;
        border-radius: 8px;
        font-weight: 600;
        border: none;
        cursor: pointer;
        transition: all 0.3s;
    }
    
    .catalog-open-btn:hover {
        background: #1565c0;
    }
    
    /* Каталог */
    .catalog-drawer {
        position: fixed;
        top: 0;
        left: -350px;
        width: 350px;
        height: 100%;
        background: #fff;
        z-index: 10000;
        transition: left 0.3s ease;
        box-shadow: 2px 0 15px rgba(0,0,0,0.1);
    }
    
    .catalog-drawer.active {
        left: 0;
    }
    
    /* Товары */
    .products-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 30px;
    }
    
    .product-card {
        background: #fff;
        border-radius: 12px;
        overflow: hidden;
        border: 1px solid #e2e8f0;
        transition: all 0.3s;
    }
    
    .product-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    }
    
    /* Футер */
    .footer-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 40px;
        padding: 50px 0 30px;
    }
}

/* ===== ПЛАНШЕТНАЯ ВЕРСИЯ (768px - 1024px) ===== */
@media (min-width: 768px) and (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 0 20px;
    }
    
    .header-main-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        padding: 15px 0;
    }
    
    .header-logo-col img {
        max-height: 50px;
    }
    
    .header-search-col {
        flex: 1;
    }
    
    .user-actions {
        display: flex;
        align-items: center;
        gap: 15px;
    }
    
    .action-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: #1e293b;
    }
    
    .action-label {
        font-size: 11px;
    }
    
    .action-icon {
        font-size: 22px;
    }
    
    .products-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .footer-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
        padding: 40px 0 30px;
    }
}

/* ===== МОБИЛЬНАЯ ВЕРСИЯ (ШИРИНА < 768px) ===== */
@media (max-width: 767px) {
    .container {
        padding: 0 12px;
    }
    
    /* Шапка */
    .header-main-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        padding: 12px 0;
        gap: 10px;
    }
    
    .header-logo-col {
        order: 2;
        flex: 1;
        text-align: center;
    }
    
    .header-logo-col img {
        max-height: 40px;
    }
    
    .header-catalog-col {
        order: 1;
    }
    
    .header-actions-col {
        order: 3;
    }
    
    .header-search-col {
        order: 4;
        width: 100%;
        margin-top: 10px;
    }
    
    .user-actions {
        display: flex;
        align-items: center;
        gap: 15px;
    }
    
    .action-label {
        display: none;
    }
    
    .action-icon {
        font-size: 22px;
        position: relative;
    }
    
    /* Кнопка каталога (только иконка) */
    .catalog-open-btn {
        background: #1e88e5;
        color: #fff;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        cursor: pointer;
    }
    
    .catalog-open-btn span {
        display: none;
    }
    
    .catalog-open-btn i {
        font-size: 20px;
    }
    
    /* Каталог */
    .catalog-drawer {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100%;
        background: #fff;
        z-index: 10000;
        transition: left 0.3s ease;
        box-shadow: 2px 0 15px rgba(0,0,0,0.1);
    }
    
    .catalog-drawer.active {
        left: 0;
    }
    
    .catalog-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px;
        background: #1e88e5;
        color: #fff;
    }
    
    .catalog-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 9999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
    }
    
    .catalog-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    /* Товары */
    .products-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .product-card {
        background: #fff;
        border-radius: 12px;
        overflow: hidden;
        border: 1px solid #e2e8f0;
    }
    
    .product-image {
        width: 100%;
        aspect-ratio: 1;
        object-fit: cover;
    }
    
    .product-info {
        padding: 10px;
    }
    
    .product-name {
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 5px;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .product-price {
        font-size: 16px;
        font-weight: 700;
        color: #1e88e5;
    }
    
    /* Корзина */
    .cart-item {
        display: flex;
        gap: 12px;
        padding: 12px;
        border-bottom: 1px solid #e2e8f0;
    }
    
    .cart-item-image {
        width: 70px;
        height: 70px;
        object-fit: cover;
        border-radius: 8px;
    }
    
    .cart-item-info {
        flex: 1;
    }
    
    .cart-item-name {
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 5px;
    }
    
    .cart-item-price {
        font-size: 14px;
        color: #1e88e5;
        font-weight: 600;
    }
    
    /* Кнопки */
    .btn {
        display: block;
        width: 100%;
        padding: 12px;
        text-align: center;
        border-radius: 8px;
        font-weight: 600;
    }
    
    /* Футер */
    .footer {
        background: #f8fafc;
        padding: 30px 0 20px;
        margin-top: 30px;
        border-top: 1px solid #e2e8f0;
    }
    
    .footer-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 25px;
        text-align: center;
    }
    
    .footer h4 {
        margin-bottom: 10px;
        font-size: 16px;
    }
    
    body.no-scroll {
        overflow: hidden;
    }
}