* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --accent: #e84393;
    --accent-dark: #c1356f;
    --gold: #d4a574;
    --bg: #fdf6f0;
    --white: #ffffff;
    --text: #3d2c2a;
    --text-light: #7a6a65;
    --shadow: 0 4px 20px rgba(0,0,0,0.06);
    --radius: 16px;
    --radius-sm: 10px;
    --font-main: 'Montserrat', sans-serif;
    --font-title: 'Playfair Display', serif;
}

html { scroll-behavior: smooth; }
body { font-family: var(--font-main); background: var(--bg); color: var(--text); line-height: 1.6; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* Header */
.header { background: var(--white); box-shadow: 0 2px 10px rgba(0,0,0,0.04); position: sticky; top: 0; z-index: 100; }
.header__inner { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; flex-wrap: wrap; gap: 10px; }
.logo { font-family: var(--font-title); font-size: 1.6rem; font-weight: 700; color: var(--accent); }
.header__nav { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.header__link { font-weight: 500; font-size: 0.95rem; color: var(--text); transition: color 0.3s; }
.header__link:hover { color: var(--accent); }
.header__telegram { background: #2AABEE; color: #fff; padding: 8px 16px; border-radius: 20px; font-size: 0.9rem; }
.header__telegram:hover { background: #2299d6; color: #fff; }
.fav-count { background: var(--accent); color: #fff; border-radius: 50%; padding: 2px 7px; font-size: 0.75rem; margin-left: 2px; }

/* Hero */
.hero {
    text-align: center;
    padding: 60px 20px 40px;
    background-image: url('uploads/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative; /* если понадобится затемнение */
    color: #fff; /* если текст должен быть белым поверх картинки */
	--text-light: #792525;

	 overflow: hidden;  
}

/* Лёгкое затемнение для читаемости текста (по желанию) */
.hero::before {
    content: '';
    position: absolute;
    top: -10px;                /* небольшой запас, чтобы края не обрезались */
    left: -10px;
    right: -10px;
    bottom: -10px;
    background-image: url('uploads/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(2px);         /* нужная степень размытия */
    z-index: 0;
}

/* Чтобы текст был поверх затемнения */
.hero > * {
    position: relative;
    z-index: 1;
}
.hero__title { font-family: var(--font-title); font-size: 2.8rem; color: var(--accent-dark); margin-bottom: 12px; }
.hero__subtitle { font-size: 1.15rem; color: var(--text-light); margin-bottom: 24px; }
.btn { display: inline-block; padding: 12px 28px; border-radius: 30px; font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: all 0.3s; border: none; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); transform: translateY(-2px); }
.btn--outline { background: transparent; border: 2px solid var(--accent); color: var(--accent); padding: 8px 20px; font-size: 0.85rem; }
.btn--outline:hover { background: var(--accent); color: #fff; }
.btn--telegram { background: #2AABEE; color: #fff; padding: 8px 20px; font-size: 0.85rem; border-radius: 20px; }
.btn--telegram:hover { background: #2299d6; color: #fff; }
.btn--lg { padding: 14px 32px; font-size: 1rem; }
.btn--danger { background: #e74c3c; color: #fff; }
.btn--danger:hover { background: #c0392b; }

/* Section */
.section-title { font-family: var(--font-title); font-size: 2rem; text-align: center; margin: 50px 0 30px; color: var(--accent-dark); }

/* Filter */
.filter { display: flex; justify-content: center; gap: 10px; margin-bottom: 30px; flex-wrap: wrap; }
.filter__btn { padding: 8px 20px; border-radius: 25px; border: 2px solid #e0d6cf; background: #fff; cursor: pointer; font-weight: 500; font-size: 0.9rem; transition: all 0.3s; color: var(--text-light); }
.filter__btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.filter__btn:hover:not(.active) { border-color: var(--accent); color: var(--accent); }

/* Products Grid */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; margin-bottom: 40px; }
.product-card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform 0.3s, box-shadow 0.3s; position: relative; }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,0.1); }
.product-card__image { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: #f5f0eb; }
.product-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.product-card:hover .product-card__image img { transform: scale(1.05); }
.fav-heart { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,0.9); border: none; border-radius: 50%; width: 36px; height: 36px; font-size: 1.3rem; cursor: pointer; z-index: 2; transition: all 0.3s; display: flex; align-items: center; justify-content: center; color: #ccc; }
.fav-heart.liked { color: #e74c3c; }
.fav-heart:hover { transform: scale(1.1); }
.product-card__body { padding: 16px; }
.product-card__title { font-weight: 600; font-size: 1.05rem; margin-bottom: 6px; color: var(--text); }
.product-card__desc { font-size: 0.85rem; color: var(--text-light); margin-bottom: 14px; line-height: 1.5; }
.product-card__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Modal */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 200; }
.modal.active { display: flex; align-items: center; justify-content: center; }
.modal__overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.modal__content { position: relative; background: #fff; border-radius: var(--radius); max-width: 700px; width: 90%; max-height: 85vh; overflow-y: auto; padding: 30px; display: flex; gap: 24px; flex-wrap: wrap; }
.modal__close { position: absolute; top: 12px; right: 16px; background: none; border: none; font-size: 2rem; cursor: pointer; color: #999; z-index: 1; }
.modal__image { flex: 1 1 250px; max-width: 300px; }
.modal__image img { width: 100%; border-radius: var(--radius-sm); }
.modal__info { flex: 1 1 250px; }
.modal__info h3 { font-size: 1.4rem; margin-bottom: 10px; }
.modal__info p { color: var(--text-light); margin-bottom: 10px; line-height: 1.7; }
.modal__category { display: inline-block; background: #fce4ec; color: var(--accent-dark); padding: 4px 14px; border-radius: 20px; font-size: 0.8rem; margin-bottom: 16px; }
.modal__content--fav { display: block; }
.empty-msg { text-align: center; color: var(--text-light); font-size: 1.1rem; padding: 40px; }

/* Footer */
.footer { text-align: center; padding: 30px; background: #fff; margin-top: 40px; color: var(--text-light); }
.footer a { color: var(--accent); }

/* Admin */
.admin-body { background: #f5f6fa; min-height: 100vh; }
.admin-header { background: #2c3e50; color: #fff; padding: 14px 30px; display: flex; justify-content: space-between; align-items: center; }
.admin-header a { color: #fff; }
.admin-main { max-width: 1100px; margin: 30px auto; padding: 0 20px; }
.admin-card { background: #fff; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 24px; }
.admin-card h3 { margin-bottom: 16px; color: #2c3e50; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 0.9rem; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 14px; border: 2px solid #e0e0e0; border-radius: var(--radius-sm); font-family: var(--font-main); font-size: 0.95rem; transition: border 0.3s; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); }
.form-group textarea { resize: vertical; min-height: 80px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th { background: #f8f9fa; padding: 10px; text-align: left; }
.admin-table td { padding: 10px; border-bottom: 1px solid #eee; }
.admin-table img { width: 50px; height: 50px; object-fit: cover; border-radius: 6px; }
.login-form { max-width: 400px; margin: 100px auto; }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; }
.alert--error { background: #ffeaea; color: #c0392b; border: 1px solid #f5c6cb; }
.alert--success { background: #eaffea; color: #27ae60; border: 1px solid #c3e6cb; }

@media (max-width: 600px) {
    .hero__title { font-size: 1.8rem; }
    .header__inner { flex-direction: column; }
    .header__nav { gap: 10px; }
    .products-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
      /* Модальное окно — всё в колонку, без переносов */
    .modal__content {
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        width: 95%;
        max-height: 90vh;
        padding: 20px 16px;
        overflow-y: auto;      /* если контент длинный, будет скролл внутри */
    }

    .modal__gallery,
    .modal__info {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        margin: 0;
    }

    .modal__gallery {
        order: 1;   /* галерея сверху */
    }

    .modal__info {
        order: 2;   /* описание снизу */
    }

    .gallery-main img {
        width: 100%;
        height: auto;
        max-height: 50vh;
        object-fit: contain;
    }

    .modal__close {
        top: 8px;
        right: 12px;
    }
    .modal__image { max-width: 100%; }
}

/* Цена */
.product-card__price {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 4px;
}

/* Бейджик с количеством фото */
.gallery-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    z-index: 2;
}

/* Модалка с галереей */
.modal__content--gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}
.modal__gallery {
    flex: 1 1 300px;
    max-width: 450px;
}
.gallery-main {
    position: relative;
    margin-bottom: 10px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.gallery-main img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-sm);
}
.gallery-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}
.gallery-arrow {
    pointer-events: auto;
    background: rgba(255,255,255,0.9);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    color: var(--text);
}
.gallery-arrow:hover {
    background: #fff;
    transform: scale(1.1);
}
.gallery-thumbs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.gallery-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.7;
    transition: 0.2s;
}
.gallery-thumb.active {
    border-color: var(--accent);
    opacity: 1;
}
.gallery-thumb:hover {
    opacity: 1;
}
.modal__info {
    flex: 1 1 200px;
}
.modal__price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-dark);
    margin-bottom: 10px;
}

@media (max-width: 600px) {
    .modal__content--gallery {
        flex-direction: column;
    }
    .modal__gallery {
        max-width: 100%;
		flex: none;
    }
	.modal__info {
    flex: none;
}
}