:root {
    --bg-main: #f3f4f6;
    --bg-muted: #e5e7eb;
    --bg-header: #111827;
    --bg-card: #ffffff;
    --bg-footer: #111827;
    --text-main: #111827;
    --text-muted: #6b7280;
    --accent: #2563eb;
    --accent-soft: #dbeafe;
    --border-soft: #e5e7eb;
    --danger: #dc2626;
    --success: #16a34a;
    --radius-lg: 12px;
    --radius-md: 8px;
    --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.12);
    --transition-fast: 0.2s ease;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
}

a {
    color: var(--accent);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

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

/* Layout */

.container {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 16px;
}

.page-main {
    padding-top: 72px;
}

/* Header */

.site-header {
    position: fixed;
    inset-block-start: 0;
    inset-inline: 0;
    z-index: 50;
    background-color: rgba(17, 24, 39, 0.96);
    color: #f9fafb;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.6);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: inherit;
}
.logo-img {
    height: 32px;
    width: auto;
}
.logo-text {
    font-weight: 600;
    font-size: 18px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-inline-start: 24px;
    flex: 1;
}

.nav-link {
    color: #e5e7eb;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 14px;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}
.nav-link:hover {
    background-color: rgba(55, 65, 81, 0.9);
    text-decoration: none;
}
.nav-link.is-active {
    background-color: var(--accent);
    color: #ffffff;
}

.nav-link-cart {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: rgba(37, 99, 235, 0.12);
}
.cart-icon {
    font-size: 16px;
}
.cart-count-badge {
    min-width: 20px;
    padding-inline: 6px;
    border-radius: 999px;
    background-color: var(--accent);
    color: #ffffff;
    font-size: 12px;
    text-align: center;
}

.header-contacts {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-size: 13px;
}
.header-phone,
.header-email {
    color: #e5e7eb;
}
.header-phone:hover,
.header-email:hover {
    color: #ffffff;
}

.nav-toggle {
    display: none;
    border: none;
    background: transparent;
    color: #e5e7eb;
    font-size: 22px;
}

/* Hero */

.hero {
    position: relative;
    background-size: cover;
    background-position: center;
    color: #f9fafb;
    padding: 96px 0 72px;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.42), transparent 60%),
                linear-gradient(to bottom, rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0.95));
}
.hero-inner {
    position: relative;
    z-index: 1;
}
.hero-text {
    max-width: 640px;
}
.hero h1 {
    font-size: 32px;
    margin: 0 0 12px;
}
.hero p {
    margin: 0 0 20px;
    font-size: 16px;
    color: #e5e7eb;
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* Sections */

.section {
    padding: 40px 0;
}
.section-muted {
    background-color: #e5e7eb;
}
.section-title {
    margin: 0 0 12px;
    font-size: 24px;
}
.section-subtitle {
    margin: 0 0 24px;
    color: var(--text-muted);
}

.section-divider {
    margin: 32px 0;
    border: 0;
    border-top: 1px solid var(--border-soft);
}

/* Cards */

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.feature-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-soft);
}
.feature-card h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 16px;
}
.feature-card p {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary {
    background-color: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}
.btn-primary:hover {
    background-color: #1d4ed8;
    box-shadow: var(--shadow-soft);
    text-decoration: none;
}
.btn-outline {
    background-color: transparent;
    color: #e5e7eb;
    border-color: rgba(229, 231, 235, 0.6);
}
.btn-outline:hover {
    background-color: rgba(17, 24, 39, 0.9);
}
.btn-sm {
    padding: 6px 10px;
    font-size: 13px;
}

/* Products */

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.product-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.product-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.product-sku {
    font-size: 13px;
    color: var(--text-muted);
}
.product-name {
    margin: 0;
    font-size: 15px;
}
.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.product-price {
    margin-top: 4px;
    font-weight: 600;
}
.product-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.product-image-wrapper {
    position: relative;
    overflow: hidden;
    background-color: #111827;
}
.product-image-wrapper--large {
    border-radius: var(--radius-lg);
}
.product-image {
    width: 100%;
    height: auto;
    transition: transform 0.25s ease-out;
}
.product-image-wrapper:hover .product-image {
    transform: scale(1.08);
}

.product-image.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    background: repeating-linear-gradient(
        -45deg,
        #111827,
        #111827 6px,
        #1f2937 6px,
        #1f2937 12px
    );
    color: #e5e7eb;
    font-size: 13px;
}
.product-image.placeholder.small {
    min-height: 70px;
    font-size: 11px;
}
.product-image.placeholder.large {
    min-height: 260px;
}

