@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Yeseva+One&display=swap');

:root {
    --bg: #09070b;
    --p: #17111b;
    --l: #38293d;
    --t: #eee7ee;
    --m: #a99eac;
    --a: #c8a0d7;
}


/* =========================
   БАЗА
   ========================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;

    color: var(--t);
    background:
        linear-gradient(
            180deg,
            rgba(5, 4, 9, 0.30) 0%,
            rgba(5, 4, 9, 0.18) 28%,
            rgba(5, 4, 9, 0.42) 55%,
            rgba(5, 4, 9, 0.78) 78%,
            rgba(5, 4, 9, 0.96) 100%
        ),
        url("bg-hero.png") center top / cover fixed no-repeat,
        var(--bg);

    font-family: Inter, Arial, sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}


/* =========================
   ШАПКА
   ========================= */

header {
    height: 70px;
    padding: 0 5%;

    display: flex;
    justify-content: space-between;
    align-items: center;

    position: sticky;
    top: 0;
    z-index: 10;

    border-bottom: 1px solid rgba(56, 41, 61, 0.75);

    background: rgba(9, 7, 11, 0.82);
    backdrop-filter: blur(12px);

    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.25);
}


/* Название магазина в шапке */

.brand {
    font-family: Inter, Arial, sans-serif;
    font-weight: 900;
    letter-spacing: 0.15em;
}


/* Навигация */

nav {
    display: flex;
    align-items: center;
    gap: 0;
}

nav a {
    position: relative;

    color: var(--t);
    font-size: 14px;
    font-weight: 600;

    transition:
        color 0.25s ease,
        opacity 0.25s ease;
}

nav a:hover {
    color: var(--a);
}


/* Звёздочка между пунктами */

header nav a + a::before {
    content: "✦";

    color: var(--a);

    margin: 0 18px;

    font-size: 10px;
    vertical-align: middle;
}


/* =========================
   ОБЩИЕ ЗАГОЛОВКИ
   ========================= */

.brand,
h1,
h2,
h3 {
    font-family: Inter, Arial, sans-serif;
}


/* =========================
   ГЛАВНЫЙ ЭКРАН
   ========================= */

.hero {
    max-width: 1150px;
    min-height: 400px;

    margin: auto;
    padding: 60px 30px;

    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
}


/* Маленькая надпись над названием */

.hero p,
main > p,
.heading p {
    letter-spacing: 0.2em;
    color: var(--a);

    font-size: 11px;
    font-weight: 700;
}


/* Главное название */

.hero h1 {
    margin: 10px 0 18px;

    font-family: "Yeseva One", Georgia, serif;

    font-size: clamp(46px, 6.5vw, 82px);
    font-weight: 400;

    line-height: 0.98;
    letter-spacing: 0.015em;

    color: #eee7ee;

    text-shadow:
        0 2px 10px rgba(0, 0, 0, 0.55),
        0 0 18px rgba(200, 160, 215, 0.08);
}


/* Выделенная часть ЛИЯ */

.hero h1 span {
    color: #c8a0d7;
}


/* Подзаголовок */

.hero h2 {
    max-width: 450px;

    color: var(--m);

    font-family: Inter, Arial, sans-serif;
    font-weight: 400;
}


/* Декоративная луна, если используется */

.moon {
    text-align: center;

    font-size: 250px;

    opacity: 0.12;
}


/* =========================
   КНОПКИ
   ========================= */

.btn,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;

    padding: 9px 14px;

    border: 1px solid #765282;
    border-radius: 5px;

    background: rgba(36, 24, 41, 0.88);

    color: white;

    cursor: pointer;

    font-family: inherit;
    font-size: 14px;
    font-weight: 600;

    line-height: 1.2;

    transition:
        background 0.25s ease,
        border-color 0.25s ease,
        transform 0.2s ease;
}

.btn:hover,
button:hover {
    border-color: var(--a);

    background: rgba(56, 38, 64, 0.95);

    transform: translateY(-1px);
}


/* =========================
   КАТАЛОГ
   ========================= */

main {
    max-width: 1150px;

    margin: auto;

    padding: 35px 25px 80px;
}

.heading {
    display: flex;
    justify-content: space-between;
    align-items: end;

    margin-bottom: 25px;
}

.heading h2,
h1 {
    margin: 5px 0;
}


/* 5 товаров в ряд на большом экране */

.grid {
    display: grid;

    grid-template-columns: repeat(5, 1fr);

    gap: 24px 16px;
}
/* Планшет */
@media (max-width: 900px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Телефон */
@media (max-width: 600px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px 10px;
    }
}

