Загрузка данных


:root {
    --primary-color: #e53935;
    --primary-dark: #3f0b0b;

    --secondary-color: #ff9800;

    --background-color: #f3f4f6;
    --card-color: #ffffff;

    --text-color: #1f2937;
    --muted-color: #6b7280;

    --border-color: #e5e7eb;

    --success-color: #16a34a;

    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 10px 25px rgba(237, 238, 192, 0.815);

    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(135deg, #f8fafc, #eef2f7);
    color: var(--text-color);
    line-height: 1.5;
}

.page {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.cart a {
    color: #ffffff;
    text-decoration: none;
}

.header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    background: #ffffff;
    border-bottom: 3px solid var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.logo {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #202020;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.logo span {
    color: var(--primary-color);
}

.search {
    display: flex;
    width: 100%;
}

.search input {
    min-width: 0;
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px 0 0 8px;
    background: #ffffff;
    color: var(--text-color);
    font-size: 15px;
    outline: none;
}

.search input:focus {
    border-color: var(--primary-color);
}

.search button {
    padding: 12px 18px;
    border: none;
    border-radius: 0 8px 8px 0;
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.search button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.cart {
    padding: 10px 16px;
    background: var(--secondary-color);
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

.sidebar {
    height: fit-content;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.sidebar h2 {
    margin-bottom: 15px;
    font-size: 17px;
    color: var(--text-color);
    text-transform: uppercase;
}

.filter {
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.filter:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.filter label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: #4b5563;
    cursor: pointer;
    transition: color 0.2s ease;
}

.filter label:hover {
    color: var(--primary-color);
}

.filter input {
    accent-color: var(--primary-color);
}

.catalog {
    min-width: 0;
}

.catalog-header {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.catalog-header h1 {
    font-size: 28px;
    color: var(--text-color);
    margin-bottom: 5px;
}

.catalog-header p {
    color: var(--muted-color);
}

.catalog-header select {
    width: 100%;
    padding: 11px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    color: var(--text-color);
    cursor: pointer;
}

.products {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.product-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--card-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: #d1d5db;
}

.product-image {
    position: relative;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, #f8fafc, #e5e7eb);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 15px;
    transition: transform 0.4s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    padding: 5px 9px;
    border-radius: 6px;
    background: var(--success-color);
    color: white;
    font-size: 11px;
    font-weight: 700;
}

.badge.popular {
    background-color: blueviolet;
}

.badge.sale {
    background-color: red;
}

.badge.new {
    background-color: aqua;
    color: #003a3a;
}

.product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 18px;
}

.product-info h2 {
    margin-bottom: 8px;
    font-size: 19px;
    color: var(--text-color);
}

.description {
    flex: 1;
    margin-bottom: 12px;
    color: var(--muted-color);
    font-size: 14px;
}

.rating {
    margin-bottom: 15px;
    color: #f59e0b;
    font-size: 15px;
}

.rating span {
    margin-left: 5px;
    color: var(--muted-color);
    font-size: 13px;
}

.product-bottom {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.price {
    display: flex;
    flex-direction: column;
}

.price strong {
    font-size: 22px;
    color: var(--text-color);
}

.buy-button {
    display: inline-block;
    width: 100%;
    padding: 11px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    z-index: 1;
}

.buy-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(229, 57, 53, 0.3);
}

.buy-button:active {
    transform: scale(0.97);
    opacity: 0.85;
}

.footer {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 30px 20px;
    background: #ffffff;
    border-top: 1px solid var(--border-color);
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-column h3 {
    color: var(--text-color);
    font-size: 16px;
}

.footer-column p {
    color: var(--muted-color);
}

.footer-column a {
    color: var(--muted-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-column a:hover {
    color: var(--primary-color);
}

.copyright {
    grid-column: 1 / -1;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    color: var(--muted-color);
    font-size: 13px;
}

/* ---------- Модальное окно товара (без картинки) ---------- */

.product-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.65);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.product-modal:target {
    display: flex;
}

.modal-card {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px 25px 25px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to   { opacity: 1; transform: translateY(0); }
}

.modal-card h2 {
    margin-bottom: 12px;
    font-size: 24px;
    color: var(--text-color);
    padding-right: 30px;
}

.modal-card p {
    margin-bottom: 20px;
    color: var(--muted-color);
    font-size: 15px;
    line-height: 1.6;
}

.modal-price {
    font-size: 26px;
    font-weight: bold;
    color: var(--primary-color);
}

.close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    z-index: 10;
    color: #333;
    text-decoration: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
}

.close-button:hover {
    color: var(--primary-color);
}

/* ---------- Адаптив ---------- */

@media (min-width: 600px) {
    .header {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }

    .search {
        flex: 1;
        max-width: 500px;
        margin: 0 auto;
    }

    .main {
        grid-template-columns: 220px 1fr;
    }

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

    .catalog-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .catalog-header select {
        width: 220px;
    }

    .product-bottom {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .buy-button {
        width: auto;
        padding-left: 18px;
        padding-right: 18px;
    }

    .footer {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .header {
        padding: 20px 40px;
    }

    .main {
        grid-template-columns: 240px 1fr;
        padding: 30px;
    }

    .products {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer {
        grid-template-columns: repeat(3, 1fr);
        padding: 40px;
    }
}

@media (min-width: 1200px) {
    .header {
        padding-left: 50px;
        padding-right: 50px;
    }

    .main {
        grid-template-columns: 260px 1fr;
        gap: 30px;
    }

    .products {
        grid-template-columns: repeat(4, 1fr);
    }
}