@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600&subset=cyrillic');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    background-color: #fff;
    color: #000;
    padding-bottom: 70px;
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

body.new-year-theme {
    background-image: url('winterbackground.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.product {
    background-color: #ffffff;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    max-width: 100%;
    overflow: hidden;
}

.product.new-year-product {
    background-color: #ffffff;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}


.product.new-year-product .product-info {
    background-color: #ffffff;
    margin: 5px;
    padding: 5px;
    position: relative;
    z-index: 2;
}

.product img {
    width: 100%;
    height: auto;
    margin-bottom: 8px;
    max-width: 100%;
    display: block;
    transition: opacity 0.5s ease-in-out;
}

.product .product-info h3 {
    font-size: 0.9rem;
    margin: 5px 0;
    height: 1.5em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    padding: 0 5px;
    font-weight: 600;
}

.centered-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    color: #5c5c5c;
    text-align: center;
    padding: 0 10px;
    font-size: 0.8rem;
    margin: 10px 0;
    max-width: 50%;
    box-sizing: border-box;
}

.product .product-info p {
    font-size: 0.8rem;
    margin: 3px 0;
    color: #333;
    max-width: 100%;
    padding: 0 5px;
    font-weight: 400;
}

.discount-price {
    color: #b40805ff;
    font-weight: 600;
}

.original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.7rem;
    font-weight: 400;
}

.discount-badge {
    background-color: #b40805ff;
    color: white;
    padding: 2px 4px;
    font-size: 0.6rem;
    margin-left: 4px;
    font-weight: 500;
}

.friday-sale-banner {
    background-color: #111111;
    color: #fff;
    text-align: center;
    padding: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.new-year-banner {
    background-color: #b40805ff;
    color: #fff;
    text-align: center;
    padding: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 10px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}


/* ОБНОВЛЕННЫЕ СТИЛИ ДЛЯ МОДАЛЬНОГО ОКНА ФИЛЬТРОВ */
.filter-modal {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background-color: white;
    transition: right 0.3s ease;
    z-index: 1002;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    box-sizing: border-box;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.filter-modal.open {
    right: 0;
    overflow-y: auto;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    width: 100%;
    box-sizing: border-box;
}

.filter-title {
    font-size: 1.2rem;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
}

.close-filter {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1003;
    color: #000;
    font-family: 'Montserrat', sans-serif;
}

.filter-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    gap: 25px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.filter-section {
    margin-bottom: 1px;
}

/* Стили для группировки категорий (НОВОЕ) */
.filter-group {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f9f9f9;
}
.filter-group:last-child {
    border-bottom: none;
}
.filter-group-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: hsl(0, 1%, 34%);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Montserrat', sans-serif;
}

.filter-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #000;
    font-family: 'Montserrat', sans-serif;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 5px; /* Уменьшил отступ между элементами */
    max-height: none;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    padding-right: 5px;
}

.category-list::-webkit-scrollbar {
    width: 4px;
}

.category-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.category-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.category-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 40px; /* Немного уменьшил высоту */
    flex-shrink: 0;
}

.category-item:hover {
    background-color: #f5f5f5;
}

.category-checkbox {
    width: 20px;
    height: 20px;
    accent-color: #000;
}

.category-name {
    font-size: 0.9rem;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
}

/* ОБНОВЛЕННЫЕ СТИЛИ ДЛЯ СОРТИРОВКИ */
.sort-dropdown {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

.sort-dropdown-btn {
    background-color: #fff;
    border: 1px solid #000;
    padding: 12px 15px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    min-height: 44px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    color: #000;
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    outline: none;
}

.sort-dropdown-btn:hover {
    background-color: #f5f5f5;
}

.sort-dropdown-btn:active {
    background-color: #e5e5e5;
}

.sort-dropdown-btn::after {
    content: "▼";
    font-size: 0.7rem;
    transition: transform 0.3s;
    color: #000;
    margin-left: 10px;
}

.sort-dropdown-btn.active::after {
    transform: rotate(180deg);
}

.sort-dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #000;
    border-top: none;
    margin-top: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 10;
    display: none;
    flex-direction: column;
}

.sort-dropdown-content.show {
    display: flex;
}

.sort-option {
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: none;
    text-align: left;
    font-size: 0.9rem;
    color: #000;
    background-color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    outline: none;
    border-bottom: 1px solid #eee;
}

.sort-option:hover {
    background-color: #f5f5f5;
}

.sort-option.active {
    background-color: #000;
    color: #fff;
    font-weight: 500;
}

.sort-option:last-child {
    border-bottom: none;
}

.sort-option:active {
    background-color: #e5e5e5;
}

