#paw-container { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; overflow: hidden; }
.paw { z-index: 0; pointer-events: none; }
.page-wrapper { position: relative; z-index: 10; background: transparent; }

:root {
    --primary: #4f46e5; --primary-light: #818cf8; --bg-main: #f8fafc; --bg-card: #ffffff;
    --text-dark: #0f172a; --text-gray: #64748b; --border-soft: #e2e8f0;
    --shadow-soft: 0 4px 20px rgba(15, 23, 42, 0.05); --shadow-hover: 0 12px 32px rgba(15, 23, 42, 0.08);
    --radius-xl: 24px; --radius-lg: 16px; --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

body.bg-elegant { background-color: var(--bg-main); color: var(--text-dark); font-family: 'Inter', sans-serif; }

/* =========================================
   ШАПКА (HERO) И ТАБЫ
   ========================================= */
.premium-hero { position: relative; height: 320px; background-size: cover; background-position: center; border-radius: 0 0 32px 32px; overflow: hidden; margin-bottom: 20px;}
.hero-overlay-gradient { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(15,23,42,0.3) 0%, rgba(15,23,42,0.8) 100%); }
.hero-content { display: flex; flex-direction: column; justify-content: center; align-items: center; width: 100%; height: 100%; position: relative; z-index: 2; }
.btn-back-shop { position: absolute; top: 32px; left: 24px; display: inline-flex; align-items: center; gap: 8px; color: white; text-decoration: none; font-weight: 600; font-size: 15px; background: rgba(255,255,255,0.15); backdrop-filter: blur(8px); padding: 10px 20px; border-radius: 100px; border: 1px solid rgba(255,255,255,0.2); transition: var(--transition); }
.btn-back-shop:hover { background: rgba(255,255,255,0.25); transform: translateX(-4px); }
.btn-back-shop svg { width: 18px; height: 18px; }
.hero-text-block { text-align: center; }
.hero-title { font-size: 3rem; font-weight: 800; color: white; margin: 0 0 12px 0; letter-spacing: -1px; }
.hero-slogan { font-size: 1.15rem; color: rgba(255,255,255,0.9); margin: 0; }

