/* Основные стили */
:root {
    --primary-color: #4a7fb5;
    --secondary-color: #2c3e50;
    --accent-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --text-color: #333;
    --border-color: #ddd;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #3498db;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-color);
    background-color: #f9f9f9;
}

.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.main {
    flex: 1;
    padding: 30px 0;
}

/* Типографика */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--dark-color);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
}

h5 {
    font-size: 1.25rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: var(--secondary-color);
}

/* Кнопки */
.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
}

.btn-primary {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #3a6fa5;
    border-color: #3a6fa5;
}

.btn-secondary {
    color: #fff;
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.btn-secondary:hover {
    background-color: #1c2e40;
    border-color: #1c2e40;
}

.btn-accent {
    color: #fff;
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.btn-accent:hover {
    background-color: #d73c2c;
    border-color: #d73c2c;
}

.btn-outline {
    color: var(--primary-color);
    background-color: transparent;
    border-color: var(--primary-color);
}

.btn-outline:hover {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-lg {
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
    line-height: 1.5;
    border-radius: 0.3rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.2rem;
}

.btn-block {
    display: block;
    width: 100%;
}

/* Формы */
.form-group {
    margin-bottom: 1rem;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-color);
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    color: var(--text-color);
    background-color: #fff;
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(74, 127, 181, 0.25);
}

/* Оповещения */
.alert {
    position: relative;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* Хлебные крошки */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    list-style: none;
    background-color: var(--light-color);
    border-radius: 0.25rem;
}

.breadcrumb-item + .breadcrumb-item {
    padding-left: 0.5rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    display: inline-block;
    padding-right: 0.5rem;
    color: #6c757d;
    content: "/";
}

/* Пагинация */
.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    border-radius: 0.25rem;
}

.pagination-item {
    margin: 0 0.2rem;
}

.pagination-link {
    display: block;
    padding: 0.5rem 0.75rem;
    line-height: 1.25;
    color: var(--primary-color);
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
}

.pagination-link:hover {
    color: var(--secondary-color);
    background-color: var(--light-color);
    border-color: var(--border-color);
}

.pagination-link.active {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination-link.disabled {
    color: #6c757d;
    pointer-events: none;
    cursor: auto;
    background-color: #fff;
    border-color: var(--border-color);
}

/* Шапка */
.header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header__top {
    display: flex;
    align-items: center;
    padding: 15px 0;
}

.header__logo {
    margin-right: 30px;
}

.header__logo img {
    max-height: 50px;
}

.header__search {
    flex: 1;
    margin-right: 30px;
}

.search-form {
    display: flex;
    position: relative;
}

.search-form__input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.search-form__button {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-search, .icon-cart {
    width: 18px;
    height: 18px;
}

.header__cart {
    position: relative;
}

.cart-link {
    display: flex;
    align-items: center;
    color: var(--text-color);
}

.cart-link__count {
    display: inline-block;
    min-width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
    background-color: var(--accent-color);
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    margin-left: 5px;
}

.header__bottom {
    border-top: 1px solid var(--border-color);
}

/* Текстовое меню */
.text-nav {
    display: flex;
    flex-wrap: wrap;
    padding: 10px 0;
    font-size: 0.9rem;
}

.text-nav__link {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
    padding: 5px 0;
}

.text-nav__link:hover {
    color: var(--primary-color);
}

.text-nav__separator {
    margin: 0 8px;
    color: #ccc;
    padding: 5px 0;
}

/* Подвал */
.footer {
    background-color: var(--secondary-color);
    color: #fff;
    padding: 40px 0 20px;
    margin-top: auto;
}

.footer__top {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px 30px;
}

.footer__column {
    flex: 1;
    min-width: 250px;
    padding: 0 15px;
    margin-bottom: 20px;
}

.footer__title {
    font-size: 1.25rem;
    margin-bottom: 15px;
    color: #fff;
}

.footer__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer__item {
    margin-bottom: 10px;
}

.footer__link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s;
}

.footer__link:hover {
    color: #fff;
}

.footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: center;
}

.footer__copyright {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
}

/* Cookie-уведомление */
.cookie-notification {
    position: fixed;
    bottom: -100%;
    right: 20px;
    max-width: 300px;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 15px;
    z-index: 9999;
    transition: bottom 0.3s ease-in-out;
}

.cookie-notification.show {
    bottom: 20px;
}

.cookie-notification__content {
    font-size: 0.875rem;
}

.cookie-notification__content p {
    margin-bottom: 10px;
}

/* Карточки товаров */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.product-card {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.product-card__image {
    position: relative;
    padding-top: 75%;
    overflow: hidden;
}

.product-card__image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.product-card__content {
    padding: 15px;
}

.product-card__title {
    font-size: 1rem;
    margin-bottom: 10px;
    height: 3em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-card__price {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.product-card__current-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark-color);
}

.product-card__old-price {
    font-size: 0.875rem;
    color: #999;
    text-decoration: line-through;
    margin-left: 10px;
}

.product-card__actions {
    display: flex;
    gap: 10px;
}

/* Детальная страница товара */
.product-detail {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.product-detail__gallery {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 15px;
    margin-bottom: 30px;
}

.product-detail__image {
    width: 100%;
    border-radius: 4px;
    overflow: hidden;
}

.product-detail__image img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.product-detail__info {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 15px;
    margin-bottom: 30px;
}

.product-detail__title {
    font-size: 1.75rem;
    margin-bottom: 15px;
}

.product-detail__price {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.product-detail__current-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
}

.product-detail__old-price {
    font-size: 1rem;
    color: #999;
    text-decoration: line-through;
    margin-left: 15px;
}

.product-detail__vendor {
    margin-bottom: 20px;
}

.product-detail__actions {
    margin-bottom: 30px;
}

.product-detail__buy-btn {
    margin-right: 10px;
}

.product-detail__description {
    margin-bottom: 30px;
}

.product-detail__params {
    margin-bottom: 30px;
}

.product-detail__params-title {
    font-size: 1.25rem;
    margin-bottom: 15px;
}

.params-table {
    width: 100%;
    border-collapse: collapse;
}

.params-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
}

.params-table tr:last-child td {
    border-bottom: none;
}

.params-table td:first-child {
    font-weight: 700;
    width: 40%;
}

/* Корзина */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.cart-table th,
.cart-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.cart-table th {
    background-color: var(--light-color);
    font-weight: 700;
}

.cart-item__image {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.cart-item__title {
    font-weight: 700;
}

.cart-item__quantity {
    display: flex;
    align-items: center;
}

.cart-item__quantity-input {
    width: 60px;
    text-align: center;
    margin: 0 10px;
}

.cart-item__quantity-btn {
    width: 30px;
    height: 30px;
    background-color: var(--light-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
}

.cart-item__remove {
    color: var(--danger-color);
    background: none;
    border: none;
    cursor: pointer;
}

.cart-summary {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 30px;
}

.cart-summary__title {
    font-size: 1.25rem;
    margin-bottom: 15px;
}

.cart-summary__row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.cart-summary__total {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.cart-actions {
    display: flex;
    justify-content: space-between;
}

/* Категории */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.category-card {
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.category-card__image {
    position: relative;
    padding-top: 75%;
    background-color: var(--light-color);
}

.category-card__image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-card__content {
    padding: 15px;
}

.category-card__title {
    font-size: 1rem;
    margin-bottom: 5px;
    text-align: center;
}

.category-card__count {
    font-size: 0.875rem;
    color: #999;
    text-align: center;
}

/* Подкатегории на главной */
.subcategories-list {
    margin-bottom: 30px;
}

.subcategories-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 15px;
    justify-content: flex-start;
}

.subcategory-item {
    display: flex;
    align-items: center;
    background-color: #fff;
    border-radius: 4px;
    padding: 10px 15px;
    margin-right: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    min-width: 200px;
}

.subcategory-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    color: var(--primary-color);
}

.subcategory-icon {
    width: 16px;
    height: 16px;
    margin-right: 10px;
    fill: var(--primary-color);
}

.subcategory-name {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Адаптивность */
@media (max-width: 991px) {
    .product-detail__gallery,
    .product-detail__info {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .footer__column {
        flex: 0 0 50%;
    }
}

@media (max-width: 767px) {
    .header__top {
        flex-wrap: wrap;
    }
    
    .header__logo {
        margin-right: 0;
        margin-bottom: 15px;
        width: 100%;
        text-align: center;
    }
    
    .text-nav {
        justify-content: center;
        font-size: 0.8rem;
    }
    
    .text-nav__link {
        padding: 3px 0;
    }
    
    .text-nav__separator {
        margin: 0 5px;
        padding: 3px 0;
    }
    
    .cart-table thead {
        display: none;
    }
    
    .cart-table tbody tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid var(--border-color);
        border-radius: 4px;
    }
    
    .cart-table td {
        display: block;
        text-align: right;
        padding: 10px;
        border-bottom: 1px solid var(--border-color);
    }
    
    .cart-table td:last-child {
        border-bottom: none;
    }
    
    .cart-table td::before {
        content: attr(data-label);
        float: left;
        font-weight: 700;
    }
    
    .cart-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .footer__column {
        flex: 0 0 100%;
    }
}

@media (max-width: 575px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
}