/* ОБНОВЛЕННЫЕ СТИЛИ ДЛЯ КНОПОК ФИЛЬТРОВ */
.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding: 20px 0;
    border-top: 1px solid #eee;
    flex-shrink: 0;
    margin-bottom: 20px;
}

.apply-filter-btn, .reset-filter-btn {
    flex: 1;
    padding: 14px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    min-height: 44px;
    font-family: 'Montserrat', sans-serif;
}

.apply-filter-btn {
    background-color: #000;
    color: white;
    font-weight: 500;
}

.apply-filter-btn:hover {
    background-color: #333;
}

.reset-filter-btn {
    background-color: #f1f1f1;
    color: #333;
    font-weight: 400;
}

.reset-filter-btn:hover {
    background-color: #e5e5e5;
}

/* СТИЛИ ДЛЯ КОРЗИНЫ */
.cart-container {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background-color: white;
    transition: right 0.3s ease;
    z-index: 1000;
    padding: 15px;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    box-sizing: border-box;
}

.cart-container.open {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    width: 100%;
    box-sizing: border-box;
}

.cart-title {
    font-size: 1.2rem;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
}

.close-cart {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
    color: #000;
    font-family: 'Montserrat', sans-serif;
}

.cart-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    width: 100%;
    box-sizing: border-box;
}

.cart-item {
    display: flex;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
    width: 100%;
    box-sizing: border-box;
    transition: opacity 0.3s ease;
}

/* НОВЫЙ СТИЛЬ: недоступный товар в корзине */
.cart-item-unavailable {
    opacity: 0.5;
    background-color: #f9f9f9;
    position: relative;
}

.cart-item-unavailable .cart-item-title {
    color: #999;
}

.cart-item-unavailable .cart-item-price {
    color: #999;
}

.cart-item-unavailable::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

/* НОВЫЙ СТИЛЬ: бейдж "ЗАКОНЧИЛИСЬ" */
.unavailable-badge {
    display: inline-block;
    background-color: #b40805ff;
    color: white;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 5px;
    border-radius: 3px;
    text-transform: uppercase;
}

/* Стили для ссылок в корзине */
.cart-item-link-wrapper {
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
}

.cart-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    margin-right: 10px;
    cursor: pointer;
}

.cart-item-info {
    flex-grow: 1;
    max-width: calc(100% - 70px);
}

.cart-item-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
}

.cart-item-price {
    color: #b40805ff;
    margin-bottom: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: 'Montserrat', sans-serif;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.quantity-btn {
    background-color: #f1f1f1;
    border: 1px solid #ddd;
    width: 22px;
    height: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 0.8rem;
}

.quantity-input {
    width: 35px;
    text-align: center;
    margin: 0 4px;
    border: 1px solid #ddd;
    height: 22px;
    font-size: 0.8rem;
    font-family: 'Montserrat', sans-serif;
}

.remove-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 0.8rem;
    font-family: 'Montserrat', sans-serif;
}

.remove-btn:hover {
    color: #b40805ff;
}