/* Badges */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 12px;
    background-color: var(--accent-soft);
    color: #1d4ed8;
}
.badge-outline {
    background-color: transparent;
    border: 1px solid #d1d5db;
    color: var(--text-muted);
}

/* Steps */

.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.step-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-soft);
}
.step-number {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background-color: var(--accent-soft);
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Inquiry block */

.inquiry-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* Tables */

.catalog-table-wrapper {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}
.catalog-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.catalog-table th,
.catalog-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-soft);
}
/* Первый и последний столбцы по центру: Фото и Заявка */
.catalog-table th:first-child,
.catalog-table td:first-child {
    text-align: center;
    width: 90px; /* чтобы колонка под фото была ровной */
}

.catalog-table th:last-child,
.catalog-table td:last-child {
    text-align: center;
    width: 110px; /* колонка под кнопки "В заявку" */
}
/* Столбец с ценой — по правому краю, чтобы смотрелось ровно */
.price-cell {
    text-align: right;
    white-space: nowrap;
}


/* Badges (статусы: Новый, Б/У, наличие и т.п.) */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}

.badge + .badge {
    margin-left: 4px;
}

/* Состояние товара */
.badge--new {
    background-color: rgba(22, 163, 74, 0.10); /* зелёный мягкий */
    color: #15803d;
}

.badge--used {
    background-color: rgba(234, 179, 8, 0.14); /* жёлтый/оранжевый */
    color: #92400e;
}

/* Наличие */
.badge--in-stock {
    background-color: rgba(22, 163, 74, 0.10);
    color: #15803d;
}

.badge--preorder {
    background-color: rgba(37, 99, 235, 0.10);
    color: #1d4ed8;
}

.badge--nostock {
    background-color: rgba(156, 163, 175, 0.16);
    color: #4b5563;
}

/* Дополнительные подписи количества и т.п. */
.status-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-align: center;
}

.status-note {
    font-size: 11px;
    color: var(--text-muted);
}


.catalog-table th {
    text-align: left;
    background-color: #f9fafb;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6b7280;
}
.catalog-table tr:hover td {
    background-color: #f3f4f6;
}
.table-image-wrapper {
    width: 80px;
}

/* Filters */

.catalog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    margin-bottom: 16px;
    align-items: flex-end;
}
.field-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 180px;
}
.field-group--submit {
    min-width: auto;
}
.field-group label {
    font-size: 12px;
    color: var(--text-muted);
}
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="file"],
select,
textarea {
    border-radius: var(--radius-md);
    border: 1px solid #d1d5db;
    padding: 7px 10px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}
input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.35);
    background-color: #ffffff;
}
textarea {
    resize: vertical;
}

/* Product layout */

.product-layout {
    display: grid;
    grid-template-columns: minmax(0, 40%) minmax(0, 60%);
    gap: 24px;
}
.product-detail-sku {
    margin-bottom: 4px;
}
.product-detail-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}
.product-detail-price {
    font-size: 18px;
    margin-bottom: 8px;
}
.product-detail-stock {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.product-detail-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}
.qty-input {
    width: 80px;
}
.product-detail-note {
    font-size: 13px;
    color: var(--text-muted);
}

/* Pagination */

