/* Основные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* Контейнер */
.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Шапка */
.header {
    text-align: center;
    color: white;
    margin-bottom: 2%;
    padding: 20px;
}
a{
    text-decoration: none;
    color: #fff;
}
.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}
h2{
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    text-align: center;
    color: #fff;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Бренды */
.brand-section {
    margin-bottom: 50px;
}

.brand-title {
    text-align: center;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 30px;
    padding: 15px 30px;
    background: rgba(255,255,255,0.2);
    border-radius: 50px;
    display: inline-block;
    width: 100%;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Сетка товаров */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    justify-items: center;
}

/* Карточка товара */
.product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 280px;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.product-image {
    width: 100%;
    /*height: 200px;*/
    object-fit: cover;
    background: #f0f0f0;
    padding: 10%;
}

.product-info {
    padding: 15px;
    text-align: center;
}

.product-brand {
    color: #667eea;
    font-size: 0.85rem;
    font-weight: 600;
    /*text-transform: uppercase;*/
    margin-bottom: 5px;
}

.product-name {
    color: #333;
    font-size: 1rem;
    font-weight: 600;
}
.product-price{
    color: green;
}

/* Модальное окно */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f0f0f0;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10;
}

.modal-close:hover {
    background: #e0e0e0;
    color: #333;
}

.modal-image {
    display: block;
    margin: 12px auto;
    width: 50%;
    height: 50%;
    object-fit: cover;
}

.modal-content {
    padding: 25px;
}

.modal-product-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.modal-product-brand {
    color: #667eea;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 20px;
}

/* Выбор параметров */
.param-section {
    margin-bottom: 20px;
}

.param-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    display: block;
}

.param-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.param-btn {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.param-btn:hover {
    border-color: #667eea;
}

.param-btn.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Кнопки */
.btn-primary {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102,126,234,0.4);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Форма заказа */
.order-form {
    display: none;
    padding: 20px;
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    margin: 20px auto;
}

.order-form.active {
    display: block;
}

.form-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #667eea;
}

.form-textarea {
    min-height: 80px;
    resize: vertical;
}

/* Способ доставки */
.delivery-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.delivery-option {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.delivery-option:hover {
    border-color: #667eea;
}

.delivery-option.selected {
    border-color: #667eea;
    background: #f5f3ff;
}

.delivery-option input {
    margin-right: 10px;
    width: 18px;
    height: 18px;
}

/* Загрузка файла */
.file-upload {
    border: 2px dashed #ddd;
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload:hover {
    border-color: #667eea;
    background: #f9f9f9;
}

.file-upload input {
    display: none;
}

.file-upload-label {
    color: #666;
    cursor: pointer;
}

.file-name {
    margin-top: 10px;
    color: #667eea;
    font-size: 0.9rem;
}

/* Выбранные параметры */
.selected-params {
    background: #f5f3ff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.selected-params p {
    margin: 5px 0;
    color: #333;
}

.selected-params span {
    font-weight: 600;
    color: #667eea;
}

/* Сообщения */
.message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Футер */
.footer {
    text-align: center;
    padding: 20px;
    color: white;
    margin-top: 40px;
    background: rgba(0,0,0,0.2);
}

/* Навигация */
.nav-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-nav {
    padding: 10px 20px;
    background: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #667eea;
    transition: all 0.3s;
}

.btn-nav:hover {
    background: #f0f0f0;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* АДАПТАЦИЯ ПОД МОБИЛЬНЫЕ УСТРОЙСТВА */

/* Планшеты */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Мобильные устройства (планшеты) */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .brand-title {
        font-size: 1.3rem;
        padding: 12px 25px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .product-card {
        max-width: 100%;
    }
    
    .product-image {
        height: 75%;
    }
    .product-name{
        font-size: 0.8em;
    }
    .modal {
        max-width: 95%;
        margin: 10px;
    }
    
    .modal-image {
        height: 200px;
    }
    
    .modal-content {
        padding: 15px;
    }
    
    .param-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .delivery-options {
        gap: 8px;
    }
    
    .delivery-option {
        padding: 10px;
    }
}

/* Мобильные телефоны */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .header {
        margin-bottom: 25px;
        padding: 15px 10px;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .brand-section {
        margin-bottom: 35px;
    }
    
    .brand-title {
        font-size: 1.1rem;
        padding: 10px 20px;
        margin-bottom: 20px;
    }
    
    .products-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .product-card {
        border-radius: 10px;
        margin: 12px;
        height: 100%;
    }
    
    .product-image {
        height: 61%;
    }
    
    .product-info {
        padding: 10px;
    }
    
    .product-brand {
        font-size: 0.7rem;
    }
    
    .product-name {
        font-size: 0.75rem;
    }
    
    .modal-overlay {
        padding: 10px;
    }
    
    .modal {
        max-width: 100%;
        border-radius: 15px;
    }
    
    .modal-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 24px;
    }
    
    .modal-image {
        height: 180px;
    }
    
    .modal-content {
        padding: 15px;
    }
    
    .modal-product-name {
        font-size: 1.1rem;
    }
    
    .param-label {
        font-size: 0.9rem;
    }
    
    .param-options {
        gap: 6px;
    }
    
    .param-btn {
        padding: 8px 10px;
        font-size: 0.8rem;
        flex: 1 1 calc(33.333% - 6px);
        text-align: center;
    }
    
    .selected-params {
        padding: 12px;
    }
    
    .selected-params p {
        font-size: 0.9rem;
    }
    
    .order-form {
        padding: 15px;
    }
    
    .form-title {
        font-size: 1.3rem;
    }
    
    .form-label {
        font-size: 0.85rem;
    }
    
    .form-input,
    .form-textarea,
    .form-select {
        padding: 10px;
        font-size: 0.95rem;
    }
    
    .btn-primary {
        padding: 12px;
        font-size: 0.95rem;
    }
    
    .nav-buttons {
        flex-wrap: wrap;
    }
    
    .btn-nav {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .file-upload {
        padding: 15px 10px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 320px) {
    .header h1 {
        font-size: 1.3rem;
    }
    
    .brand-title {
        font-size: 1rem;
    }
    
    .products-grid {
        gap: 10px;
    }
    
    .product-image {
        height: 58%;
    }
    
    .param-btn {
        flex: 1 1 calc(50% - 6px);
    }
}

/* Улучшенная сетка для центрирования */
@media (min-width: 769px) and (max-width: 1024px) {
    .products-grid {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .products-grid {
        justify-content: center;
    }
}
