/* ========== Магазин ========== */
.shop-container { padding: 2rem 0; }
.category { margin-bottom: 3rem; }
.category > h2 {
    background: var(--pink-light);
    display: inline-block;
    padding: 0.5rem 2rem;
    border-radius: 40px;
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
    color: var(--pink);
}
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}
.product-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    text-align: center;
    padding-bottom: 1rem;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.1);
}
.product-card .prod-img {
    width: 100%;
    height: 180px;
    display: block;
}
.product-card h4 {
    margin: 0.8rem 0.5rem 0.3rem;
    font-size: 1rem;
    color: var(--text);
}
.product-card .price {
    color: var(--pink);
    font-weight: bold;
    margin: 0.5rem 0;
    font-size: 1.1rem;
}
.product-card .prod-desc {
    font-size: 0.85rem;
    color: #666;
    padding: 0 0.8rem;
    flex: 1;
}
.product-card button {
    background: var(--pink);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 30px;
    cursor: pointer;
    margin-top: 0.8rem;
    transition: all 0.2s;
    font-family: inherit;
    font-weight: 500;
}
.product-card button:hover {
    background: var(--pink-dark);
    transform: scale(1.05);
}

/* ========== Компания ========== */
.company-content {
    background: white;
    border-radius: 30px;
    padding: 2rem;
    margin: 2rem auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}
.company-block { margin-bottom: 2rem; }
.company-block h2 {
    color: var(--pink);
    margin-bottom: 0.8rem;
}
.advantages-list { list-style: none; padding-left: 0; }
.advantages-list li {
    padding: 0.5rem 0 0.5rem 1.8rem;
    position: relative;
}
.advantages-list li::before {
    content: "✨";
    position: absolute;
    left: 0;
}

/* ========== Контакты ========== */
.contacts-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin: 2rem 0;
}
.contacts-info, .contacts-map {
    flex: 1;
    min-width: 280px;
    background: white;
    padding: 1.5rem;
    border-radius: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}
.contacts-info h2, .contacts-map h2 { color: var(--pink); margin-bottom: 1rem; }
.contacts-info p { margin-bottom: 0.6rem; }
.social-links { margin-top: 1rem; }
.social-links a {
    color: var(--pink);
    text-decoration: none;
    font-weight: 500;
}
.social-links a:hover { text-decoration: underline; }

/* ========== Витрина тематик (каталог магазина) ========== */

/* Теги тематик в карточке товара */
.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 6px 0 10px;
    justify-content: center;
}
.product-tag {
    font-size: 0.72rem;
    padding: 2px 10px;
    background: #fff0f5;
    color: var(--pink);
    border-radius: 50px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    font-weight: 500;
    white-space: nowrap;
}
.product-tag:hover {
    background: var(--pink);
    color: #fff;
}
.shop-controls-topics {
    margin-bottom: 2rem;
}
.topics-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 0.5rem;
}
.topic-tile {
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    transition: transform 0.25s, box-shadow 0.25s;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}
.topic-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(233,30,99,0.18);
}
.topic-tile-cover {
    position: relative;
    aspect-ratio: 16 / 11;
    background: linear-gradient(135deg, #fff0f5 0%, #f0f9ff 100%);
    overflow: hidden;
}
.topic-tile-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.topic-tile-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    opacity: 0.6;
}
.topic-tile-body {
    padding: 1rem 1.1rem 1.15rem;
    text-align: center;
}
.topic-tile-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}
.topic-tile-count {
    font-size: 0.82rem;
    color: var(--muted);
}
@media (max-width: 600px) {
    .topics-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    .topic-tile-body { padding: 0.7rem 0.8rem 0.85rem; }
    .topic-tile-name { font-size: 0.98rem; }
    .topic-tile-count { font-size: 0.76rem; }
}

/* Шапка страницы тематики */
.shop-topic-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 1.5rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid #f0e4ea;
}
.shop-topic-back {
    color: var(--pink);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    align-self: flex-start;
    padding: 4px 0;
}
.shop-topic-back:hover { text-decoration: underline; }

