/**
 * Глобальные стили сайта
 * Металлоконструкции и металлоизделия
 */

@import url('fonts.css');

/* =====================================================
   CSS Переменные (индустриальный/лофт стиль)
   ===================================================== */
:root {
    /* Основные цвета */
    --color-primary: #333333;
    --color-secondary: #666666;
    --color-accent: #c9a227;
    --color-accent-hover: #b8921f;

    /* Фоны */
    --color-bg: #f5f5f5;
    --color-bg-dark: #1a1a1a;
    --color-bg-light: #ffffff;

    /* Текст */
    --color-text: #333333;
    --color-text-light: #666666;
    --color-text-muted: #999999;
    --color-text-white: #ffffff;

    /* Статусы */
    --color-success: #4CAF50;
    --color-error: #f44336;
    --color-warning: #ff9800;
    --color-info: #2196F3;

    /* Границы */
    --color-border: #e0e0e0;
    --color-border-dark: #333333;

    /* Шрифты */
    --font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Размеры */
    --container-width: 1440px;
    --header-height: 120px;

    /* Тени */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);

    /* Скругления */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Переходы */
    --transition: all 0.3s ease;
}

/* =====================================================
   Reset и базовые стили
   ===================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.lock {
    overflow: hidden;
}

main {
    flex: 1;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--color-accent);
}

ul, ol {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* =====================================================
   Контейнер
   ===================================================== */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* =====================================================
   Типографика
   ===================================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

p:last-child {
    margin-bottom: 0;
}

/* =====================================================
   Секции
   ===================================================== */
.section {
    padding: 60px 0;
}

.section--gray {
    background-color: var(--color-bg);
}

.section--dark {
    background-color: var(--color-bg-dark);
    color: var(--color-text-white);
}

.section__title {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 40px;
}

.section__title--left {
    text-align: left;
}

/* =====================================================
   Кнопки
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.btn--primary {
    background-color: var(--color-primary);
    color: var(--color-text-white);
}

.btn--primary:hover {
    background-color: var(--color-accent);
    color: var(--color-text-white);
}

.btn--accent {
    background-color: var(--color-accent);
    color: var(--color-text-white);
}

.btn--accent:hover {
    background-color: var(--color-accent-hover);
    color: var(--color-text-white);
}

.btn--outline {
    background-color: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.btn--outline:hover {
    background-color: var(--color-primary);
    color: var(--color-text-white);
}

.btn--success {
    background-color: var(--color-success);
    color: var(--color-text-white);
}

.btn--danger {
    background-color: var(--color-error);
    color: var(--color-text-white);
}

.btn--sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn--lg {
    padding: 16px 32px;
    font-size: 1.125rem;
}

.btn--block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =====================================================
   Формы
   ===================================================== */
.form {
    max-width: 600px;
}

.form--centered {
    margin: 0 auto;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--color-text);
}

.form-label--required::after {
    content: ' *';
    color: var(--color-error);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background-color: var(--color-bg-light);
    transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-text-muted);
}

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

.form-select {
    cursor: pointer;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.form-checkbox input {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.form-error {
    color: var(--color-error);
    font-size: 0.875rem;
    margin-top: 5px;
}

.form-hint {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    margin-top: 5px;
}

/* =====================================================
   Сообщения 
   ===================================================== */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.alert--success {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.alert--error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.alert--warning {
    background-color: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
}

.alert--info {
    background-color: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

.errors {
    margin-bottom: 20px;
}

.errors p {
    color: var(--color-error);
    margin-bottom: 5px;
}

/* =====================================================
   Карточки
   ===================================================== */
.card {
    background-color: var(--color-bg-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card__image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
}

.card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.card:hover .card__image img {
    transform: scale(1.05);
}

.card__body {
    padding: 20px;
}

.card__title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.card__text {
    color: var(--color-text-light);
    font-size: 0.875rem;
    margin-bottom: 15px;
}

.card__price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
}

.card__price--old {
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-text-muted);
    text-decoration: line-through;
    margin-right: 10px;
}

/* =====================================================
   Сетка товаров
   ===================================================== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/* =====================================================
   Бейджи
   ===================================================== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.badge--new {
    background-color: var(--color-info);
    color: white;
}

.badge--sale {
    background-color: var(--color-error);
    color: white;
}

.badge--featured {
    background-color: var(--color-accent);
    color: white;
}

.badge--custom {
    background-color: var(--color-primary);
    color: white;
}

/* =====================================================
   Статусы
   ===================================================== */
.status {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
}

.status--new {
    background-color: #e3f2fd;
    color: #1565c0;
}

.status--processing {
    background-color: #fff3e0;
    color: #e65100;
}

.status--completed {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status--cancelled {
    background-color: #ffebee;
    color: #c62828;
}

.status--pending {
    background-color: #f5f5f5;
    color: #666666;
}

.status--approved {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status--rejected {
    background-color: #ffebee;
    color: #c62828;
}

/* =====================================================
   Пагинация
   ===================================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 40px;
}

.pagination__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-weight: 500;
}

.pagination__link:hover,
.pagination__link--active {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

/* =====================================================
   Таблицы
   ===================================================== */
.table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--color-bg-light);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table th,
.table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.table th {
    background-color: var(--color-primary);
    color: white;
    font-weight: 600;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background-color: #f9f9f9;
}

/* =====================================================
   Хлебные крошки (с микроразметкой Schema.org)
   ===================================================== */
.breadcrumbs {
    margin-bottom: 30px;
    font-size: 0.875rem;
}

.breadcrumbs__list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.breadcrumbs__item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.breadcrumbs__item::after {
    content: '/';
    color: var(--color-text-muted);
}

.breadcrumbs__item:last-child::after {
    display: none;
}

.breadcrumbs__item a {
    color: var(--color-text-light);
}

.breadcrumbs__item a:hover {
    color: var(--color-accent);
}

.breadcrumbs__item span {
    color: var(--color-text);
}

.breadcrumbs__item:last-child span {
    font-weight: 500;
}

.breadcrumbs__link {
    color: var(--color-text-light);
}

.breadcrumbs__link:hover {
    color: var(--color-accent);
}

.breadcrumbs__current {
    color: var(--color-text);
    font-weight: 500;
}

/* =====================================================
   Утилиты
   ===================================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mt-4 { margin-top: 40px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.mb-4 { margin-bottom: 40px; }

.hidden { display: none !important; }
.visible { display: block !important; }

/* =====================================================
   Адаптивность
   ===================================================== */
@media (max-width: 1024px) {
    :root {
        --header-height: 80px;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }

    .section {
        padding: 40px 0;
    }

    .section__title {
        font-size: 1.75rem;
        margin-bottom: 30px;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }

    .section {
        padding: 30px 0;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 1.5rem; }

    .products-grid {
        grid-template-columns: 1fr;
    }

    .btn {
        padding: 10px 20px;
    }
}