/* Очень узкий телефон */
@media (max-width: 380px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

/* =========================
   КАРТОЧКА ТОВАРА
   ========================= */

.card,
.panel {
    overflow: hidden;

    background:
        linear-gradient(
            180deg,
            rgba(24, 18, 28, 0.94),
            rgba(16, 12, 19, 0.97)
        );

    border: 1px solid rgba(56, 41, 61, 0.85);
    border-radius: 9px;

    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.22);

    transition:
        transform 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}
.card:hover {
    transform: translateY(-3px);

    border-color: rgba(200, 160, 215, 0.55);

    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.35);
}

/* Фотография товара */

.card > img,
.ph {
    width: 100%;

    aspect-ratio: 1;

    object-fit: cover;

    background: #0e0a10;
}
.card > img {
    transition: transform 0.4s ease;
}

.card:hover > img {
    transform: scale(1.035);
}

/* Если изображения нет */

.ph {
    display: grid;
    place-items: center;

    color: #5d4963;

    font-family: "Russo One", Arial, sans-serif;
    font-size: 25px;
}


/* Содержимое карточки */

.body {
    padding: 15px;

    display: flex;
    flex-direction: column;

    min-height: 205px;
}


/* Название товара —
   только одна строка */

.body h3 {
    margin: 0;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;
}


/* Описание —
   максимум две строки */

.body p {
    min-height: 45px;

    margin-bottom: 0;

    color: var(--m);

    line-height: 1.5;

    display: -webkit-box;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;

    overflow: hidden;
}


/* Нижняя часть карточки */

.bottom {
    display: flex;
    flex-direction: column;
    align-items: stretch;

    gap: 9px;

    margin-top: auto;
    padding-top: 14px;
}


/* Цена */

.bottom b {
    font-size: 22px;
    line-height: 1.2;
}


/* Остаток */

.stock {
    color: var(--m);

    font-size: 13px;
    line-height: 1.2;
}


/* Кнопка WhatsApp */

.bottom .btn {
    width: 100%;

    margin-top: 4px;

    text-align: center;
}


/* =========================
   ПОДВАЛ
   ========================= */

footer {
    display: flex;
    justify-content: space-between;

    padding: 25px 5%;

    color: var(--m);

    border-top: 1px solid var(--l);
}


/* =========================
   АДМИН-ПАНЕЛЬ
   ========================= */

.admin {
    max-width: 1000px;
}

.panel {
    padding: 24px;

    margin: 25px 0;
}


.form {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 16px;
}


.form label {
    display: grid;

    gap: 6px;

    color: #cfc4d2;

    font-size: 13px;
}


.form input,
.form textarea {
    padding: 11px;

    background: #0c0910;

    border: 1px solid var(--l);
    border-radius: 5px;

    color: white;

    font: inherit;
}


.wide {
    grid-column: 1 / -1;
}


.check {
    display: flex !important;
    align-items: center;

    gap: 8px;
}


.hidden {
    display: none !important;
}


.preview {
    max-width: 180px;
    max-height: 180px;

    object-fit: cover;
}


/* Строка товара в админке */

.row {
    display: grid;

    grid-template-columns: 65px 1fr auto;

    gap: 12px;

    align-items: center;

    padding: 12px;

    border-top: 1px solid var(--l);
}


.row img {
    width: 65px;
    height: 65px;

    object-fit: cover;
}


.row button {
    padding: 7px 10px;

    margin: 2px;
}


/* Авторизация */

.auth-panel {
    max-width: 500px;

    margin: 80px auto;
}


.auth-panel label {
    display: grid;

    gap: 6px;

    margin: 12px 0;
}


.auth-panel input {
    padding: 12px;

    background: #0c0910;

    border: 1px solid var(--l);

    color: white;
}


.auth-panel .btn {
    width: 100%;
}


/* Сообщения */

#err {
    margin-top: 10px;

    color: #e98b96;
}


#save {
    color: var(--m);
}


/* =========================
   АДАПТИВНОСТЬ
   ========================= */


/* Небольшой ноутбук / планшет в альбомной ориентации */

@media (max-width: 1100px) {

    .grid {
        grid-template-columns: repeat(4, 1fr);
    }

}


/* Планшет */

@media (max-width: 800px) {

    .hero {
        grid-template-columns: 1fr;

        min-height: 430px;
    }

    .moon {
        position: absolute;

        right: 5%;

        opacity: 0.08;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
    }

}


/* Телефон */

@media (max-width: 550px) {

    header {
        padding: 0 18px;
    }

    nav {
        gap: 0;
    }

    header nav a {
        font-size: 12px;
    }

    header nav a + a::before {
        margin: 0 10px;
    }

    .hero {
        padding: 45px 20px;

        min-height: 360px;
    }

    .hero h1 {
        font-size: 55px;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form {
        grid-template-columns: 1fr;
    }

    .wide {
        grid-column: auto;
    }

    .row {
        grid-template-columns: 55px 1fr;
    }

    .row > div:last-child {
        grid-column: 1 / -1;
    }

    main {
        padding: 25px 14px 60px;
    }

}
/* =========================
   МОДАЛЬНАЯ КАРТОЧКА ТОВАРА
   ========================= */

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 25px;

    overflow-y: auto;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: fixed;
    inset: 0;

    background: rgba(5, 4, 9, 0.78);
    backdrop-filter: blur(7px);
}