/* Хлебные крошки */
.shop-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 0.8rem;
}
.shop-breadcrumbs a {
    color: var(--pink);
    text-decoration: none;
}
.shop-breadcrumbs a:hover { text-decoration: underline; }
.shop-breadcrumbs .bc-sep { color: #c8b8c1; }
.shop-breadcrumbs .bc-current {
    color: var(--text);
    font-weight: 500;
}

/* Тумблер "Только в наличии" */
.shop-instock-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #fff;
    border: 1.5px solid #e8dce8;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.86rem;
    color: var(--text);
    transition: background 0.2s, border-color 0.2s;
    user-select: none;
}
.shop-instock-toggle:hover { border-color: var(--pink); }
.shop-instock-toggle input {
    width: 16px;
    height: 16px;
    accent-color: var(--pink);
    cursor: pointer;
}
.shop-topic-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    color: var(--text);
    margin: 0;
}
.shop-topic-count {
    color: var(--muted);
    font-size: 0.92rem;
}

/* ========== Витрина тематик (каталог магазина) — END ========== */

/* ========== КАРТОЧКИ ТОВАРОВ (обновлённые) ========== */
.shop-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
}
.filter-btn {
    padding: 6px 18px;
    border-radius: 50px;
    border: 1.5px solid #ddd;
    background: #fff;
    cursor: pointer;
    font-size: 0.88rem;
    font-family: 'Raleway', sans-serif;
    transition: all 0.2s;
    user-select: none;
}
.filter-btn:hover { border-color: var(--pink); color: var(--pink); }
.filter-btn.active {
    border-color: var(--pink);
    background: var(--pink);
    color: #fff;
}
.filter-btn[data-cat="all"]:not(.active) {
    border-color: #ddd;
    color: var(--muted);
}
.filter-selected-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--muted);
    margin-left: 4px;
    align-self: center;
}
.filter-selected-count button {
    background: none;
    border: none;
    color: var(--pink);
    cursor: pointer;
    font-size: 0.82rem;
    padding: 0;
    font-family: 'Raleway', sans-serif;
    text-decoration: underline;
}

/* ===== Аккордеон категорий ===== */
.cat-accordion { margin-bottom: 16px; }
.cat-row-main {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
}
/* Родительская кнопка с дочерними — показывает стрелку */
.filter-btn.has-children {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.filter-btn.has-children .cat-arrow {
    font-size: 0.65rem;
    transition: transform 0.2s;
    opacity: 0.7;
}
.filter-btn.has-children.expanded .cat-arrow {
    transform: rotate(90deg);
}
/* Подгруппы — появляются под родителем */
.cat-subcats {
    display: none;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 14px;
    background: var(--pink-light);
    border-radius: 14px;
    margin-top: 8px;
    animation: slideDown 0.2s ease;
}
.cat-subcats.open { display: flex; }
.cat-subcats .filter-btn {
    font-size: 0.82rem;
    padding: 5px 14px;
    background: #fff;
}
.cat-subcats .filter-btn.active {
    background: var(--pink);
    color: #fff;
    border-color: var(--pink);
}
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
@media (max-width: 600px) {
    .cat-subcats { padding: 8px 10px; gap: 5px; }
    .cat-subcats .filter-btn { font-size: 0.78rem; padding: 4px 12px; }
}

/* ===== Новостная карточка — разворачивание ===== */
.news-card { cursor: pointer; }
.news-card-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: all 0.3s;
}
.news-card.expanded .news-card-text {
    display: block;
    -webkit-line-clamp: unset;
}
.news-read-more {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    color: var(--pink);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: 'Raleway', sans-serif;
    transition: gap 0.2s;
}
.news-read-more:hover { gap: 8px; }
.news-read-more .arrow { transition: transform 0.3s; }
.news-card.expanded .news-read-more .arrow { transform: rotate(180deg); }