.pagination {
    margin-top: 16px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.page-link {
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    font-size: 13px;
    color: var(--text-main);
    text-decoration: none;
}
.page-link.is-active {
    background-color: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}
.page-link:hover {
    text-decoration: none;
    border-color: var(--accent);
}

/* Forms */

.form {
    margin-top: 8px;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 20px;
}
.field-group--full {
    grid-column: 1 / -1;
}
.req {
    color: var(--danger);
    margin-left: 2px;
}
.form-actions {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.form-status {
    font-size: 13px;
    color: var(--text-muted);
}

/* Cart */

.cart-table-wrapper {
    margin-bottom: 24px;
}
.cart-summary {
    padding: 10px 12px 14px;
    text-align: right;
    font-size: 14px;
}
.cart-summary-line strong {
    font-size: 16px;
}

/* Alerts */

.alert {
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 14px;
}
.alert-muted {
    background-color: #e5e7eb;
    color: #374151;
}

/* Footer */

.site-footer {
    margin-top: 40px;
    background-color: var(--bg-footer);
    color: #9ca3af;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 24px;
    padding: 24px 16px 18px;
}
.footer-logo {
    font-weight: 600;
    font-size: 18px;
    margin-bottom: 6px;
    color: #e5e7eb;
}
.footer-title {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 14px;
    color: #e5e7eb;
}
.footer-text {
    margin: 0 0 6px;
    font-size: 13px;
}
.footer-bottom {
    border-top: 1px solid #1f2937;
}
.footer-bottom-inner {
    padding: 10px 16px;
    font-size: 12px;
}

/* Contacts */

.contacts-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 24px;
}
.contacts-list {
    list-style: none;
    padding-left: 0;
    margin: 0 0 12px;
}
.contacts-list li {
    margin-bottom: 4px;
}

/* Text */

.text-block p {
    margin-top: 0;
    margin-bottom: 10px;
}
.text-block ul {
    margin-top: 0;
}

/* Utility */

.mt-1 {
    margin-top: 8px;
}

/* Animations for cart */

.cart-badge-pulse {
    animation: cartPulse 0.4s ease-out;
}
@keyframes cartPulse {
    0% { transform: scale(1); }
    40% { transform: scale(1.18); }
    100% { transform: scale(1); }
}
.add-to-cart-fly {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    font-size: 20px;
}

/* Responsive */

@media (max-width: 960px) {
    .features-grid,
    .products-grid,
    .steps-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .product-layout {
        grid-template-columns: minmax(0, 1fr);
    }
    .contacts-layout,
    .footer-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .hero {
        padding-top: 88px;
    }
}

@media (max-width: 720px) {
    .header-inner {
        flex-wrap: wrap;
        align-items: center;
    }
    .main-nav {
        position: absolute;
        inset-inline: 0;
        top: 48px;
        background-color: #111827;
        padding: 8px 16px 10px;
        flex-direction: column;
        align-items: flex-start;
        display: none;
    }
    .main-nav.is-open {
        display: flex;
    }
    .nav-toggle {
        display: block;
    }
    .header-contacts {
        margin-left: auto;
    }
    .features-grid,
    .products-grid,
    .steps-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .catalog-table {
        font-size: 12px;
    }
    .hero h1 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .form-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}
.inn-with-file {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Кнопка "Загрузить карточку" — делаем заметной */
.inn-with-file .inn-upload-label {
    cursor: pointer;
    white-space: nowrap;

    /* усиливаем визуально */
    background-color: var(--accent-soft);
    color: var(--accent);
    border-radius: 999px;
    border: 1px solid var(--accent);
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.1);
    transition: background-color var(--transition-fast),
                color var(--transition-fast),
                box-shadow var(--transition-fast),
                transform var(--transition-fast);
}

.inn-with-file .inn-upload-label:hover {
    background-color: var(--accent);
    color: #ffffff;
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}

.inn-upload-label input[type="file"] {
    display: none;
}

.field-hint {
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
}
