@font-face {
    font-family: 'Roboto';
    src: url('/fonts/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3yUBHMdazQ.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Roboto';
    src: url('/fonts/KFO7CnqEu92Fr1ME7kSn66aGLdTylUAMa3iUBHMdazTgWw.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f0f0f0;
}

/* body.modal-open — більше не використовується (модалку видалено) */

.container {
    display: flex;
    min-height: 100vh;
    min-width: 320px; /* Додаємо мінімальну ширину для уникнення CLS */
    overflow-anchor: none;
    box-sizing: border-box;
    overflow: hidden;
    transition: none !important; /* Вимикаємо анімації для min-height/height/padding */
}

.filters {
    width: 250px;
    min-width: 170px;
    background-color: white;
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    overflow-y: auto;
    max-height: 100vh;
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
    border-right: 1px solid rgba(0,0,0,0.1);
}

.filters h2 {
    font-size: 1.2em;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

main {
    flex-grow: 1;
    padding: 20px;
    min-height: 0;
    min-block-size: 0;
    box-sizing: border-box;
    transition: none !important;
}

h1, h2 {
    color: #333;
    margin-bottom: 20px;
}

.filter-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0 !important;
    min-width: 0;
    box-sizing: border-box;
    overflow-anchor: none;
}

.filter-btn {
    padding: 10px 15px;
    border: none;
    background-color: #f8f9fa;
    cursor: pointer;
    border-radius: 4px;
    text-align: left;
    transition: all 0.3s ease;
    font-size: 14px;
    border-radius: 8px;
    font-weight: 500;
    background: linear-gradient(to right, #f8f9fa, #ffffff);
}

.filter-btn:hover {
    background: linear-gradient(to right, #e9ecef, #f8f9fa);
    transform: translateX(5px);
}

.filter-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.filter-btn.active {
    background: linear-gradient(to right, #0056b3, #007bff);
    box-shadow: 0 2px 4px rgba(0,123,255,0.3);
}

/* Update the products grid container */
#products {
    max-width: 1200px;
    margin: 0; /* Ліве вирівнювання, щоб уникнути зсувів між брейкпоінтами */
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px 20px; /* Збільшено вертикальний відступ між картками */
    padding: 40px;
    min-height: 0;
    min-block-size: 0;
    box-sizing: border-box; /* Додаємо для уникнення CLS */
    transition: none !important;
    align-items: stretch; /* Всі картки однієї висоти */
}

#products:empty::before {
    content: '';
    display: block;
    min-height: 120px; /* резервуємо місце під товари, якщо їх немає */
}

/* Оновлені стилі для карток товарів */
.product {
    border: none;
    padding: 15px;
    background-color: white;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%; /* Додаємо: картка займає всю висоту гріда */
    /* Додаємо однакову мінімальну висоту для всіх карток */
    min-height: 300px; /* або інше значення, залежно від контенту */
}

.product:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

.product-image {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    background: #f0f0f0;
}

.product-info {
    flex: 1 1 auto; /* Дозволяємо займати лише потрібний простір */
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Змінено з space-between */
    gap: 0;
    min-height: 0;
}

.product-price {
    margin-top: 5px;
    color: #007bff;
    font-weight: bold;
}

.filter-toggle {
    display: none;
    padding: 12px 20px;
    background: linear-gradient(to right, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    position: fixed;
    top: 80px; /* Нове положення зверху */
    right: 20px;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.25);
    background: linear-gradient(to right, #0056b3, #004494);
}

.filter-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    margin: 0;
    transition: transform 0.3s ease;
}

.filter-toggle.active .filter-icon {
    transform: rotate(180deg);
}

.sub-filters {
    display: none;
    padding-left: 15px;
    margin-top: 10px;
    min-height: 0 !important; /* Ще менше зайвого простору */
    min-width: 0;
    overflow-anchor: none;
    overflow: hidden;
    overflow-y: hidden;
    box-sizing: border-box;
    transition: none !important;
    visibility: hidden;
    will-change: min-height, opacity;
    contain: layout style;
    isolation: isolate;
}

.filter-group > .filter-btn.active + .sub-filters {
    display: block;
    visibility: visible;
}

.sub-filter-group {
    margin-bottom: 15px;
    min-height: 0 !important; /* Ще менше зайвого простору */
    min-width: 0;
    overflow-anchor: none;
    box-sizing: border-box;
    transition: none !important;
    will-change: min-height, opacity;
}

.sub-filter-group h3 {
    font-size: 14px;
    margin: 10px 0 5px;
    color: #666;
}

.sub-filter-group label {
    display: block;
    padding: 5px 0;
    font-size: 13px;
    color: #333;
    cursor: pointer;
}

.sub-filter-group input[type="checkbox"] {
    margin-right: 8px;
}

.sub-filter-group input[type="checkbox"]:checked + span {
    color: #007bff;
    font-weight: bold;
}

/* Update the product images and carousel styles */
.product-images {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 10px auto;
    overflow: hidden;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* Для звичайної картки (НЕ карусель) */
.product .product-image {
    position: static;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    box-sizing: border-box;
    opacity: 1;
    transition: none;
}

/* Для каруселі (залишаємо абсолютне позиціонування) */
.carousel .product-image {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-image.active {
    opacity: 1;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 2;
}

.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.carousel-btn.prev {
    left: 0;
}

.carousel-btn.next {
    right: 0;
}

.carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 2;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.dot.active {
    background: white;
}

/* Медіа-запити для адаптивності */
@media (max-width: 1200px) {
    main, #products {
        min-height: 1px !important;
        min-block-size: 1px !important;
    }
    #products {
        grid-template-columns: repeat(3, 1fr);
        padding: 30px;
        gap: 25px;
    margin-left: 0; /* фіксуємо вирівнювання */
    margin-right: 0;
    }
}

@media (max-width: 900px) {
    main, #products {
        min-height: 1px !important;
        min-block-size: 1px !important;
    }
    #products {
        grid-template-columns: repeat(2, 1fr);
        padding: 25px;
        gap: 20px;
    margin-left: 0; /* уникаємо центрування між 901→768px */
    margin-right: 0;
    }
    .product-images {
        width: 150px;
        height: 150px;
    }
    .product .product-image,
    .carousel .product-image {
        width: 100%;
        height: 100%;
    }
    .product {
        min-height: 300px; /* менша висота для планшетів */
        height: auto; /* Додаємо, щоб картки не розтягувались */
    }
}

@media (max-width: 600px) {
    #products {
        grid-template-columns: repeat(2, 1fr);
        padding: 15px;
        gap: 15px;
    }
    .product-images {
        width: 120px;
        height: 120px;
    }
    .product .product-image,
    .carousel .product-image {
        width: 100%;
        height: 100%;
    }
    .product {
        min-height: 250px; /* ще менша висота для мобільних */
    }
}

