:root {
    --primary-color: #ff69b4;
    --secondary-color: #4a4a4a;
    --background-color: #f9f9f9;
    --header-height: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    background: var(--background-color);
    color: var(--secondary-color);
    line-height: 1.6;
}

/* Шапка сайта */
.header {
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-top {
    background: var(--primary-color);
    color: white;
    padding: 5px 0;
    font-size: 14px;
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-contacts a {
    color: white;
    text-decoration: none;
    margin-right: 20px;
}

.header-main {
    padding: 15px 0;
}

.header-main .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.logo img {
    height: 50px;
}

/* Навигация */
.nav-menu {
    display: flex;
    list-style: none;
}

.nav-menu li {
    margin: 0 15px;
}

.nav-menu a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

/* Контейнер */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Основной контент */
.main {
    margin-top: var(--header-height);
    padding: 50px 0;
}

/* Категории на главной */
.categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.category-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.category-info {
    padding: 15px;
}

.category-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

/* Товары */
.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.product-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.product-info {
    padding: 15px;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.product-price {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
}

/* Стили для кнопки добавления в корзину */
.add-to-cart {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    font-size: 16px;
    margin-top: 10px;
    position: relative;
}

.add-to-cart:hover {
    background-color: #45a049;
}

/* Стили для кнопки, когда товар добавлен в корзину */
.add-to-cart.added-to-cart {
    background-color: #2E7D32;
    cursor: default;
    position: relative;
}

.add-to-cart.added-to-cart:hover {
    background-color: #2E7D32;
}

/* Стили для состояния загрузки */
.add-to-cart.loading {
    background-color: #808080;
    cursor: wait;
    pointer-events: none;
}

.add-to-cart.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

.add-to-cart.in-cart {
    background-color: #2196F3;
}

.add-to-cart.in-cart:hover {
    background-color: #1976D2;
}

.cart-icon {
    position: relative;
    font-size: 24px;
}

.cart-icon a {
    text-decoration: none;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #ff4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Подвал */
.footer {
    background: white;
    padding: 40px 0;
    margin-top: 50px;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.footer-section h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.footer-section p,
.footer-section a {
    color: var(--secondary-color);
    text-decoration: none;
    margin-bottom: 10px;
    display: block;
}

.footer-bottom {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.category-header {
    margin-bottom: 30px;
    text-align: center;
}

.category-header h1 {
    font-size: 32px;
    color: var(--secondary-color);
    margin-bottom: 15px;
    margin-top: 30px;
}

.category-description {
    color: #666;
    max-width: 800px;
    margin: 0 auto;
}

.product-image-wrapper {
    position: relative;
    padding-top: 100%; /* Соотношение сторон 1:1 */
    overflow: hidden;
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
    background: #f5f5f5; /* фон при отсутствии изображения */
}

.product-image[src=""] {
    display: none;
}

.product-image-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f5f5f5 url('/images/no-image.jpg') center/contain no-repeat;
    opacity: 0;
    transition: opacity 0.3s;
}

.product-image-wrapper:has(img[src=""])::after,
.product-image-wrapper:has(img:not([src]))::after {
    opacity: 1;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.product-info {
    padding: 20px;
    text-align: center;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 10px;
    height: 50px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 15px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .products {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
    
    .product-name {
        font-size: 14px;
        height: 34px;
    }
    
    .product-price {
        font-size: 20px;
    }
    
    .add-to-cart {
        padding: 10px;
        font-size: 14px;
    }
} 

/* Главный баннер */
.main-banner {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url('/images/banner.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 100px 20px;
    margin-bottom: 50px;
    margin-top: 30px;
    border-radius: 8px;
}

.main-banner h1 {
    font-size: 48px;
    margin-bottom: 20px;
}

.main-banner p {
    font-size: 24px;
    opacity: 0.9;
}

/* Секции */
.section {
    margin-bottom: 60px;
}

.section-title {
    font-size: 32px;
    color: var(--secondary-color);
    text-align: center;
    margin-bottom: 30px;
}

/* Преимущества */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.feature-item {
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.feature-item h3 {
    font-size: 20px;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.feature-item p {
    color: #666;
}

/* Адаптивность */
@media (max-width: 768px) {
    .main-banner {
        padding: 60px 20px;
    }
    
    .main-banner h1 {
        font-size: 32px;
    }
    
    .main-banner p {
        font-size: 18px;
    }
    
    .section-title {
        font-size: 24px;
    }
} 

/* Анимация счетчика корзины */
@keyframes cartCountUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.cart-count-update {
    animation: cartCountUpdate 0.3s ease-out;
}

/* Стили для состояний кнопки */
.add-to-cart:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.add-to-cart.success {
    background-color: #4CAF50;
}

.add-to-cart.error {
    background-color: #ff0000;
} 

/* Стили для корзины */
.cart-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin: 30px 0;
}

.cart-items {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 20px;
}

.cart-item {
    display: flex;
    padding: 20px;
    border-bottom: 1px solid #eee;
    position: relative;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 120px;
    height: 120px;
    margin-right: 20px;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.cart-item-details {
    flex: 1;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    align-items: center;
    gap: 20px;
}

.cart-item-name {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: var(--secondary-color);
}

.cart-item-price {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.quantity-btn:hover:not(:disabled) {
    background: #f5f5f5;
}

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cart-item-quantity input {
    width: 50px;
    text-align: center;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.cart-item-total {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary-color);
    text-align: right;
}

.remove-from-cart {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    margin-left: 20px;
    transition: color 0.3s ease;
}

.remove-from-cart:hover {
    color: #ff4444;
}

.cart-summary {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 20px;
    position: sticky;
    top: 20px;
}

.cart-summary h2 {
    font-size: 24px;
    color: var(--secondary-color);
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--secondary-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group textarea {
    height: 100px;
    resize: vertical;
}

.cart-totals {
    margin: 20px 0;
    padding: 20px 0;
    border-top: 1px solid #eee;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 16px;
    color: var(--secondary-color);
}

.total-row.grand-total {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.submit-order {
    width: 100%;
    padding: 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-order:hover {
    background-color: #ff4d94;
}

.empty-cart {
    text-align: center;
    padding: 50px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.empty-cart-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.empty-cart h2 {
    font-size: 24px;
    color: var(--secondary-color);
    margin-bottom: 10px;
}

.empty-cart p {
    color: #666;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .cart-content {
        grid-template-columns: 1fr;
    }

    .cart-item-details {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .cart-item-image {
        width: 80px;
        height: 80px;
    }

    .cart-item-total {
        text-align: left;
    }

    .remove-from-cart {
        position: absolute;
        top: 10px;
        right: 10px;
        margin: 0;
    }
}

.product-variation {
    width: 100%;
    padding: 8px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
    cursor: pointer;
}

.product-variation:focus {
    outline: none;
    border-color: var(--primary-color);
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 15px;
}

.header-search {
    flex: 1;
    margin: 0 20px;
}

.search-form {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
}

.search-form input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px 0 0 6px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.search-form input:focus {
    border-color: #4CAF50;
}

.search-form button {
    padding: 10px 20px;
    background: #4CAF50;
    border: none;
    border-radius: 0 6px 6px 0;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-form button:hover {
    background: #388E3C;
}

.search-results {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.search-results h1 {
    margin-bottom: 20px;
    color: #333;
}

.search-results .products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #666;
} 