/* Полноэкранная модалка новости */
.news-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 280;
    display: flex; align-items: flex-start; justify-content: center;
    padding: 24px 16px;
    overflow-y: auto;
    opacity: 0; visibility: hidden;
    transition: all 0.3s;
}
.news-modal-overlay.open { opacity: 1; visibility: visible; }
.news-modal {
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 760px;
    padding: 40px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s;
    margin: auto;
}
.news-modal-overlay.open .news-modal { transform: translateY(0); }
.news-modal-close {
    position: absolute;
    top: 16px; right: 16px;
    background: #f5f5f5;
    border: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--muted);
    transition: background 0.2s, color 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.news-modal-close:hover { background: var(--pink-light); color: var(--pink); }
.news-modal img {
    display: block;
    width: calc(100% - 32px);
    max-height: 500px;
    object-fit: contain;
    object-position: center;
    border-radius: 14px;
    margin: 0 auto 24px;
    background: #fff;
}
.news-modal h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    margin-bottom: 10px;
    line-height: 1.3;
}
.news-modal .news-modal-date {
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 20px;
}
.news-modal .news-modal-body {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}
@media (max-width: 600px) {
    .news-modal { padding: 24px 18px; }
    .news-modal h2 { font-size: 1.4rem; }
}

/* ===== Модальное окно товара ===== */
.product-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 250;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    opacity: 0; visibility: hidden;
    transition: all 0.3s;
}
.product-modal-overlay.open { opacity: 1; visibility: visible; }
.product-modal {
    background: #fff;
    border-radius: 24px;
    width: 100%;
    max-width: 1020px;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s;
}
.product-modal-overlay.open .product-modal { transform: scale(1); }
.product-modal-close {
    position: absolute;
    top: 16px; right: 16px;
    background: #fff;
    border: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    color: var(--muted);
    transition: transform 0.15s, color 0.2s;
}
.product-modal-close:hover { transform: scale(1.1); color: var(--pink); }
.product-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.product-modal-img {
    position: relative;
    background: var(--pink-light);
    min-height: 400px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    border-radius: 24px 0 0 24px;
}
.product-modal-img img { width: 100%; height: 100%; object-fit: cover; }
.product-modal-img-main {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    position: relative;
}
/* Зум фото товара при наведении (только на устройствах с мышкой) */
@media (hover: hover) and (pointer: fine) {
    .product-modal-img-main {
        cursor: zoom-in;
        overflow: hidden;
    }
    .product-modal-img-main img {
        transition: transform 0.2s ease-out;
        transform-origin: center center;
        will-change: transform;
    }
    .product-modal-img-main.zoom-active {
        cursor: zoom-out;
    }
    .product-modal-img-main.zoom-active img {
        transform: scale(2.2);
        transition: transform 0.1s ease-out;
    }
}
.product-modal-img-nav {
    position: absolute;
    top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px;
    background: rgba(255,255,255,0.85);
    border: none; border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; color: var(--pink-dark);
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    transition: background 0.15s, transform 0.15s;
    z-index: 2;
    font-family: inherit;
    line-height: 1;
    padding-bottom: 4px;
}
.product-modal-img-nav:hover { background: #fff; transform: translateY(-50%) scale(1.08); }
.product-modal-img-nav.prev { left: 12px; }
.product-modal-img-nav.next { right: 12px; }
.product-modal-thumbs {
    position: absolute;
    bottom: 12px; left: 50%;
    transform: translateX(-50%);
    display: flex; gap: 8px;
    background: rgba(255,255,255,0.85);
    padding: 6px 10px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    max-width: 90%;
    overflow-x: auto;
    scrollbar-width: none;
    z-index: 2;
}
.product-modal-thumbs::-webkit-scrollbar { display: none; }
.product-modal-thumb {
    width: 44px; height: 44px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    flex-shrink: 0;
    transition: border-color 0.15s, transform 0.15s;
    background: #fff;
}
.product-modal-thumb:hover { transform: scale(1.05); }
.product-modal-thumb.active { border-color: var(--pink); }
.product-modal-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-modal-img-loading {
    position: absolute; top: 12px; right: 12px;
    background: rgba(255,255,255,0.85);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--pink-dark);
    z-index: 2;
}
.product-modal-badge {
    position: absolute; top: 16px; left: 16px;
    background: #4caf50; color: #fff;
    border-radius: 20px; padding: 4px 14px;
    font-size: 0.8rem; font-weight: 600;
}
.product-modal-badge.out { background: #bbb; }
.product-modal-info { padding: 32px; display: flex; flex-direction: column; }
.product-modal-info .category-tag {
    color: var(--pink);
    font-size: 0.82rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 10px;
}
.product-modal-info h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem; line-height: 1.3;
    margin-bottom: 16px;
}
.product-modal-info .sku { font-size: 0.82rem; color: var(--muted); margin-bottom: 8px; }
.product-modal-info .desc {
    color: var(--muted); font-size: 0.95rem;
    line-height: 1.6; margin-bottom: 20px; flex: 1;
}
.product-modal-info .price-big {
    font-family: 'Playfair Display', serif;
    color: var(--pink);
    font-size: 2rem; font-weight: 700;
    margin-bottom: 20px;
}
.qty-picker { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.qty-picker label { font-weight: 600; }
.qty-picker-box {
    display: flex; align-items: center;
    border: 2px solid #e0d0d8;
    border-radius: 50px;
    overflow: hidden;
}
.qty-picker-box button {
    width: 36px; height: 36px;
    background: #fefcfd;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.15s;
}
.qty-picker-box button:hover { background: var(--pink-light); color: var(--pink); }
.qty-picker-box input {
    width: 50px; text-align: center;
    border: none; font-size: 1rem; font-weight: 600;
    background: transparent;
    -moz-appearance: textfield;
}
.qty-picker-box input::-webkit-outer-spin-button,
.qty-picker-box input::-webkit-inner-spin-button { -webkit-appearance: none; }

@media (max-width: 768px) {
    .product-modal-grid { grid-template-columns: 1fr; }
    .product-modal-img { min-height: 280px; border-radius: 24px 24px 0 0; }
    .product-modal-info { padding: 20px; }
    .product-modal-info h2 { font-size: 1.3rem; }
    .product-modal-info .price-big { font-size: 1.6rem; }
}

/* ===== Поиск и сортировка в магазине ===== */
.shop-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
}
.shop-search { flex: 1; min-width: 240px; position: relative; }
.shop-search input {
    width: 100%;
    padding: 11px 44px 11px 18px;
    border: 1.5px solid #e0d0d8;
    border-radius: 50px;
    font-size: 0.95rem;
    font-family: 'Raleway', sans-serif;
    background: #fefcfd;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.shop-search input:focus {
    outline: none;
    border-color: var(--pink);
    box-shadow: 0 0 0 3px rgba(233,30,99,0.1);
}
.shop-search::after {
    content: '🔍';
    position: absolute;
    right: 16px; top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    pointer-events: none;
    opacity: 0.5;
}
.shop-sort {
    padding: 11px 18px;
    border: 1.5px solid #e0d0d8;
    border-radius: 50px;
    font-size: 0.92rem;
    font-family: 'Raleway', sans-serif;
    background: #fefcfd;
    cursor: pointer;
    min-width: 180px;
}
.shop-sort:focus { outline: none; border-color: var(--pink); }
.search-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}
.search-empty h3 { font-size: 1.3rem; margin-bottom: 8px; color: var(--text); }
@media (max-width: 640px) {
    .shop-controls { flex-direction: column; align-items: stretch; gap: 8px; margin-bottom: 14px; }
    .shop-sort { min-width: unset; }
    /* iOS Safari автозум при фокусе — лечим */
    .shop-search input,
    .shop-sort {
        font-size: 16px;
        padding: 10px 44px 10px 18px;
    }
    .shop-sort { padding: 10px 18px; }
    .shop-topic-header { margin-bottom: 1rem; padding-bottom: 0.8rem; }
    .shop-topic-title { font-size: clamp(1.3rem, 5vw, 1.8rem); }
    .shop-breadcrumbs { margin-bottom: 0.5rem; }
}
