/**
 * STYLES.CSS - Основной файл стилей для сайта Moncore
 * ВЕРСИЯ: 1.1
 * НАЗНАЧЕНИЕ: Единое оформление для всех страниц сайта
 */

/* ===== БАЗОВЫЕ СТИЛИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== ШАПКА САЙТА ===== */
header {
    background: linear-gradient(135deg, #2c3e50 0%, #1a2530 100%);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: #3498db;
}

nav ul {
    display: flex;
    list-style: none;
    align-items: center;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
}

nav ul li a:hover {
    color: #3498db;
}

.cart-icon {
    font-size: 1.5rem;
    position: relative;
}

.cart-count {
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.75rem;
    position: absolute;
    top: -8px;
    right: -12px;
    min-width: 18px;
    text-align: center;
}

/* ===== ГЕРОЙ-СЕКЦИЯ ===== */
.hero {
    background: linear-gradient(135deg, #2c3e50 0%, #1a2530 100%);
    padding: 4rem 0;
    text-align: center;
    color: white;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
}

/* ===== ОСНОВНОЙ КОНТЕНТ ===== */
.content {
    padding: 3rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
    font-size: 2rem;
}

/* ===== КАРТОЧКИ КОНТАКТОВ ===== */
.contacts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.contact-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.3s;
}

.contact-card:hover {
    transform: translateY(-5px);
}

.contact-card h3 {
    margin: 1rem 0 0.5rem;
    color: #2c3e50;
}

.contact-card p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

.contact-card a {
    display: inline-block;
    padding: 8px 20px;
    background: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s;
}

.contact-card a:hover {
    background: #2980b9;
}

/* ===== СЕТКА ТОВАРОВ (КАРТОЧКИ) ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 2rem;
}

.product-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    padding: 15px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.product-image {
    width: 100%;
    height: 160px;
    background: #f8f9fa;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    overflow: hidden;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-image-placeholder {
    color: #ccc;
    font-size: 3rem;
}

.product-name {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
    line-height: 1.3;
}

.product-price {
    font-weight: 700;
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.product-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    gap: 8px;
}

.stock-status {
    font-size: 0.9rem;
    font-weight: 500;
}

.stock-in-stock {
    color: #27ae60;
}

.stock-out-of-stock {
    color: #e74c3c;
}

/* ===== КОНТРОЛЛЕР КОЛИЧЕСТВА ===== */
.quantity-control {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #f8f9fa;
    border-radius: 30px;
    padding: 3px;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: #3498db;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.quantity-btn:hover {
    background: #2980b9;
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

.quantity-input {
    width: 50px;
    height: 28px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    background: white;
}

.quantity-input:focus {
    outline: none;
    border-color: #3498db;
}

.product-card.out-of-stock .quantity-control {
    opacity: 0.6;
}

/* ===== КОРЗИНА (ТАБЛИЦА) ===== */
.cart-empty {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.cart-table {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    overflow-x: auto;
    margin-bottom: 2rem;
}

.cart-table table {
    width: 100%;
    border-collapse: collapse;
}

.cart-table th,
.cart-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.cart-table th {
    background-color: #f8f9fa;
    color: #2c3e50;
    font-weight: 600;
}

.cart-table tr:hover {
    background-color: #f8f9fa;
}

.cart-table .quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-table .quantity-input {
    width: 60px;
    text-align: center;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.cart-summary {
    text-align: right;
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #eee;
}

.delete-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #e74c3c;
    transition: transform 0.2s;
}

.delete-btn:hover {
    transform: scale(1.1);
}

/* ===== ФОРМА ОФОРМЛЕНИЯ ===== */
.customer-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52,152,219,0.2);
}

.form-group input.error {
    border-color: #e74c3c;
}

.error-message {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
}

.required {
    color: #e74c3c;
}

.payment-methods {
    margin: 1.5rem 0;
}

.payment-method {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.payment-method input {
    width: auto;
    margin-right: 10px;
}

.payment-method label {
    margin: 0;
    font-weight: normal;
}

.checkout-btn {
    padding: 15px 40px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 600;
    transition: background 0.3s;
    display: block;
    margin: 0 auto;
}

.checkout-btn:hover {
    background: #219653;
}

.checkout-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

/* ===== ПОИСК И ФИЛЬТРЫ ===== */
.catalog-controls {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.search-box {
    margin-bottom: 1rem;
}

.search-box input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 1rem;
}

.search-box input:focus {
    outline: none;
    border-color: #3498db;
}

.stock-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1rem;
}

.stock-filter input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.stock-filter label {
    cursor: pointer;
    color: #2c3e50;
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 1rem;
}

.category-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 25px;
    background: white;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.category-btn:hover {
    border-color: #3498db;
    color: #3498db;
}

.category-btn.active {
    background: #3498db;
    border-color: #3498db;
    color: white;
}

/* ===== МОДАЛЬНЫЕ ОКНА ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.modal-content h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.modal-btn {
    margin-top: 1rem;
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* ===== ПОДВАЛ ===== */
footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-content p {
    margin: 5px 0;
}

.footer-version {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: 10px;
}

.footer-created {
    font-size: 0.7rem;
    opacity: 0.5;
    margin-top: 5px;
}

/* ===== УВЕДОМЛЕНИЯ ===== */
.stock-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 1024px) {
    .contacts {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    nav ul {
        margin-top: 1rem;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    nav ul li {
        margin: 5px 10px;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
    }
    
    .product-card {
        padding: 12px;
    }
    
    .product-image {
        height: 140px;
    }
    
    .quantity-input {
        width: 44px;
    }
    
    .quantity-btn {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }
    
    .cart-table {
        padding: 1rem;
    }
    
    .cart-table th,
    .cart-table td {
        padding: 10px 8px;
    }
    
    .customer-form {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .product-card-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .stock-status {
        text-align: center;
    }
    
    .quantity-control {
        justify-content: center;
    }
    
    .contacts {
        grid-template-columns: 1fr;
    }
    
    .category-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 10px;
    }
    
    .category-btn {
        white-space: nowrap;
    }
    
    .cart-table .quantity-controls {
        flex-direction: column;
        gap: 5px;
    }
}