.tabs-container { display: flex; justify-content: center; margin-top: -46px; position: relative; z-index: 10; margin-bottom: 40px; }
.glass-tabs { display: inline-flex; background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(16px); padding: 6px; border-radius: 100px; box-shadow: 0 8px 32px rgba(0,0,0,0.06); border: 1px solid rgba(255,255,255,0.8); }
.glass-tab-btn { display: flex; align-items: center; gap: 8px; background: transparent; border: none; padding: 12px 28px; font-size: 15px; font-weight: 600; color: var(--text-gray); border-radius: 100px; cursor: pointer; transition: var(--transition); }
.glass-tab-btn svg { width: 20px; height: 20px; }
.glass-tab-btn:hover { color: var(--text-dark); }
.glass-tab-btn.active { background: var(--bg-card); color: var(--primary); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

.content-pane { display: none; opacity: 0; animation: fadeUpTabs 0.4s forwards; }
.content-pane.active-pane { display: block; }
@keyframes fadeUpTabs { from { opacity: 0; padding-top: 10px; } to { opacity: 1; padding-top: 0; } }

.elegant-loader { display: flex; flex-direction: column; align-items: center; padding: 60px 20px; color: var(--text-gray); font-weight: 500; }
.spinner { width: 40px; height: 40px; border: 3px solid var(--border-soft); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }


/* =========================================
   ЛЕНТА НОВОСТЕЙ (ДВУХКОЛОНОЧНАЯ НА ПК)
   ========================================= */
.feed-wrapper { display: flex; justify-content: center; }
.feed-container { width: 100%; max-width: 1280px; display: flex; flex-direction: column; gap: 40px; }

/* Карточка на ПК */
@media (min-width: 1025px) {
    .elegant-feed-post {
        position: relative;
        padding-right: 380px; /* Выступ справа для комментов */
        min-height: 400px;
        background: var(--bg-card);
        border-radius: var(--radius-xl);
        box-shadow: var(--shadow-soft);
        border: 1px solid var(--border-soft);
    }
    .post-main-area {
        padding: 32px;
    }
    .post-comments-panel {
        position: absolute;
        top: 0; right: 0; bottom: 0;
        width: 380px;
        display: flex; flex-direction: column;
        background: var(--bg-main);
        border-left: 1px solid var(--border-soft);
        border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
    }
}

.post-layout { display: flex; gap: 40px; align-items: stretch; }
.post-left { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.post-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.post-avatar { width: 52px; height: 52px; border-radius: 16px; background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: white; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; }
.post-author { font-size: 17px; font-weight: 800; color: var(--text-dark); margin: 0 0 4px 0; }
.post-date { font-size: 13px; color: var(--text-gray); font-weight: 500;}
.post-text { font-size: 1.05rem; line-height: 1.6; color: var(--text-body); white-space: pre-wrap; margin-bottom: 20px; }
.post-right { width: 350px; flex-shrink: 0; }

/* ГАЛЕРЕЯ (С ИСПРАВЛЕННОЙ МОЗАИКОЙ ДЛЯ 5 И 6 ФОТО) */
.feed-gallery { display: grid; gap: 4px; border-radius: 16px; overflow: hidden; height: 100%; align-content: start;}
.gallery-item { position: relative; overflow: hidden; background: var(--bg-main); display: flex; }
.gallery-item img, .gallery-item video { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.zoomable-media { cursor: zoom-in; }
.gallery-item:hover .zoomable-media { transform: scale(1.03); }

.gallery-1 { grid-template-columns: 1fr; } .gallery-1 .gallery-item { max-height: 500px; aspect-ratio: 4/5; }
.gallery-2 { grid-template-columns: 1fr 1fr; } .gallery-2 .gallery-item { aspect-ratio: 4/5; }
.gallery-3 { grid-template-columns: 1fr 1fr; } .gallery-3 .gallery-item:first-child { grid-column: 1 / 3; aspect-ratio: 16/9; } .gallery-3 .gallery-item:not(:first-child) { aspect-ratio: 1/1; }
.gallery-4 { grid-template-columns: 1fr 1fr; } .gallery-4 .gallery-item { aspect-ratio: 1/1; }
.gallery-5 { grid-template-columns: repeat(6, 1fr); } .gallery-5 .gallery-item:nth-child(1), .gallery-5 .gallery-item:nth-child(2) { grid-column: span 3; aspect-ratio: 4/3; } .gallery-5 .gallery-item:nth-child(n+3) { grid-column: span 2; aspect-ratio: 1/1; }
.gallery-6 { grid-template-columns: repeat(3, 1fr); } .gallery-6 .gallery-item { aspect-ratio: 1/1; }

.shoppable-mini-btn { position: absolute; bottom: 12px; left: 12px; right: 12px; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(8px); color: var(--text-dark); font-size: 13px; font-weight: 700; padding: 10px; border-radius: 12px; text-decoration: none; text-align: left; box-shadow: 0 4px 16px rgba(0,0,0,0.15); transition: transform 0.2s, background 0.2s; display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shoppable-mini-btn:hover { transform: translateY(-2px); background: #ffffff; color: var(--primary); }

/* ВСТРОЕННЫЕ КАРТОЧКИ (ТЕКСТОВЫЕ) */
.embedded-card { display: flex; align-items: center; gap: 16px; background: var(--bg-main); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 12px; margin-bottom: 16px; text-decoration: none; transition: var(--transition); }
.embedded-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); background: var(--bg-card); border-color: #cbd5e1; }
.emb-img { width: 60px; height: 60px; object-fit: contain; border-radius: 8px; background: white; padding: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.emb-icon { width: 50px; height: 50px; border-radius: 12px; background: #eff6ff; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.emb-info { flex-grow: 1; display: flex; flex-direction: column; min-width: 0;}
.emb-title { font-size: 14px; font-weight: 700; color: var(--text-dark); margin-bottom: 4px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
.emb-price-row { display: flex; align-items: center; gap: 8px; }
.emb-price-normal { font-size: 14px; font-weight: 700; color: var(--primary); }
.emb-price-new { font-size: 14px; font-weight: 800; color: var(--danger); }
.emb-price-old { font-size: 12px; color: var(--text-gray); text-decoration: line-through; }
.emb-btn { background: var(--primary); color: white; padding: 8px 16px; border-radius: 100px; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.emb-btn-outline { border: 2px solid var(--primary); color: var(--primary); padding: 6px 14px; border-radius: 100px; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.emb-category-wrapper { margin-bottom: 16px; display: inline-flex; }
.emb-category-chip { display: inline-flex; align-items: center; gap: 12px; background: #eff6ff; padding: 8px 20px 8px 8px; border-radius: 100px; text-decoration: none; border: 1px solid #bfdbfe; transition: var(--transition); }
.emb-category-chip:hover { background: #dbeafe; transform: translateX(4px); }
.ec-icon { width: 32px; height: 32px; background: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.ec-text { font-size: 14px; color: var(--primary); }
.ec-text b { font-weight: 700; }
.ec-arrow { font-weight: 800; color: var(--primary); margin-left: 4px; }
.embedded-card-error { background: #fee2e2; color: var(--danger); padding: 12px; border-radius: 8px; font-size: 14px; text-align: center; }

/* =========================================
   ВЫСТУП С КОММЕНТАРИЯМИ
   ========================================= */
.comments-panel-header { padding: 16px 20px; border-bottom: 1px solid var(--border-soft); font-weight: 800; color: var(--text-dark); display: flex; justify-content: space-between; align-items: center; }
.close-comments-btn { display: none; background: none; border: none; font-size: 26px; line-height: 1; color: var(--text-gray); cursor: pointer; }

/* ВАЖНО: скролл внутри панели */
.comments-list-scroll { flex: 1; overflow-y: auto; padding: 20px; }
.comments-list-scroll::-webkit-scrollbar { width: 6px; }
.comments-list-scroll::-webkit-scrollbar-track { background: transparent; }
.comments-list-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
.comments-input-area { padding: 16px; background: var(--bg-card); border-top: 1px solid var(--border-soft); }

.comment-thread { margin-bottom: 16px; }
.comment-item { display: flex; gap: 12px; }
.comment-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.comment-content { flex-grow: 1; background: var(--bg-card); padding: 12px; border-radius: 12px; border-top-left-radius: 2px; box-shadow: 0 2px 6px rgba(0,0,0,0.03); border: 1px solid var(--border-soft); }
.comment-author { font-weight: 800; font-size: 13px; color: var(--text-dark); margin-right: 6px; }
.comment-date { font-size: 11px; color: var(--text-gray); }
.comment-text { font-size: 13.5px; line-height: 1.4; color: var(--text-dark); margin: 6px 0; word-break: break-word;}
.reply-btn { background: none; border: none; color: var(--text-gray); font-weight: 600; font-size: 12px; cursor: pointer; padding: 0; transition: 0.2s; }
.reply-btn:hover { color: var(--primary); text-decoration: underline; }

.comment-replies { margin-left: 24px; margin-top: 12px; display: flex; flex-direction: column; gap: 12px; border-left: 2px solid var(--border-soft); padding-left: 12px;}
.comment-replies .comment-avatar { width: 24px; height: 24px; font-size: 11px; }

.auth-prompt-mini { text-align: center; }
.auth-prompt-mini span { display: block; font-size: 13px; color: var(--text-gray); font-weight: 500; margin-bottom: 10px; }
.btn-outline-sm { width: 100%; background: transparent; border: 2px solid var(--primary); color: var(--primary); padding: 8px 16px; border-radius: 100px; font-weight: 700; font-size: 13px; cursor: pointer; transition: 0.2s; }
.btn-outline-sm:hover { background: var(--primary); color: white; }

.comment-input-wrap { display: flex; flex-direction: column; gap: 8px; }
.comment-textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--border-soft); border-radius: 12px; padding: 12px; font-family: inherit; font-size: 13px; resize: vertical; min-height: 44px; outline: none; transition: 0.2s; background: var(--bg-main); }
.comment-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1); background: white;}
.btn-send-comment { background: var(--primary); color: white; border: none; border-radius: 12px; padding: 10px; font-weight: 700; cursor: pointer; transition: 0.2s; font-size: 13px; }
.btn-send-comment:hover { background: var(--primary-light); }
.error-toast { color: var(--danger); font-size: 12px; font-weight: 600; margin-bottom: 8px; display: none; }
.mobile-open-comments-btn { display: none; }


/* =========================================
   СТАТЬИ БЛОГА (Плитки) - без изменений
   ========================================= */
.section-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.section-title { font-size: 28px; font-weight: 800; margin: 0; }
.elegant-badge { background: white; color: var(--primary); padding: 4px 12px; border-radius: 100px; font-size: 13px; font-weight: 700; box-shadow: var(--shadow-soft); }
.articles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.elegant-article-card { background: var(--bg-card); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-soft); transition: var(--transition); border: 1px solid var(--border-soft); display: flex; flex-direction: column; text-decoration: none; cursor: pointer; }
.elegant-article-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); border-color: #cbd5e1; }
.card-cover { width: 100%; height: 220px; position: relative; overflow: hidden; background: var(--border-soft); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s; }
.elegant-article-card:hover .card-cover img { transform: scale(1.05); }
.card-badge-floating { position: absolute; top: 16px; left: 16px; background: rgba(255,255,255,0.95); padding: 6px 12px; border-radius: 100px; font-size: 12px; font-weight: 700; color: var(--primary); }
.card-body { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.card-title { font-size: 18px; font-weight: 800; color: var(--text-dark); margin: 0 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4;}
.card-desc { font-size: 14px; color: var(--text-gray); margin: 0 0 20px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex-grow: 1; line-height: 1.6;}
.card-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border-soft); padding-top: 16px; }
.card-read-more { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--primary); transition: var(--transition);}
.card-read-more svg { width: 16px; height: 16px; transition: transform 0.3s; }
.elegant-article-card:hover .card-read-more svg { transform: translateX(4px); }
.card-date { font-size: 12px; font-weight: 500; color: #94a3b8; }

/* ЛАЙТБОКС */
.media-lightbox { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(12px); z-index: 9999; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.media-lightbox.active { opacity: 1; pointer-events: auto; }
.lightbox-close { position: absolute; top: 24px; right: 32px; background: rgba(255,255,255,0.1); border: none; color: white; font-size: 36px; width: 50px; height: 50px; border-radius: 50%; cursor: pointer; z-index: 10000; }
.lightbox-content img { max-width: 90vw; max-height: 90vh; border-radius: 12px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); object-fit: contain; animation: zoomIn 0.3s forwards; }
@keyframes zoomIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }


/* =========================================
   АДАПТИВНОСТЬ (Для планшетов и телефонов)
   ========================================= */
.comments-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(2px); z-index: 999; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.comments-overlay.active { opacity: 1; pointer-events: auto; }

@media (max-width: 1024px) {
    /* Сбрасываем относительное позиционирование и отключаем обрезку */
    .elegant-feed-post {
        display: block;
        background: var(--bg-card); border-radius: var(--radius-xl);
        box-shadow: var(--shadow-soft); border: 1px solid var(--border-soft);
        overflow: visible !important; /* КРИТИЧЕСКОЕ ИСПРАВЛЕНИЕ: чтобы шторка не обрезалась! */
    }
    .post-main-area { padding: 24px; }

    .mobile-open-comments-btn {
        display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 12px; margin-top: 24px; border-radius: 12px; background: var(--bg-main); border: 1px dashed var(--border-soft); color: var(--text-gray); font-weight: 700; cursor: pointer; transition: 0.2s;
    }
    .mobile-open-comments-btn:hover { color: var(--primary); border-color: var(--primary); background: #eff6ff; }

    /* Шторка снизу */
    .post-comments-panel {
        position: fixed; bottom: -100%; left: 0; width: 100%; height: 80vh; max-height: none;
        background: var(--bg-card); z-index: 1000; border-radius: 24px 24px 0 0;
        border-left: none; transition: bottom 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 0 -10px 40px rgba(0,0,0,0.15);
        display: flex; flex-direction: column;
    }
    .post-comments-panel.open { bottom: 0; }
    .close-comments-btn { display: block; }
    .comments-input-area { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
}

@media (max-width: 768px) {
    .post-layout { flex-direction: column; gap: 20px; }
    .post-right { width: 100%; }
    .gallery-1 .gallery-item { aspect-ratio: 1/1; max-height: none; }
}

@media (max-width: 600px) {
    .premium-hero { height: 280px; border-radius: 0 0 24px 24px; }
    .btn-back-shop { top: 16px; left: 16px; font-size: 13px; padding: 8px 16px; }
    .hero-title { font-size: 2rem; }
    .glass-tabs { width: 100%; flex-direction: column; border-radius: 20px; padding: 8px; gap: 4px;}
    .glass-tab-btn { width: 100%; justify-content: center; padding: 10px; }
    .tabs-container { margin: -50px 16px 24px; }

    .post-main-area { padding: 16px; }
    .articles-grid { grid-template-columns: 1fr; }
    .emb-product-card { flex-direction: column; align-items: stretch; text-align: center; }
    .ep-img { margin: 0 auto; width: 80px; height: 80px; }
    .emb-category-chip { width: 100%; justify-content: space-between; }
}