.modal-window {
    position: relative;
    z-index: 1;

    width: min(900px, 100%);

    max-height: 90vh;
    overflow-y: auto;

    background:
        linear-gradient(
            180deg,
            rgba(27, 20, 31, 0.98),
            rgba(13, 10, 16, 0.99)
        );

    border: 1px solid rgba(200, 160, 215, 0.35);
    border-radius: 12px;

    box-shadow:
        0 25px 70px rgba(0, 0, 0, 0.65);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;

    z-index: 2;

    width: 38px;
    height: 38px;
    min-height: 38px;

    padding: 0;

    border: 1px solid rgba(200, 160, 215, 0.35);
    border-radius: 50%;

    background: rgba(9, 7, 11, 0.82);

    color: var(--t);

    font-size: 25px;
    font-weight: 400;
    line-height: 1;

    cursor: pointer;
}

.modal-close:hover {
    color: var(--a);
    border-color: var(--a);
    background: rgba(36, 24, 41, 0.95);
}

.modal-product {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 30px;

    padding: 30px;
}

.modal-product-image {
    width: 100%;

    aspect-ratio: 1;
    object-fit: cover;

    border-radius: 8px;

    background: #0e0a10;
}

.modal-product-info {
    display: flex;
    flex-direction: column;

    padding: 15px 10px 15px 0;
}

.modal-product-info h2 {
    margin: 0 40px 18px 0;

    font-size: clamp(24px, 3vw, 36px);
    line-height: 1.15;
}

.modal-description {
    color: var(--m);

    font-size: 15px;
    line-height: 1.65;

    white-space: pre-line;
}

.modal-price {
    margin-top: auto;
    padding-top: 25px;

    font-size: 28px;
    font-weight: 700;
}

.modal-stock {
    margin: 8px 0 18px;

    color: var(--m);

    font-size: 14px;
}

.modal-product-info .btn {
    width: 100%;
    margin-top: 5px;
}


/* Мобильная версия */

@media (max-width: 650px) {

    .modal {
        padding: 12px;
        align-items: flex-start;
    }

    .modal-window {
        max-height: 94vh;
    }

    .modal-product {
        grid-template-columns: 1fr;

        gap: 18px;

        padding: 20px;
    }

    .modal-product-info {
        padding: 0 5px 10px;
    }

    .modal-product-info h2 {
        margin-right: 35px;
    }

    .modal-price {
        margin-top: 15px;
        padding-top: 10px;
    }
}
/* =========================
   ФИЛЬТРЫ КАТЕГОРИЙ
   ========================= */

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -25px 0 18px;
    position: relative;
    z-index: 2;
}

.filter {
    min-height: 42px;
    padding: 9px 16px;
    border: 1px solid var(--a);
    border-radius: 6px;
    background: rgba(18, 12, 23, 0.88);
    color: var(--t);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.filter:hover,
.filter.active {
    background: rgba(200, 160, 215, 0.18);
    color: var(--a);
}

@media (max-width: 650px) {
    .filters {
        margin: -15px 0 16px;
        gap: 6px;
    }

    .filter {
        min-height: 40px;
        padding: 8px 12px;
    }
}
/* =========================
   ШАПКА И КОНТАКТЫ
   ========================= */

header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.contact-info {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;

    color: var(--t);
    font-size: 12px;
    line-height: 1.3;
    white-space: nowrap;
    text-align: center;
}

.contact-info a {
    color: var(--t);
    text-decoration: none;
}

.contact-info a:hover {
    color: var(--a);
}

@media (max-width: 800px) {
    header {
        flex-wrap: wrap;
    }

    .contact-info {
        position: static;
        transform: none;

        width: 100%;
        order: 3;

        padding-top: 6px;
        font-size: 11px;
        white-space: normal;
    }
}
/* =========================
   КАТЕГОРИИ КАТАЛОГА
   ========================= */

.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin-bottom: 20px;
}

.filters .filter {
    box-sizing: border-box;
    max-width: 100%;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.3;
    white-space: nowrap;
}

.toggle-categories {
    cursor: pointer;
}

.extra-categories {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.extra-categories.hidden {
    display: none;
}

.extra-categories .filter {
    flex: 0 1 auto;
}

@media (max-width: 600px) {
    .filters {
        gap: 7px;
    }

    .filters .filter {
        padding: 9px 11px;
        font-size: 12px;
    }

    .extra-categories {
        gap: 7px;
    }
}