.cart-total {
    font-size: 1rem;
    font-weight: 600;
    margin: 10px 0;
    text-align: right;
    padding-top: 10px;
    border-top: 1px solid #eee;
    width: 100%;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

.checkout-btn {
    background-color: #000;
    color: white;
    border: none;
    padding: 12px;
    margin-bottom: 30px;
    width: 100%;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none;
    text-align: center;
    display: block;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
}

.checkout-btn:hover {
    background-color: #333;
}

.empty-cart {
    text-align: center;
    color: #999;
    padding: 20px 0;
    font-family: 'Montserrat', sans-serif;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: none;
    z-index: 999;
}

.overlay.active {
    display: block;
    overflow: hidden;
    touch-action: none;
}
.key-text {
  width: 1%;
  text-align: center;
  padding: 1px 1px;
  background-color: #ff000000;
  color: rgba(255, 4, 0, 0);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.key-text h1 {
  font-size: 0.1rem;
  font-weight: 600;
  margin-bottom: 1px;
  letter-spacing: 1px;
  font-family: 'Montserrat', sans-serif;
}

.key-text p {
  font-size: 0.1rem;
  opacity: 0.1;
  max-width: 1px;
  line-height: 0.1;
  font-family: 'Montserrat', sans-serif;
}
/* ОСОБЫЕ СТИЛИ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ */
@media (max-width: 767px) {
    .filter-modal {
        padding: 20px 20px 30px 20px;
        height: 100vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .filter-content {
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 20px;
        gap: 20px;
    }
    
    .category-list {
        max-height: 43vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .filter-actions {
        position: sticky;
        bottom: 0;
        background: white;
        padding: 25px 0 15px 0;
        margin-top: auto;
        border-top: 1px solid #eee;
        margin-bottom: 90px;
    }
    
    .checkout-btn {
        margin-bottom: 80px;
    }

    .sort-dropdown-content {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 300px;
        max-height: 60vh;
        overflow-y: auto;
        box-shadow: 0 10px 30px rgba(0,0,0,0.3);
        z-index: 1005;
        border: 1px solid #000;
    }

    .sort-dropdown {
        margin-bottom: 25px;
    }
    
    .sort-dropdown-btn {
        -webkit-tap-highlight-color: transparent;
        background-color: #fff;
        color: #000;
        border: 1px solid #000;
    }
    
    .sort-option {
        color: #000;
        background-color: #fff;
        border-bottom: 1px solid #eee;
        -webkit-tap-highlight-color: transparent;
    }
    
    .sort-option:active {
        background-color: #f0f0f0;
    }

    .cart-container {
        padding: 15px 15px 30px 15px;
        height: calc(100vh - 30px);
    }
    
    .cart-content {
        padding-bottom: 20px;
    }
.cart-item img {
    width: 70px;
    height: 70px;
   
}
    body, html {
        overflow-x: hidden;
        position: relative;
        width: 100%;
        height: 100%;
    }
    
    body {
        touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
    }
    
    .container {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 8px;
    }
    
    .product .product-info h3 {
        font-size: 0.8rem;
        font-weight: 600;
    }
    
    .centered-text {
        font-size: 0.65rem;
        font-weight: 300;
    }
    .new-year-banner {
        font-size: 0.85rem;
        font-weight: 600;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 360px) {
    .filter-modal {
        padding: 15px 15px 25px 15px;
        height: calc(100vh - 25px);
    }
    
    .cart-container {
        padding: 15px 15px 25px 15px;
        height: calc(100vh - 25px);
    }
    
    .filter-header {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
    
    .filter-section {
        margin-bottom: 1px;
    }
    
    .filter-section-title {
        font-size: 0.9rem;
        margin-bottom: 8px;
        font-weight: 600;
    }
    
    .category-list {
        max-height: 38vh;
    }
    
    .filter-actions {
        padding: 20px 0 15px 0;
        margin-bottom: 90px;
    }
    
    .checkout-btn {
        margin-bottom: 80px;
    }
    
    .category-item {
        padding: 6px 0;
    }
    
    .sort-dropdown-btn {
        padding: 10px 12px;
        font-size: 0.85rem;
        font-weight: 400;
    }
    
    .sort-option {
        padding: 10px 12px;
        font-size: 0.85rem;
        font-weight: 400;
    }
    
    .apply-filter-btn, .reset-filter-btn {
        padding: 12px;
        font-size: 0.85rem;
    }
    .new-year-banner {
        font-size: 0.75rem;
        font-weight: 600;
    }
}

/* Для десктопов */
@media (min-width: 768px) {
    .cart-container {
        width: 400px;
        right: -400px;
    }
    
    .filter-modal {
        width: 400px;
        right: -400px;
    }
    
    .filter-actions {
        margin-bottom: 0;
    }
    
    .close-cart {
        color: #000;
    }
    
    .container {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        padding: 15px;
        margin-bottom: 10px;
        max-width: 1200px;
    }
    
    .sort-dropdown-btn {
        background-color: #fff;
        border: 1px solid #000;
        color: #000;
    }
    
    .sort-dropdown-btn:hover {
        background-color: #f5f5f5;
    }
    
    .sort-option:hover {
        background-color: #f5f5f5;
    }
}

@media (min-width: 1024px) {
    .container {
        grid-template-columns: repeat(4, 1fr);
        max-width: 1200px;
    }
    
    .checkout-btn {
        padding: 8px;
        margin-bottom: 10px;
    }
}

/* Дополнительные исправления для предотвращения горизонтального скролла */
body, html {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

* {
    max-width: 100%;
}

.container, nav, .friday-sale-banner, .centered-text, .new-year-banner {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* SVG баннер внизу страницы */
.svg-banner-container {
    width: 100%;
    margin: 40px 0 20px;
    padding: 0 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

.svg-banner {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Для десктопов (ПК) */
@media (min-width: 769px) {
    .svg-banner {
        width: 1200px;
        max-height: 45px;
    }
    .svg-banner-container {
        margin: 20px 0 30px;
    }
}

/* Для планшетов */
@media (min-width: 481px) and (max-width: 768px) {
    .svg-banner {
        width: 100%;
        max-height: 20px;
    }
    .svg-banner-container {
        margin: 17px 0 25px;
    }
}

/* Для телефонов */
@media (max-width: 480px) {
    .svg-banner {
        width: 100%;
        max-height: 20px;
    }
    .svg-banner-container {
        margin: 17px 0 20px;
        padding: 0 5px;
    }
}