/* Спеціальний медіа-запит для діапазону 468-768px з розмірами 200x200 */
@media (min-width: 468px) and (max-width: 768px) {
    .product {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }
    .product-images {
        width: 200px !important;
        height: 200px !important;
        margin: 0 auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    .product .product-image,
    .carousel .product-image {
        width: 200px !important;
        height: 200px !important;
        margin: 0 auto !important;
        display: block !important;
    }
    .product-info {
        width: 100% !important;
        text-align: center !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
}


@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .filters {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        width: 80%;
        max-width: 250px;
        background: white;
        z-index: 1001;
        transition: all 0.3s ease;
        height: 100vh;
        box-shadow: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 100px;
    }

    .filters.active {
        left: 0;
        box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    }

    .filter-toggle {
        display: block;
        right: 10px; /* Зменшено відступ справа */
    }

    main {
        margin-left: 0;
        padding: 3px; /* Зменшено зовнішній відступ */
        box-sizing: border-box;
        width: 100%;
    }

    #products {
        grid-template-columns: repeat(2, 1fr);
        max-width: 100%;
        margin: 3px auto; /* Зменшено зовнішній відступ */
        padding: 0 3px; /* Зменшено бокові відступи */
        gap: 7px; /* Відступ між картками залишаємо */
    }
    
    .product {
        margin: 10px 0;
        flex-direction: column;
        text-align: center;
        align-items: center;
        width: 100%;
        border-radius: 12px;
    }

    .product-image {
        width: 150px;
        height: 150px;
        margin-bottom: 10px;
    }

    .sub-filters {
        padding-left: 10px;
    }
    
    .sub-filter-group label {
        padding: 8px 0;
    }

    .product-images {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
        display: flex;
        justify-content: center;
        align-items: center;
        border-radius: 8px; /* Додано закруглення для фото */
        overflow: hidden; /* Забезпечуємо, щоб фото не виходило за межі закруглення */
    }

    .carousel {
        width: 100%;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .product-image {
        position: absolute;
        width: 100%;
        height: 100%;
        object-fit: cover;
        opacity: 0;
        transition: opacity 0.3s ease;
        left: 0;
        right: 0;
        margin: 0 auto;
    }

    .product-info {
        width: 100%;
        text-align: center;
        padding: 10px 0;
    }

    .product-images {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    #products {
        grid-template-columns: repeat(2, 1fr); /* Changed from 1fr to repeat(2, 1fr) */
        max-width: 100%; /* Changed from 500px to 100% for better responsiveness */
        margin: 5px auto;
        padding: 0 7px; /* Зменшено бокові відступи */
        gap: 7px; /* Зменшено відступ між картками */
    }

    .product {
        margin: 0;
        padding: 7px; /* Зменшено відступи всередині картки */
        width: 100%;
        box-sizing: border-box;
        border-radius: 12px;
    }

    .product-images {
        width: 100%;
        height: 150px;
        margin: 0 0 5px 0;
        border-radius: 8px; /* Додано закруглення для фото */
        overflow: hidden; /* Забезпечуємо, щоб фото не виходило за межі закруглення */
    }

    .product-info {
        padding: 0;
        margin-top: 5px; /* Зменшено відступ зверху */
    }

    main {
        padding: 2px;
        box-sizing: border-box;
        width: 100%;
    }

    .product .carousel-btn {
        display: none; /* Приховуємо стрілки в картках на мобільних */
    }

    .product .carousel-dots {
        bottom: 5px; /* Підняли точки трохи вище */
    }
}

/* Додаємо для десктопу, щоб картки не розтягувались */
@media (min-width: 901px) {
    /* Прибираємо зміщення для body > .container > main на десктопі */
    .container > main {
        margin: 0;
        padding-left: 0;
        padding-right: 0;
    }

    #products {
        align-items: stretch; /* Всі картки однієї висоти */
    /* Прибираємо зміщення на десктопі: грід вирівнюємо вліво в межах main */
    margin-left: 0;
    margin-right: 0;
    }
    .product {
        height: auto !important; /* Картка займає всю висоту гріда */
        min-height: 300px !important;
        max-height: 335px !important; /* Збільшено з 315px до 400px */
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        overflow: hidden; /* Запобігаємо виходу контенту за межі */
    }
    .product-info {
        flex: 1 1 auto !important;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }
    .add-to-cart-btn {
        margin-top: auto;
    }
}

