/* Tailwind Preflight (Subset) */
*, ::before, ::after { box-sizing: border-box; border-width: 0; border-style: solid; border-color: currentColor; }
html { line-height: 1.5; -webkit-text-size-adjust: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { margin: 0; line-height: inherit; }
img { display: block; max-width: 100%; height: auto; }
button, input { font-family: inherit; font-size: 100%; margin: 0; padding: 0; background: transparent; border: none; }
button { cursor: pointer; text-transform: none; }
h2, h3, h4, p { margin: 0; }
input { outline: none; }

/* Variables & Base Custom CSS */
:root {
    --tg-bg: var(--tg-theme-bg-color, #1c1c1e);
    --tg-text: var(--tg-theme-text-color, #ffffff);
    --tg-secondary: var(--tg-theme-secondary-bg-color, #2c2c2e);
    --tg-hint: var(--tg-theme-hint-color, #8e8e93);
    --tg-button: var(--tg-theme-button-color, #007aff);
    --tg-button-text: var(--tg-theme-button-text-color, #ffffff);
    
    --glass-bg: rgba(28, 28, 30, 0.65);
    --glass-border: rgba(255, 255, 255, 0.12);
    --shadow-floating: 0 8px 24px rgba(0, 0, 0, 0.20);
    --card-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.01) 100%);
}

.light {
    --tg-bg: var(--tg-theme-bg-color, #f4f4f5);
    --tg-text: var(--tg-theme-text-color, #1c1c1e);
    --tg-secondary: var(--tg-theme-secondary-bg-color, #e4e4e7);
    --tg-hint: var(--tg-theme-hint-color, #71717a);
    --tg-button: var(--tg-theme-button-color, #007aff);
    --tg-button-text: var(--tg-theme-button-text-color, #ffffff);

    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.08);
    --card-bg: linear-gradient(145deg, rgba(255, 255, 255, 1) 0%, rgba(240, 240, 245, 0.5) 100%);
}

body { 
    background-color: var(--tg-bg);
    color: var(--tg-text);
    padding-top: 112px; 
    padding-bottom: 90px;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.bg-gradients { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

.dark .bg-gradients {
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(124, 58, 237, 0.35) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(59, 130, 246, 0.35) 0%, transparent 50%);
}

.light .bg-gradients {
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(124, 58, 237, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(59, 130, 246, 0.08) 0%, transparent 40%);
}

.no-scrollbar::-webkit-scrollbar { display: none; }

.floating-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 50;
    padding: 8px 12px; background: transparent; pointer-events: none;
}
.floating-header > * { pointer-events: auto; }

.search-input {
    width: 100%; background: var(--glass-bg); backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px); color: var(--tg-text);
    padding: 11px 12px 11px 42px; border-radius: 999px;
    border: 1px solid var(--glass-border); box-shadow: var(--shadow-floating);
    outline: none; transition: all 0.3s ease;
}

.support-btn {
    width: 46px; height: 46px; flex-shrink: 0;
    background: var(--glass-bg); backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px); border: 1px solid var(--glass-border);
    border-radius: 50%; color: var(--tg-text);
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-floating); transition: all 0.3s ease;
}
.support-btn:active { transform: scale(0.9); }

/* =========================================
   ДОДАТКОВІ СТИЛІ: Кнопка Telegram Bot 
========================================= */

/* За замовчуванням (мобільні пристрої) - приховано */
.bot-btn-desktop {
    display: none !important;
}

/* Десктопні екрани - показуємо з фірмовим стилем */
@media (min-width: 768px) {
    .bot-btn-desktop {
        display: flex !important;
        background-color: #24A1DE !important;
        color: #ffffff !important;
        border-color: transparent !important;
        box-shadow: 0 4px 15px rgba(36, 161, 222, 0.35) !important;
    }
}

.filter-btn {
    transition: all 0.3s ease; background: var(--glass-bg); 
    backdrop-filter: blur(12px); border: 1px solid var(--glass-border);
    border-radius: 999px; color: var(--tg-text);
}
.filter-btn.active { background: var(--tg-button); border-color: transparent; color: var(--tg-button-text); }

.book-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border); border-radius: 16px;
    overflow: hidden; display: flex; flex-direction: column;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.cart-fab {
    position: fixed; bottom: 20px; right: 20px;
    width: 60px; height: 60px; border-radius: 30px;
    background: var(--tg-button); color: var(--tg-button-text);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    z-index: 100;
}
.cart-count {
    position: absolute; top: -2px; right: -2px;
    background: #ef4444; color: white; font-size: 11px;
    min-width: 20px; height: 20px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--tg-bg); font-weight: bold;
}

.modal-content {
    background: var(--tg-bg); border-top: 1px solid var(--glass-border);
    border-radius: 24px 24px 0 0; width: 100%; max-height: 90vh;
    padding: 24px 20px;
}

.book-modal-overlay {
    position: fixed; inset: 0; z-index: 300;
    background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px); display: none;
    align-items: center; justify-content: center;
    padding: 16px; overscroll-behavior: contain;
}

.book-modal-container {
    background: var(--glass-bg); backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px); border: 1px solid var(--glass-border);
    border-radius: 24px; box-shadow: var(--shadow-floating);
    width: 100%; max-width: 500px; max-height: 85vh;
    overflow-y: auto; padding: 18px; color: var(--tg-text);
    position: relative; overscroll-behavior: contain;
}
.book-modal-close {
    position: absolute; top: 16px; right: 16px !important; left: auto !important; width: 36px; height: 36px;
    background: var(--glass-bg); border: 1px solid var(--glass-border);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: var(--tg-text); font-size: 20px; cursor: pointer;
    transition: all 0.2s ease; z-index: 10;
}
.book-modal-close:active { transform: scale(0.9); }

.carousel-main {
    width: 100%; aspect-ratio: 3/4; border-radius: 16px;
    overflow: hidden; background: var(--tg-secondary); margin-bottom: 16px;
}
.carousel-main img { width: 100%; height: 100%; object-fit: cover; }
.thumbnail-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.thumbnail {
    flex: 0 0 60px; aspect-ratio: 3/4; border-radius: 8px; overflow: hidden;
    border: 2px solid transparent; transition: all 0.2s ease; cursor: pointer;
}
.thumbnail.active { border-color: var(--tg-button); }
.thumbnail img { width: 100%; height: 100%; object-fit: cover; }

/* Додані базові класи для макета модалки (Mobile First) */
.modal-layout { display: flex; flex-direction: column; gap: 20px; }
.modal-image-col { width: 100%; }
.modal-info-col { width: 100%; display: flex; flex-direction: column; }

/* === ГАРМОНІЙНА ТИПОГРАФІКА ТА ВІДСТУПИ В МОДАЛЦІ === */
.modal-info-col > * { 
    flex-shrink: 0; /* ЗАПОБІГАЄ НАКЛАДАННЮ ТЕКСТУ при зміні розміру модалки */
}

/* Скидаємо вбудовані margin-top з HTML (mt-2, my-4 тощо), щоб керувати ними чітко */
.modal-info-col h2, 
.modal-info-col #bookAuthor, 
.modal-info-col .flex-wrap, 
.modal-info-col #bookPriceContainer,
.modal-info-col .accordion-header,
.modal-info-col #bookDescription,
#modalActionButtonContainer {
    margin-top: 0 !important;
}

/* Точкові мікро-пропорції між блоками (Mobile First) - ЗМЕНШЕНО ВІДСТУПИ */
.modal-info-col h2 { margin-bottom: 2px !important; line-height: 1.25 !important; } 
.modal-info-col #bookAuthor { margin-bottom: 8px !important; } 
.modal-info-col .flex-wrap { margin-bottom: 12px !important; } /* Контейнер категорій */
.modal-info-col #bookPriceContainer { margin-bottom: 16px !important; } 

.accordion-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0; border-bottom: 1px solid var(--glass-border);
    cursor: pointer; margin-bottom: 0 !important;
}
.accordion-content {
    max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out, padding 0.3s ease;
    padding: 0; opacity: 0.8;
    font-size: 13px; line-height: 1.6; color: var(--tg-hint);
    text-align: justify; hyphens: auto; text-align-last: left;
    margin-bottom: 0 !important;
}
.light .accordion-content { color: color-mix(in srgb, var(--tg-hint), black 35%); }
.dark .accordion-content { color: var(--tg-hint); }
.accordion-content.expanded { max-height: 500px; padding: 12px 0; overflow-y: auto; }

#modalActionButtonContainer { margin-top: 20px !important; margin-bottom: 0 !important; }

.phone-input {
    width: 100%; background: var(--tg-secondary); color: var(--tg-text);
    padding: 12px 16px; border-radius: 12px;
    border: 1px solid var(--glass-border); outline: none; margin-top: 8px;
}
#userPhone::placeholder { font-size: 11px; opacity: 0.7; }

.skeleton {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(to right, var(--tg-secondary) 4%, var(--tg-bg) 25%, var(--tg-secondary) 36%);
    background-size: 1000px 100%;
}
@keyframes shimmer { 0% { background-position: -1000px 0; } 100% { background-position: 1000px 0; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade-in { animation: fadeIn 0.4s ease-out forwards; opacity: 0; }

/* ========== ДЕСКТОПНІ ПОКРАЩЕННЯ ========== */
@media (min-width: 768px) {
    body { padding-top: 0 !important; }
    .floating-header {
        position: relative; padding: 16px 24px;
        backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--glass-border); margin-bottom: 20px;
        pointer-events: auto; 
    }
    .floating-header > * { pointer-events: auto; }
    #catalog { grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
    .search-input { padding: 12px 12px 12px 48px; font-size: 1rem; }
    .support-btn { width: 52px; height: 52px; }
    .support-btn i { font-size: 1.5rem; }
    .filter-btn { padding: 0.5rem 1.25rem; font-size: 0.9375rem; }
    .book-card h3 { font-size: 0.9375rem; }
    .book-card p { font-size: 0.75rem; }
    .book-card button { font-size: 0.8125rem; }
    .cart-fab { bottom: 30px; right: 30px; width: 70px; height: 70px; }
    .cart-fab i { font-size: 1.75rem; }
    .cart-count { font-size: 0.875rem; min-width: 24px; height: 24px; }
    .modal-content { max-width: 500px; border-radius: 24px; margin-bottom: 20px; }
    #cartModal { align-items: center; justify-content: center; }
    
    /* === ОНОВЛЕНИЙ ДЕСКТОПНИЙ ДИЗАЙН МОДАЛКИ (Дві колонки) === */
    .book-modal-container { max-width: 880px; padding: 36px; overflow-y: auto; }
    .modal-layout { flex-direction: row; gap: 3rem; align-items: stretch; } /* Змінено на stretch для центровки */
    .modal-image-col { width: 42%; flex-shrink: 0; position: sticky; top: 0; }
    .modal-info-col { width: 58%; display: flex; flex-direction: column; justify-content: center; } /* Вертикальне центрування тексту */
    
    .carousel-main { aspect-ratio: 3/4; border-radius: 12px; margin-bottom: 16px; }
    
    /* Типографіка десктопу (Зменшені та збалансовані відступи) */
    .modal-info-col h2 { font-size: 1.875rem; margin-bottom: 4px !important; line-height: 1.2 !important; }
    .modal-info-col #bookAuthor { font-size: 1rem; margin-bottom: 12px !important; }
    .modal-info-col .flex-wrap { margin-bottom: 16px !important; }
    .modal-info-col #bookPriceContainer { font-size: 2rem; margin-bottom: 20px !important; }
    
    /* Відключаємо акордеон на десктопі ТІЛЬКИ ДЛЯ ОПИСУ КНИГИ */
    .modal-info-col .accordion-header { cursor: default; border-bottom: none; padding: 0 !important; pointer-events: none; margin-bottom: 8px !important; }
    .modal-info-col .accordion-header i { display: none !important; }
    .modal-info-col .accordion-content { max-height: none !important; padding: 0 !important; overflow: visible; display: block; font-size: 0.95rem; margin-bottom: 20px !important; }
    
    /* Відпускаємо кнопку, щоб блок виглядав цілісно по центру */
    #modalActionButtonContainer { margin-top: 12px !important; margin-bottom: 0 !important; padding-top: 24px !important; border-top: 1px solid var(--glass-border) !important; }
    /* ======================================================= */
    
    .thumbnail { flex: 0 0 80px; }
    .floating-header .flex.items-center { margin-bottom: 1.5rem; }
}

@media (min-width: 1024px) {
    #catalog { grid-template-columns: repeat(5, 1fr); gap: 1.5rem; }
    .floating-header { padding: 20px 32px; }
    
    /* Розширення модалки для великих екранів */
    .book-modal-container { max-width: 1000px; padding: 48px; }
    .modal-layout { gap: 4rem; }
    .modal-image-col { width: 40%; }
    .modal-info-col { width: 60%; }
    .modal-info-col h2 { font-size: 2.25rem; }
    
    .carousel-main { aspect-ratio: 3/4; }
    .thumbnail { flex: 0 0 90px; }
    .search-input { font-size: 1.1rem; }
}

@media (min-width: 1440px) {
    /* Каталог також обмежуємо по ширині і центруємо, щоб він збігався з хедером */
    #catalog { 
        grid-template-columns: repeat(6, 1fr); 
        max-width: 1400px; 
        margin: 0 auto; 
    }
    
    /* Застосовуємо ліміт ширини до ВСІХ 3-х блоків у хедері (банер, пошук, фільтри) */
    .floating-header > div { 
        max-width: 1400px; 
        margin-left: auto; 
        margin-right: auto; 
    }
}

/* =========================================
   INVITE MODAL
========================================= */

            .invite-modal-content {
                background: var(--glass-bg); backdrop-filter: blur(30px);
                -webkit-backdrop-filter: blur(30px); border: 1px solid var(--glass-border);
                border-radius: 28px; box-shadow: var(--shadow-floating);
                width: 100%; max-width: 380px; padding: 32px 24px;
                color: var(--tg-text); position: relative;
            }
            .invite-close-btn {
                position: absolute;
                top: 16px;
                right: 16px !important; /* Фіксуємо справа */
                left: auto !important;                
                width: 40px;
                height: 40px;
                border-radius: 50%;
                background-color: rgba(0, 0, 0, 0.05);
                color: var(--tg-text);
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 24px;
                transition: background-color 0.2s ease;
                line-height: 1;
                z-index: 10;
            }
            .dark .invite-close-btn { background-color: rgba(255, 255, 255, 0.1); }
            .invite-close-btn:hover { background-color: rgba(0, 0, 0, 0.1); }
            .dark .invite-close-btn:hover { background-color: rgba(255, 255, 255, 0.2); }
            
            .invite-tg-icon {
                font-size: 64px !important;
                color: #1c1c1e;
                margin-bottom: 20px;
                filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
            }
            .dark .invite-tg-icon { color: #ffffff; }

            /* СТА Кнопка "Перейти в Магазин" */
            .btn-tg-cta {
                width: 100%;
                background-color: #24A1DE;
                color: #ffffff;
                font-weight: 700;
                font-size: 16px;
                padding: 16px;
                border-radius: 12px;
                display: flex;
                align-items: center;
                justify-content: center;
                gap: 8px;
                margin: 16px;
                box-shadow: 0 6px 20px rgba(36, 161, 222, 0.4);
                transition: all 0.2s ease;
                border: none;
                cursor: pointer;
            }
            .btn-tg-cta:hover {
                background-color: #1E88BE;
                transform: translateY(-2px);
                box-shadow: 0 8px 25px rgba(36, 161, 222, 0.5);
            }
            .btn-tg-cta:active {
                transform: scale(0.96) translateY(0);
            }

/* =========================================
   ДЕСКТОПНИЙ БАНЕР (Header)
========================================= */

/* За замовчуванням (мобільні пристрої) - повністю приховано */
.desktop-banner {
    display: none;
}

/* Десктопні екрани */
@media (min-width: 768px) {
    .desktop-banner {
        display: flex;
        align-items: center;
        gap: 18px;
        margin-bottom: 22px; /* Відступ від пошуку */
        width: 100%;
        animation: fadeIn 0.6s ease-out;
    }

    .desktop-banner-logo {
        height: 56px;
        width: 56px;
        object-fit: contain;
    }

    .desktop-banner-content {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .desktop-banner-title {
        font-size: 1.85rem;
        font-weight: 900;
        letter-spacing: -0.03em;
        color: var(--tg-text);
        line-height: 1.1;
        margin: 0 0 4px 0 !important;
    }

    .desktop-banner-subtitle {
        font-size: 0.95rem;
        font-weight: 500;
        color: var(--tg-hint);
        margin: 0 !important;
        letter-spacing: 0.01em;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    /* Акцентна крапка перед підзаголовком для стилю */
    .desktop-banner-subtitle::before {
        content: '';
        display: inline-block;
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background-color: #24A1DE; /* Фірмовий колір Telegram для гармонії з кнопкою */
        box-shadow: 0 0 8px rgba(36, 161, 222, 0.6);
    }
}


/* ========================================================= */
/* EXTRACTED STATIC TAILWIND UTILITIES TO REMOVE JS COMPILER */
/* ========================================================= */

.absolute { position: absolute; }
.relative { position: relative; }
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-2 { top: 0.5rem; }
.top-5 { top: 1.25rem; }
.top-1\/2 { top: 50%; }
.right-2 { right: 0.5rem; }
.left-4 { left: 1rem; }
.left-1\/2 { left: 50%; }
.z-\[1000\] { z-index: 1000; }
.z-\[200\] { z-index: 200; }
.flex { display: flex; }
.inline-block { display: inline-block; }
.hidden { display: none !important; }
.grid { display: grid; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-baseline { align-items: baseline; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-grow { flex-grow: 1; }
.shrink-0 { flex-shrink: 0; }
.flex-\[7\.5\] { flex: 7.5; }
.flex-\[2\.5\] { flex: 2.5; }
.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.col-span-2 { grid-column: span 2 / span 2; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.w-full { width: 100%; }
.w-10 { width: 2.5rem; }
.w-16 { width: 4rem; }
.w-24 { width: 6rem; }
.max-w-xs { max-width: 20rem; }
.min-w-0 { min-width: 0px; }
.h-full { height: 100%; }
.h-8 { height: 2rem; }
.h-14 { height: 3.5rem; }
.max-h-\[40vh\] { max-height: 40vh; }
.aspect-\[2\/3\] { aspect-ratio: 2 / 3; }
.aspect-\[3\/4\] { aspect-ratio: 3 / 4; }
.p-2 { padding: 0.5rem; }
.p-2\.5 { padding: 10px !important; }
.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 10px !important; padding-bottom: 10px !important; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pt-4 { padding-top: 1rem; }
.mb-0\.5 { margin-bottom: 0.125rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-auto { margin-top: auto; }
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.my-3 { margin-top: 0.75rem; margin-bottom: 0.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-\[9px\] { font-size: 9px; }
.text-\[10px\] { font-size: 10px; }
.text-\[11px\] { font-size: 11px; }
.text-\[13px\] { font-size: 13px; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.text-center { text-align: center; }
.leading-tight { line-height: 1.25; }
.whitespace-nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp-1 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.text-white { color: #fff; }
.text-current { color: currentColor; }
.text-\[var\(--tg-hint\)\] { color: var(--tg-hint); }
.text-\[var\(--tg-button\)\] { color: var(--tg-button); }
.text-\[var\(--tg-button-text\)\] { color: var(--tg-button-text); }
.text-rose-500 { color: #f43f5e; }
.dark .dark\:text-rose-400 { color: #fb7185; }
.bg-gray-800 { background-color: #1f2937; }
.bg-black\/60 { background-color: rgba(0,0,0,0.6); }
.bg-black\/20 { background-color: rgba(0,0,0,0.2); }
.bg-black\/5 { background-color: rgba(0,0,0,0.05); }
.bg-emerald-500\/90 { background-color: rgba(16,185,129,0.9); }
.bg-orange-500\/90 { background-color: rgba(249,115,22,0.9); }
.bg-rose-500\/90 { background-color: rgba(244,63,94,0.9); }
.bg-blue-500\/90 { background-color: rgba(59,130,246,0.9); }
.bg-gray-500\/80 { background-color: rgba(107,114,128,0.8); }
.bg-purple-500\/80 { background-color: rgba(168,85,247,0.8); }
.bg-\[var\(--tg-button\)\] { background-color: var(--tg-button); }
.dark .dark\:bg-white\/10 { background-color: rgba(255,255,255,0.1); }
.dark .dark\:bg-white\/5 { background-color: rgba(255,255,255,0.05); }
.border { border-width: 1px; }
.border-t { border-top-width: 1px; }
.border-white\/10 { border-color: rgba(255,255,255,0.1); }
.border-black\/10 { border-color: rgba(0,0,0,0.1); }
.border-black\/5 { border-color: rgba(0,0,0,0.05); }
.dark .dark\:border-white\/10 { border-color: rgba(255,255,255,0.1); }
.dark .dark\:border-white\/5 { border-color: rgba(255,255,255,0.05); }
.border-rose-500\/60 { border-color: rgba(244,63,94,0.6); }
.border-orange-500\/60 { border-color: rgba(249,115,22,0.6); }
.border-emerald-500\/60 { border-color: rgba(16,185,129,0.6); }
.border-sky-400\/60 { border-color: rgba(56,189,248,0.6); }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-md { border-radius: 0.375rem; }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); }
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0,0,0,0.05); }
.opacity-50 { opacity: 0.5; }
.opacity-40 { opacity: 0.4; }
.opacity-80 { opacity: 0.8; }
.backdrop-blur-sm { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.backdrop-blur-md { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.line-through { text-decoration-line: line-through; }
.hover\:underline:hover { text-decoration-line: underline; }
.transition-transform { transition-property: transform; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-300 { transition-duration: 300ms; }
.duration-500 { transition-duration: 500ms; }
.-translate-y-1\/2 { transform: translateY(-50%); }
.-translate-x-1\/2 { transform: translateX(-50%); }
.active\:scale-95:active { transform: scale(.95); }
.active\:scale-90:active { transform: scale(.9); }
.group:active .group-active\:scale-95 { transform: scale(.95); }
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.cursor-pointer { cursor: pointer; }
.object-cover { object-fit: cover; }
.space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.75rem; margin-bottom: 0; }

@media (min-width: 768px) { .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .xl\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* FORCE Subtle horizontal scrollbar for filter sections and thumbnails (Desktop only) */
@media (min-width: 768px) {
    /* Збільшуємо відступ, щоб скролбар не перекривав фотографії */
    .thumbnail-strip { padding-bottom: 12px; }

    /* For Firefox */
    .overflow-x-auto, .thumbnail-strip {
        scrollbar-width: thin !important; 
        scrollbar-color: var(--tg-hint, #8e8e93) transparent !important;
    }
    
    /* For WebKit (Chrome, Safari, Edge) - Increased specificity and forced display */
    div.overflow-x-auto::-webkit-scrollbar,
    .thumbnail-strip::-webkit-scrollbar {
        height: 6px !important; 
        display: block !important; 
        -webkit-appearance: none !important;
    }
    
    div.overflow-x-auto::-webkit-scrollbar-track,
    .thumbnail-strip::-webkit-scrollbar-track {
        background: transparent !important;
    }
    
    div.overflow-x-auto::-webkit-scrollbar-thumb,
    .thumbnail-strip::-webkit-scrollbar-thumb {
        background-color: var(--tg-hint, #8e8e93) !important;
        border-radius: 10px !important;
    }
    
    div.overflow-x-auto::-webkit-scrollbar-thumb:hover,
    .thumbnail-strip::-webkit-scrollbar-thumb:hover {
        background-color: var(--tg-button, #007aff) !important;
    }
}