/* Общие стили для всего сайта */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Цветовая палитра в серых тонах */
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #7f8c8d;
    --light-gray: #ecf0f1;
    --medium-gray: #bdc3c7;
    --dark-gray: #95a5a6;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --white: #ffffff;
    --border-color: #d5dbdb;
    --shadow: rgba(44, 62, 80, 0.1);
    --shadow-hover: rgba(44, 62, 80, 0.2);
    
    /* Размеры */
    --container-max-width: 1700px;
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* SVG иконки */
.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: middle;
}

.icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Заголовки */
h1, h2, h3, h4, h5, h6 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
    font-weight: 600;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Кнопки */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-hover);
}

.btn-secondary {
    background-color: var(--accent-color);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: var(--dark-gray);
    transform: translateY(-2px);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
}

/* Хедер */
.header {
    background-color: var(--white);
    box-shadow: 0 2px 10px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.logo h1 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin: 0;
}

.logo a {
    display: block;
    text-decoration: none;
}

.logo-img {
    height: 33px;
    width: auto;
    transition: var(--transition);
}

/* .logo-img:hover {
    transform: scale(1.05);
} */

.nav-list {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-list a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-list a:hover,
.nav-list a.active {
    color: var(--primary-color);
}

.nav-list a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-color);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-btn:hover {
    background-color: var(--light-gray);
}

.cart-icon {
    width: 1.5rem;
    height: 1.5rem;
    display: inline-block;
}

.cart-icon svg {
    width: 100%;
    height: 100%;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Футер */
.footer {
    background-color: var(--primary-color);
    color: var(--white);
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 3rem 0;
}

.footer-section h3,
.footer-section h4 {
    color: var(--white);
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--light-gray);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--white);
}

.footer-logo {
    display: inline-block;
    text-decoration: none;
    margin-bottom: 1rem;
}

.footer-logo-img {
    height: 33px;
    width: auto;
    transition: var(--transition);
}

/* .footer-logo-img:hover {
    transform: scale(1.05);
} */

.footer-bottom {
    border-top: 1px solid var(--secondary-color);
    padding: 1rem 0;
    text-align: center;
    color: var(--light-gray);
}

/* Хлебные крошки */
.breadcrumbs {
    padding: 1rem 0;
    font-size: 0.9rem;
}

.breadcrumbs a {
    color: var(--text-light);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumbs a:hover {
    color: var(--primary-color);
}

.breadcrumbs .separator {
    margin: 0 0.5rem;
    color: var(--medium-gray);
}

/* Сетка товаров */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.product-card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow-hover);
}

.product-image {
    width: 100%;
    height: 200px;
    /* background-color: var(--light-gray); */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--medium-gray);
    position: relative;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-info {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-bottom {
    margin-top: auto;
}

.product-price {
    margin-bottom: 1rem;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.product-category {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.product-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.current-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.old-price {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-light);
    text-decoration: line-through;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.stars {
    display: flex;
    gap: 2px;
}

.star {
    color: var(--medium-gray);
    font-size: 1rem;
}

.star.filled {
    color: #f39c12;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.pagination button {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    background-color: var(--white);
    color: var(--text-dark);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.pagination button:hover:not(:disabled) {
    background-color: var(--light-gray);
}

.pagination button.active {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Burger Menu Styles */
.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    z-index: 1001;
}

.burger-menu:hover {
    background-color: var(--light-gray);
}

.burger-line {
    width: 24px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 2px 0;
    transition: var(--transition);
    border-radius: 2px;
}

/* Burger menu animation when active */
.burger-menu.active .burger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.burger-menu.active .burger-line:nth-child(2) {
    opacity: 0;
}

.burger-menu.active .burger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Navigation Overlay */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile Navigation */
@media (max-width: 768px) {
    .burger-menu {
        display: flex;
        order: 3;
        margin-left: 1rem;
    }
    
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        position: relative;
    }
    
    .logo {
        order: 1;
    }
    
    .header-actions {
        order: 2;
    }
    
    .nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        height: 100vh;
        background-color: var(--white);
        z-index: 1000;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: -2px 0 10px var(--shadow);
    }
    
    .nav.active {
        transform: translateX(0);
    }
    
    .nav-list {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
        width: 100%;
        padding: 2rem;
    }
    
    .nav-list a {
        font-size: 1.2rem;
        font-weight: 600;
        color: var(--primary-color);
        text-decoration: none;
        padding: 1rem;
        border-radius: var(--border-radius);
        transition: var(--transition);
        display: block;
        width: 100%;
    }
    
    .nav-list a:hover,
    .nav-list a.active {
        background-color: var(--light-gray);
        color: var(--primary-color);
    }
    
    .nav-list a.active::after {
        display: none;
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* Модальное окно корзины */
.cart-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.cart-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-modal-content {
    background-color: var(--white);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.cart-header h2 {
    margin: 0;
    color: var(--primary-color);
}

.cart-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-close:hover {
    background-color: var(--light-gray);
    color: var(--primary-color);
}

.cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 60px;
    height: 60px;
    background-color: var(--light-gray);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--medium-gray);
    flex-shrink: 0;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    color: var(--text-light);
    font-size: 0.9rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.quantity-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-dark);
    transition: var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background-color: var(--light-gray);
}

.quantity-input {
    border: none;
    width: 50px;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.9rem;
    background: transparent;
}

.cart-item-total {
    font-weight: 600;
    color: var(--primary-color);
    min-width: 80px;
    text-align: right;
}

.cart-item-remove {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-remove:hover {
    background-color: #ffebee;
    color: #e74c3c;
}

.cart-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.cart-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.cart-footer {
    border-top: 1px solid var(--border-color);
    padding: 1.5rem;
    background-color: var(--light-gray);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.total-label {
    color: var(--text-dark);
}

.total-amount {
    color: var(--primary-color);
}

.cart-actions {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.cart-actions .btn {
    flex: 1;
}

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Адаптивность для корзины */
@media (max-width: 768px) {
    .cart-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .cart-item-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .cart-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .btn-large {
        padding: 12px 24px;
        font-size: 1rem;
    }
    
    .cart-item-image {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .cart-item-name {
        font-size: 0.9rem;
    }
}