/* Модальне вікно видалено — відповідні стилі очищено */

/* Стилі для шапки сайту з соцмережами */
.site-header {
    width: 100%;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    background: linear-gradient(to right, #ffffff, #f8f9fa);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-height: 70px; /* Явна висота для уникнення CLS */
}

/* Desktop версія */
.header-desktop {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin: 0 50px;
}

.logo img {
    max-height: 50px;
    margin: 10px;
}

.social-links-header {
    display: flex;
    align-items: center;
}

.social-buttons {
    display: flex;
    gap: 12px;
}

.social-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 50px;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.1);
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.social-btn img {
    width: 20px;
    height: 20px;
}

.social-btn.telegram:hover {
    background: #0088cc10;
    border-color: #0088cc;
    color: #0088cc;
}

.social-btn.viber:hover {
    background: #7360f210;
    border-color: #7360f2;
    color: #7360f2;
}

.social-btn.tiktok:hover {
    background: #00000010;
    border-color: #000000;
    color: #000000;
}

.social-btn.instagram:hover {
    background: linear-gradient(45deg, #f0947710, #bc2a8d10, #fccc6310);
    border-color: #bc2a8d;
    color: #bc2a8d;
}

/* Mobile версія */
.header-mobile {
    display: none;
    padding: 1px 10px 0px 2px; /* Верх, права, низ, ліва – рівні бічні відступи */
}

@media (max-width: 768px) {
    .header-desktop {
        display: none;
    }

    .header-mobile {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 5px; /* Зменшено відступ між елементами */
        padding: 0 10px;
        box-sizing: border-box;
        max-width: 100%;
        overflow-x: hidden;
        justify-content: center; /* Центруємо контент */
    }

    .header-mobile .social-left,
    .header-mobile .social-right {
        flex: 0 1 auto; /* Змінено flex властивості */
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 5px; /* Зменшено відступ між кнопками */
    }

    .header-mobile .social-btn {
        padding: 6px; /* Зменшено внутрішні відступи */
        min-width: 36px; /* Встановлено мінімальну ширину */
        justify-content: center;
    }

    .header-mobile .social-btn img {
        width: 20px; /* Зменшено розмір іконок */
        height: 20px;
    }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cart-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.cart-link:hover {
    background: rgba(0,0,0,0.05);
}

.cart-icon {
    font-size: 20px;
}

/* Мобільна кнопка кошик */
.mobile-cart-btn {
    display: none;
    padding: 12px 20px;
    background: linear-gradient(to right, #1b5e20, #2e7d32); /* Темніший зелений */
    color: rgba(255, 255, 255, 0.95); /* Світліший текст */
    border: none;
    border-radius: 25px;
    cursor: pointer;
    position: fixed;
    top: 140px; /* Положення під кнопкою фільтрів */
    right: 20px;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    font-weight: 600; /* Жирніший текст */
    font-size: 14px;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.mobile-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.25);
    background: linear-gradient(to right, #2e7d32, #388e3c); /* Темніший зелений при наведенні */
}

@media (max-width: 768px) {
    .mobile-cart-btn {
        display: flex;
    }
    
    .header-actions {
        display: none; /* Приховуємо десктопну версію */
    }
}

@media (max-width: 480px) {
    .mobile-cart-btn {
        right: 10px;
        padding: 10px 15px;
        font-size: 13px;
    }
}

/* Додайте стилі для кнопки "Додати в кошик" */
.add-to-cart-btn {
    margin-top: auto; /* Кнопка завжди внизу картки */
    margin-bottom: 0;
    padding: 8px 15px;
    background: linear-gradient(to right, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: calc(100% - 10px); /* Ширина кнопки з відступами */
    align-self: center;
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.product-info > *:not(:last-child) {
    margin-bottom: 5px; /* Відступ між елементами контенту */
}

/* Стилі для повідомлення про додавання в кошик */
.add-to-cart-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    background: #28a745;
    color: white;
    border-radius: 25px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* Оновлені стилі для соціальних кнопок в шапці */
.social-buttons {
    display: flex;
    gap: 12px;
}

.social-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 50px;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.1);
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.social-btn img {
    width: 20px;
    height: 20px;
}

.social-btn.telegram:hover {
    background: #0088cc10;
    border-color: #0088cc;
    color: #0088cc;
}

.social-btn.viber:hover {
    background: #7360f210;
    border-color: #7360f2;
    color: #7360f2;
}

.social-btn.tiktok:hover {
    background: #00000010;
    border-color: #000000;
    color: #000000;
}

.social-btn.instagram:hover {
    background: linear-gradient(45deg, #f0947710, #bc2a8d10, #fccc6310);
    border-color: #bc2a8d;
    color: #bc2a8d;
}

/* Оновлені стилі пагінації */
.pagination {
    display: flex;
    justify-content: space-between; /* Кожен блок займає свою зону */
    align-items: center;
    margin-top: 40px;
    gap: 0;
    padding: 15px;
    min-height: 60px; /* Резервуємо місце для уникнення CLS */
    height: 60px;
    box-sizing: border-box;
    overflow-anchor: none;
    overflow: hidden;
}

.pagination-section {
    display: flex;
    align-items: center;
}

.pagination-section.left,
.pagination-section.right {
    flex: 0 0 auto;
}

.pagination-section.center {
    flex: 1 1 0%;
    justify-content: center;
    min-width: 0;
}

.page-numbers {
    justify-content: center;
    min-width: 180px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.page-btn {
    padding: 12px 20px;
    border: none;
    background: linear-gradient(to right, #007bff, #0056b3);
    color: white;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 110px;
    min-height: 40px;
    justify-content: center;
}

.page-number {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #007bff;
    border-radius: 50%;
    cursor: pointer;
    color: #007bff;
    background-color: white;
    transition: all 0.3s ease;
    font-weight: 500;
}

.page-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    background: linear-gradient(to right, #0056b3, #004494);
}

.page-btn:disabled {
    background: linear-gradient(to right, #ccc, #999);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
    visibility: visible; /* Не ховаємо, а робимо неактивними */
}

.page-numbers {
    display: flex;
    gap: 4px; /* Збільшено відступ між номерами сторінок */
    align-items: center;
    min-width: 180px; /* Зарезервовано місце під номери сторінок, щоб не було стрибків */
    justify-content: center;
}

.page-number {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #007bff;
    border-radius: 50%;
    cursor: pointer;
    color: #007bff;
    background-color: white;
    transition: all 0.3s ease;
    font-weight: 500;
}

.page-number:hover {
    background-color: #f0f8ff;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,123,255,0.2);
}

.page-number.active {
    background: linear-gradient(to right, #007bff, #0056b3);
    color: white;
    border: none;
    box-shadow: 0 2px 5px rgba(0,123,255,0.3);
}

.page-ellipsis {
    color: #007bff;
    font-weight: bold;
    padding: 0 5px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

@media (max-width: 768px) {
    .pagination {
        gap: 5px;
        padding: 10px;
    }

    .page-btn {
        padding: 8px 15px;
        font-size: 13px;
    }

    .page-number {
        min-width: 35px;
        height: 35px;
        font-size: 13px;
    }
}

@media (max-width: 605px) {
    .pagination {
        min-height: 40px;
        height: 40px;
    }
    .page-numbers {
        min-width: 90px;
    }
    .page-btn {
        min-width: 36px;
        min-height: 18px;
    }
    .page-number {
        min-width: 28px;
        height: 28px;
    }
}

@media (max-width: 500px) {
    .page-numbers {
        gap: 2px;
        min-width: 90px; /* Менше місця під номери сторінок */
    }
}

@media (max-width: 480px) {
    .page-btn span {
        display: none;
    }

    .page-btn {
        padding: 8px;
        min-width: 28px;
        justify-content: center;
    }
}

/* Модалка видалена: стилі social-links/modal-cart-btn прибрано */

/* Стилі для футера */
.footer {
    background: linear-gradient(to right, #2c3e50, #3498db);
    color: #fff;
    padding: 12px 8px;
    margin-top: 15px;
    min-height: 80px; /* Явна висота для футера */
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px; /* увеличено расстояние между ссылками */
    font-size: 13px; /* немного увеличен размер шрифта */
}

.footer-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 10px 18px; /* увеличена область прикосновения */
    border-radius: 8px;
    background: rgba(255,255,255,0.08);
    margin: 1px 0;
    display: inline-flex;
    align-items: center;
    min-width: 44px; /* WCAG рекомендует минимум 44x44px */
    min-height: 44px;
    box-sizing: border-box;
    transition: background 0.2s, color 0.2s;
    justify-content: center;
}

.footer-links a:focus,
.footer-links a:hover {
    background: rgba(255,255,255,0.18);
    color: #fff;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.footer-contact {
    font-size: 14px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 15px;
    border-radius: 20px;
    margin: 5px 0;
}

.footer-contact a {
    color: #fff;
    text-decoration: none;
    transition: all 0.2s ease;
}

.footer-contact a:hover {
    color: #74b9ff;
    transform: scale(1.05);
    display: inline-block;
}

.footer-copyright {
    font-size: 10px;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .footer {
        padding: 8px 5px;
    }

    .footer-links {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        width: 100%;
        max-width: 350px;
    }

    .footer-links a {
        text-align: center;
        font-size: 12px;
        padding: 12px 0; /* увеличена высота для мобильных */
        min-width: 49px;
        min-height: 33px;
        border-radius: 10px;
    }
}

@media (max-width: 360px) {
    .footer-links {
        font-size: 9px;
    }
    
    .footer-links a {
        padding: 2px 21px;
    }
}

/* Модалка видалена: стилі повідомлень прибрано */

.product-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Стилі для вкладених фільтрів */
.filter-group .filter-group {
    margin-left: 15px;
}

.filter-group .filter-group > .filter-btn {
    font-size: 0.95em;
    padding: 8px 12px;
    width: calc(100% - 15px);
    background: linear-gradient(to right, #f8f9fa, #ffffff);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.filter-group .filter-group > .filter-btn:hover {
    background: linear-gradient(to right, #e9ecef, #f8f9fa);
    transform: translateX(5px);
}

.filter-group .filter-group > .filter-btn.active {
    background: linear-gradient(to right, #0056b3, #007bff);
    color: white;
    box-shadow: 0 2px 4px rgba(0,123,255,0.3);
}

.filter-group {
    min-height: 0 !important; /* Ще менше зайвого простору для порожніх груп */
    min-width: 0;
    will-change: min-height;
    contain: content;
}

.sub-filters {
    display: none;
    padding-left: 15px;
    margin-top: 10px;
    min-height: 0 !important; /* Ще менше зайвого простору */
    min-width: 0;
    overflow-anchor: none;
    overflow: hidden;
    overflow-y: hidden;
    box-sizing: border-box;
    transition: none !important;
    visibility: hidden;
    will-change: min-height, opacity;
}

.filter-group > .filter-btn.active + .sub-filters {
    display: block;
    visibility: visible;
}

.sub-filter-group {
    margin-bottom: 15px;
    min-height: 0 !important; /* Ще менше зайвого простору */
    min-width: 0;
    overflow-anchor: none;
    box-sizing: border-box;
    transition: none !important;
    will-change: min-height, opacity;
}

.ssr-modal-content {
    background: #fff;
    margin: 20px auto;
    padding: 20px;
    max-width: 1000px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: row;
    gap: 40px;
    align-items: flex-start;
    /* Запобігає небажаному зсуву при довантаженні контенту */
    overflow-anchor: none;
}

/* Ensure flex children can shrink and not force horizontal overflow */
.ssr-modal-content,
.ssr-modal-image-container,
.ssr-modal-info { min-width: 0; }

/* Contain sizing inside SSR block */
.ssr-modal-content, .ssr-modal-content * { box-sizing: border-box; }

@media (max-width: 768px) {
    .ssr-modal-content { 
        flex-direction: column; 
        padding: 10px; 
        gap: 0; 
        margin: 10px;
    }
}
@media (min-width: 769px) and (max-width: 1575px) {
    .ssr-modal-content { 
       margin: 20px 20px;
    }
}
.ssr-modal-content

.ssr-modal-image-container { 
    position: relative; 
    width: 100%; 
    max-width: 450px; 
    min-width: 320px; 
    min-height: 400px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    box-sizing: border-box; 
    padding: 24px; 
    /* Стабільна, але адаптивна ширина колонки з фото на десктопі */
    flex: 0 1 450px;
}

@media (max-width: 768px) {
    .ssr-modal-image-container { 
        min-width: 0; 
        min-height: 250px; 
        padding: 0; 
        margin: 0 auto; 
    }
}

.ssr-modal-images { 
    width: 100%; 
    max-width: 400px; 
    /* Резервуємо місце під зображення, щоб уникнути CLS */
    aspect-ratio: 1 / 1; 
    min-height: 320px;
    position: relative; 
    margin: 0 auto; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

.ssr-modal-images img { 
    width: 100%; 
    height: 100%; 
    object-fit: contain; 
    border-radius: 8px; 
    background: #f0f0f0; 
    display: none; 
}

.ssr-modal-images img.active { 
    display: block; 
}

.ssr-carousel-btn { 
    position: absolute; 
    top: 50%; 
    transform: translateY(-50%); 
    background: rgba(0,0,0,0.5); 
    color: #fff; 
    border: none; 
    padding: 15px; 
    cursor: pointer; 
    font-size: 20px; 
    z-index: 2; 
    border-radius: 50%;
    transition: background 0.3s ease;
}

.ssr-carousel-btn:hover {
    background: rgba(0,0,0,0.7);
}

.ssr-carousel-btn.prev { 
    left: 10px; 
}

.ssr-carousel-btn.next { 
    right: 10px; 
}

.ssr-carousel-dots { 
    position: absolute; 
    bottom: 10px; 
    left: 50%; 
    transform: translateX(-50%); 
    display: flex; 
    gap: 5px; 
    z-index: 2; 
}

.ssr-dot { 
    width: 8px; 
    height: 8px; 
    border-radius: 50%; 
    background: rgba(0,0,0,0.2); 
    cursor: pointer; 
    transition: background 0.3s ease;
}

.ssr-dot.active { 
    background: #007bff; 
}

.ssr-dot:hover {
    background: rgba(0,0,0,0.4);
}

.ssr-modal-info { 
    width: 50%; 
    max-width: 500px; 
    box-sizing: border-box; 
    display: flex; 
    flex-direction: column; 
    justify-content: flex-start; 
    /* Друга колонка займає весь доступний простір поруч із фото */
    flex: 1 1 0;
}

@media (max-width: 768px) { 
    .ssr-modal-info { 
        width: 100%; 
        max-width: 100vw; 
        padding: 10px 0; 
    } 
}

.ssr-modal-title { 
    font-size: 24px; 
    margin-bottom: 15px; 
    color: #2c3e50; 
    font-weight: 600;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.ssr-modal-price { 
    font-size: 28px; 
    color: #007bff; 
    font-weight: bold; 
    margin-bottom: 20px; 
}

.ssr-modal-description {
    margin-top: 20px;
    line-height: 1.7;
    color: #333;
    font-size: 15px;
    padding: 18px 14px 18px 18px;
    background-color: #f8f9fa;
    border-radius: 8px;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.ssr-modal-description h2 {
    font-size: 22px;
    color: #2c3e50;
    margin: 18px 0 10px 0;
    font-weight: 700;
    line-height: 1.2;
}

.ssr-modal-description h3 {
    font-size: 18px;
    color: #007bff;
    margin: 16px 0 8px 0;
    font-weight: 600;
    line-height: 1.2;
}

.ssr-modal-description ul {
    margin: 10px 0 10px 20px;
    padding-left: 18px;
}

.ssr-modal-description li {
    margin-bottom: 6px;
    font-size: 15px;
    line-height: 1.5;
    list-style: disc inside;
}

.ssr-modal-description p {
    margin: 10px 0;
    font-size: 15px;
    line-height: 1.7;
}

.ssr-modal-description strong {
    color: #2c3e50;
    font-weight: 600;
}

.ssr-modal-description em {
    color: #007bff;
}

@media (max-width: 768px) {
    .ssr-modal-description {
        font-size: 14px;
        padding: 12px 6px 12px 10px;
    }
    .ssr-modal-description h2 { font-size: 18px; }
    .ssr-modal-description h3 { font-size: 15px; }
}

/* Make description content responsive (wrap long words, responsive tables/media) */
.ssr-modal-description {
    max-width: 100%;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.ssr-modal-description * {
    max-width: 100%;
    box-sizing: border-box;
}
.ssr-modal-description table {
    width: 100% !important;
    table-layout: fixed;
    border-collapse: collapse;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.ssr-modal-description th,
.ssr-modal-description td {
    word-break: break-word;
}
.ssr-modal-description iframe,
.ssr-modal-description video {
    max-width: 100%;
    height: auto;
    display: block;
}
.ssr-modal-description a {
    word-break: break-word;
}

.ssr-modal-cart-btn { 
    margin-top: 10px; 
    padding: 12px 24px; 
    background: linear-gradient(to right, #007bff, #0056b3); 
    color: white; 
    border: none; 
    border-radius: 25px; 
    cursor: pointer; 
    transition: all 0.3s ease; 
    font-size: 16px; 
    font-weight: 500; 
    width: 100%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px; 
}

.ssr-modal-cart-btn:hover { 
    background: linear-gradient(to right, #0056b3, #004494); 
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

/* Responsive desktop tuning for SSR product layout (1550px → 768px) */
@media (min-width: 1400px) {
    .ssr-modal-content { max-width: 1200px; gap: 48px; }
    .ssr-modal-image-container { flex: 0 1 520px; }
    .ssr-modal-images { max-width: 480px; }
    .ssr-modal-title { font-size: 26px; }
    .ssr-modal-price { font-size: 30px; }
    .ssr-modal-info { max-width: 700px; }
    .ssr-modal-description { font-size: 16px; }
}


@media (max-width: 1399px) and (min-width: 1200px) {
    .ssr-modal-content { max-width: 1140px; gap: 40px; }
    .ssr-modal-image-container { flex: 0 1 480px; }
    .ssr-modal-images { max-width: 440px; }
    .ssr-modal-info { max-width: 640px; }
}

@media (max-width: 1199px) and (min-width: 1024px) {
    .ssr-modal-content { max-width: 1060px; gap: 32px; }
    .ssr-modal-image-container { flex: 0 1 420px; }
    .ssr-modal-images { max-width: 420px; }
    .ssr-modal-info { max-width: 560px; }
}

@media (max-width: 1023px) and (min-width: 768px) {
    .ssr-modal-content { max-width: 960px; gap: 20px; padding: 16px; }
    .ssr-modal-image-container { flex: 0 1 380px; min-width: 320px; padding: 16px; }
    .ssr-modal-images { max-width: 360px; }
    .ssr-modal-title { font-size: 22px; }
    .ssr-modal-price { font-size: 26px; }
    .ssr-modal-info { max-width: none; }
}

.ssr-social-links { 
    margin-top: 16px; 
    margin-bottom: 8px; 
    padding-top: 16px; 
    border-top: 1px solid rgba(0,0,0,0.1); 
}

.ssr-social-links h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #2c3e50;
}

.ssr-social-buttons { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 8px; 
    margin-top: 12px; 
    margin-bottom: 0; 
    padding: 0; 
}

@media (max-width: 768px) { 
    .ssr-social-buttons { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 6px;
    } 
}

.ssr-social-btn { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    padding: 8px 12px; 
    border-radius: 20px; 
    background: #fff; 
    border: 1px solid rgba(0,0,0,0.1); 
    color: #333; 
    text-decoration: none; 
    font-size: 13px; 
    font-weight: 500; 
    transition: all 0.3s ease; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.05); 
    justify-content: center; 
}

.ssr-social-btn img { 
    width: 18px; 
    height: 18px; 
}

.ssr-social-btn.telegram:hover { 
    background: #0088cc10; 
    border-color: #0088cc; 
    color: #0088cc; 
}

.ssr-social-btn.viber:hover { 
    background: #7360f210; 
    border-color: #7360f2; 
    color: #7360f2; 
}

.ssr-social-btn.tiktok:hover { 
    background: #00000010; 
    border-color: #000000; 
    color: #000000; 
}

.ssr-social-btn.instagram:hover { 
    background: linear-gradient(45deg, #f0947710, #bc2a8d10, #fccc6310); 
    border-color: #bc2a8d; 
    color: #bc2a8d; 
}

/* Back to catalog button */
.back-to-catalog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    /* Reserve space to prevent CLS when button is injected */
    min-height: 48px; /* equals button height */
    display: flex;
    align-items: center;
}

.back-to-catalog-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    line-height: 1;
}

.back-to-catalog-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,123,255,0.3);
}

/* Add to cart notification */
.add-to-cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

@media (min-width: 1201px) {
    main {
        min-height: 100vh;
        min-block-size: 100vh;
    }
    #products {
        min-height: 100vh;
        min-block-size: 100vh;
    }
}

/* Хлібні крихти - ПРИМУСОВІ СТИЛІ */
.breadcrumbs-container {
    background: #fff !important;
    padding: 15px 20px !important;
    border-bottom: 1px solid #e9ecef !important;
    margin-bottom: 20px !important;
}

.breadcrumbs {
    margin: 0 !important;
    font-size: 14px !important;
    color: #666 !important;
}

.breadcrumb-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    white-space: nowrap !important;
    counter-reset: none !important;
}

.breadcrumb-item {
    display: inline-flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    list-style: none !important;
    counter-increment: none !important;
}

.breadcrumb-item::before {
    content: none !important;
    display: none !important;
}

.breadcrumb-item::after {
    content: none !important;
    display: none !important;
}

.breadcrumb-separator {
    display: inline-flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    color: #ccc !important;
    font-weight: normal !important;
    user-select: none !important;
    white-space: nowrap !important;
    list-style: none !important;
}

.breadcrumb-item a {
    color: #007bff !important;
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

.breadcrumb-item a:hover {
    color: #0056b3 !important;
    text-decoration: underline !important;
}

.breadcrumb-item.current span {
    color: #333 !important;
    font-weight: 500 !important;
}

/* Додаткове вирівнювання для 769–900px: зберігаємо такі ж бокові відступи як на ≥901px */
@media (min-width: 769px) and (max-width: 900px) {
    .container > main {
        padding-left: 0;
        padding-right: 0;
    }
}

/* ==== Ultra small width fixes (320-360px) ==== */
@media (max-width: 360px) {
    html, body { overflow-x: hidden; }
    .ssr-modal-content { margin: 0 auto !important; padding: 4px 2px 6px !important; max-width: 100% !important; gap: 0 !important; }
    .ssr-modal-image-container { min-width: 0 !important; width: 100% !important; max-width: 100% !important; padding: 0 !important; margin: 0 auto 2px !important; overflow: hidden !important; align-items: stretch !important; min-height: 0 !important; height: auto !important; display: block !important; }
    .ssr-modal-images { width: 100% !important; max-width: 100% !important; aspect-ratio: unset !important; min-height: 0 !important; height: auto !important; padding: 0 !important; box-sizing: border-box; position: relative !important; display: block !important; }
    .ssr-modal-images img { width: 100% !important; height: auto !important; margin: 0 auto !important; object-fit: contain !important; display: none !important; }
    .ssr-modal-images img.active { display: block !important; }
    .ssr-carousel-btn { width: 34px !important; height: 34px !important; padding: 0 !important; top: 48% !important; transform: translateY(-50%); }
    .ssr-carousel-btn.prev { left: 2px !important; }
    .ssr-carousel-btn.next { right: 2px !important; }
    .ssr-carousel-dots { bottom: 4px !important; }
    .ssr-modal-info { width: 100% !important; max-width: 100% !important; padding: 2px 4px 10px !important; }
    .ssr-modal-title { margin-top: 2px !important; margin-bottom: 10px !important; font-size: 22px !important; }
    .breadcrumbs-container { padding: 10px 8px !important; }
    .breadcrumb-list { white-space: normal !important; }
    .breadcrumb-item, .breadcrumb-separator { white-space: normal !important; }
}

/* Same layout tightening for slightly larger small screens 361-500px */
@media (min-width: 361px) and (max-width: 500px) {
    html, body { overflow-x: hidden; }
    .ssr-modal-content { margin: 0 auto !important; padding: 6px 4px 8px !important; max-width: 100% !important; gap: 4px !important; }
    .ssr-modal-image-container { min-width: 0 !important; width: 100% !important; max-width: 100% !important; padding: 0 !important; margin: 0 auto 4px !important; overflow: hidden !important; align-items: stretch !important; min-height: 0 !important; height: auto !important; display: block !important; }
    .ssr-modal-images { width: 100% !important; max-width: 100% !important; aspect-ratio: unset !important; min-height: 0 !important; height: auto !important; padding: 0 !important; position: relative !important; display: block !important; }
    .ssr-modal-images img { width: 100% !important; height: auto !important; object-fit: contain !important; display: none !important; margin: 0 auto !important; }
    .ssr-modal-images img.active { display: block !important; }
    .ssr-carousel-btn { width: 36px !important; height: 36px !important; padding: 0 !important; top: 50% !important; transform: translateY(-50%); }
    .ssr-carousel-btn.prev { left: 4px !important; }
    .ssr-carousel-btn.next { right: 4px !important; }
    .ssr-carousel-dots { bottom: 8px !important; }
    .ssr-modal-info { width: 100% !important; max-width: 100% !important; padding: 6px 6px 14px !important; }
    .breadcrumbs-container { padding: 12px 10px !important; }
    .breadcrumb-list { white-space: normal !important; }
    .breadcrumb-item, .breadcrumb-separator { white-space: normal !important; }
}

/* Granular flex sizing for image container (user request) */
@media (min-width:320px) and (max-width:370px) {
    .ssr-modal-image-container { display:flex !important; flex:0 1 350px !important; }
}
@media (min-width:371px) and (max-width:420px) {
    .ssr-modal-image-container { display:flex !important; flex:1 1 390px !important; }
}
@media (min-width:421px) and (max-width:480px) {
    .ssr-modal-image-container { display:flex !important; flex:1 1 430px !important; }
}
@media (min-width:481px) and (max-width:500px) {
    .ssr-modal-image-container { display:flex !important; flex:1 1 470px !important; }
}
