* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: sans-serif;
}

body {
    background-color: #fff;
    color: #000;
    max-width: 100%;
    overflow-x: hidden;
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background: white;
    z-index: 100;
}

.burger-menu {
    font-size: 20px;
    cursor: pointer;
    display: none;
}

.desktop-menu {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.desktop-menu span {
    cursor: pointer;
    font-size: 14px;
    padding: 5px 10px;
}

.desktop-menu span.active {
    font-weight: bold;
}

.logo {
    font-weight: bold;
    font-size: 18px;
    text-align: center;
    flex-grow: 1;
}

.cart-icon {
    position: relative;
    font-size: 20px;
    cursor: pointer;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #000;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Sidebar Menu */
.sidebar {
    position: fixed;
    top: 0;
    left: -250px;
    width: 250px;
    height: 100%;
    background: white;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    transition: left 0.3s ease;
    z-index: 1000;
    padding: 60px 20px 20px;
}

.sidebar.active {
    left: 0;
}

.close-menu {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 20px;
    cursor: pointer;
}

.categories {
    list-style: none;
}

.categories li {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    font-size: 16px;
    cursor: pointer;
}

.categories li.active {
    font-weight: bold;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    z-index: 999;
}

/* Product Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 15px;
}

/* Планшет и выше - скрываем бургер меню */
@media (min-width: 768px) {
    .burger-menu {
        display: none;
    }
    
    .desktop-menu {
        display: flex;
    }
}

/* Мобильный - бургер меню */
@media (max-width: 767px) {
    .burger-menu {
        display: block;
    }
    
    .desktop-menu {
        display: none;
    }
}

/* Адаптивная сетка для разных разрешений */
@media (min-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }
}

@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Для очень маленьких мобильных - 2 колонки */
/*@media (max-width: 479px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}*/


/* Для iPhone и современных мобильных */
@media (max-width: 767px) and (min-device-width: 375px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.product-card {
    position: relative;
    margin-bottom: 15px; /* уменьшенный отступ между рядами */
}

.product-image {
    width: 100%;
    height: 0;
    padding-bottom: 100%; /* Квадратное соотношение */
    position: relative;
    overflow: hidden;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s;
}

.product-image .size-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.product-card:hover .size-overlay {
    opacity: 1;
}

.product-info {
    margin-top: 8px; /* уменьшенный отступ */
}

.product-name {
    font-size: 12px; /* уменьшенный шрифт */
    margin-bottom: 2px; /* сильно уменьшенный отступ */
    font-weight: 500;
    line-height: 1.3;
}

.product-price {
    font-size: 12px; /* такой же как у названия */
    font-weight: normal;
    line-height: 1.3;
}

.old-price {
    text-decoration: line-through;
    color: #999;
    font-size: 11px; /* уменьшенный шрифт */
    margin-right: 4px; /* уменьшенный отступ */
}

/* Product Detail Page */
.product-detail {
    display: none;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.back-button {
    font-size: 20px;
    margin-bottom: 20px;
    display: inline-block;
    cursor: pointer;
}

.product-detail-content {
    display: block;
}

/* Десктопная версия страницы товара (4+ колонки) */
@media (min-width: 1024px) {
    .product-detail-content {
        display: grid;
        grid-template-columns: 40% 60%;
        gap: 40px;
        align-items: start;
    }
    
    .product-images .swiper-slide img {
        object-fit: cover; /* меняем contain на cover */
        width: 100%;
        height: 100%;
    }
}

/* Мобильная версия (вертикальная) */
@media (max-width: 1023px) {
    .product-detail-content {
        display: block;
    }
    
    .product-images .swiper-slide img {
        object-fit: cover;
    }
    
    /* Уменьшенные отступы для мобильной версии */
    .detail-name {
        margin-bottom: 10px;
    }
    
    .detail-price-container {
        margin-bottom: 15px;
    }
    
    .size-selector {
        margin-bottom: 15px;
    }
    
    .add-to-cart {
        margin: 15px 0;
    }
}

.product-images {
    position: relative;
}

.swiper {
    width: 100%;
    height: 400px;
}

.swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
}

.swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.swiper-button-prev,
.swiper-button-next {
    color: #0044fff7;
    background: rgba(158, 194, 255, 0.124);
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.swiper-button-prev:after,
.swiper-button-next:after {
    font-size: 25px;
}

.product-info-detail {
    padding-top: 20px;
}

.detail-name {
    font-size: 20px;
    margin-bottom: 15px;
    font-weight: 500;
}

.detail-price-container {
    margin-bottom: 20px;
}

.detail-price {
    font-size: 20px;
    font-weight: normal;
}

.detail-old-price {
    text-decoration: line-through;
    color: #929292;
    font-size: 16px;
    margin-right: 10px;
}

.size-selector {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.size-selector span {
    margin-right: 15px;
    min-width: 50px;
}

.sizes-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.size-option {
    padding: 8px 12px;
    border: 1px solid #003b9b34;
    border-radius: 4px;
    cursor: pointer;
    min-width: 40px;
    text-align: center;
}

.size-option.active {
    background-color: #0925ff;
    color: rgba(255, 255, 255, 0.913);
}

.size-option.unavailable {
    opacity: 0.5;
    cursor: not-allowed;
}

.add-to-cart {
    width: 100%;
    padding: 15px;
    background-color: #0925ff;
    color: rgba(255, 255, 255, 0.913);
    border: none;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    margin: 20px 0;
    cursor: pointer;
}

.add-to-cart.added {
    background-color: #555;
    cursor: default;
}

.add-to-cart:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.details-list-container h3 {
    margin-bottom: 10px;
    font-size: 16px;
}

.details-list {
    padding-left: 20px;
}

.details-list li {
    margin-bottom: 4px;
    font-size: 14px;
    color: #555;
}

/* Cart Modal */
.cart-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 1000;
    padding: 20px;
    max-height: 80vh;
    overflow-y: auto;
    display: none;
}

.cart-modal.active {
    display: block;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.close-cart {
    font-size: 20px;
    cursor: pointer;
}

.cart-items {
    margin-bottom: 20px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.cart-item-info {
    flex-grow: 1;
}

.cart-item-name {
    font-size: 14px;
    margin-bottom: 5px;
}

.cart-item-details {
    font-size: 12px;
    color: #777;
}

.cart-item-price {
    font-weight: normal;
    margin: 5px 0;
}

.remove-item {
    color: #ea1010d6;
    cursor: pointer;
    padding: 5px 10px;
}

.checkout-button {
    width: 100%;
    padding: 15px;
    background-color: #0925ff;
    color: rgba(255, 255, 255, 0.913);
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.empty-cart {
    text-align: center;
    padding: 20px;
    color: #777;
}

.loading {
    text-align: center;
    padding: 30px;
    color: #777;
    grid-column: 1 / -1;
}

/* Checkout Form Styles // ниже 0.6 ver */
.checkout-form {
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin: 15px 0;
    display: none; /* Сначала скрываем, покажем когда есть товары */
}

.cart-modal:not(.empty) .checkout-form {
    display: block; /* Показываем форму, если корзина не пуста */
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-size: 14px;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0925ff;
}

/* Сообщения об ошибках и успехе */
.alert {
    z-index: 10000;
    padding: 12px;
    border-radius: 4px;
    margin: 15px 0;
    text-align: center;
    position: relative;
}

.alert.success {
    background-color: #62aff3;
    color: #2d35d8;
    border: 1px solid #62aff3;
}

.alert.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert.error a {
    color: #721c24;
    text-decoration: underline;
}