/* Сброс стилей */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2d5016;
    --secondary: #8b4513;
    --cream: #fdf5e6;
    --light-green: #90a955;
    --dark: #1a1a1a;
    --light: #ffffff;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--cream);
    color: var(--dark);
    line-height: 1.6;
}

h1, h2, h3 {
    font-family: 'Playfair Display', serif;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Flash Messages */
.flash-messages {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
}

.flash {
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    animation: slideIn 0.3s ease;
}

.flash.success {
    background: #4CAF50;
    color: white;
}

.flash.error {
    background: #f44336;
    color: white;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Header */
header {
    background: var(--primary);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--light);
    text-decoration: none;
}

.search-form {
    display: flex;
    gap: 0;
    flex: 1;
    max-width: 400px;
}

.search-input {
    flex: 1;
    padding: 0.7rem 1rem;
    border: none;
    border-radius: 25px 0 0 25px;
    font-size: 1rem;
    outline: none;
}

.search-btn {
    padding: 0.7rem 1.2rem;
    border: none;
    background: var(--light-green);
    border-radius: 0 25px 25px 0;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.3s;
}

.search-btn:hover {
    background: var(--secondary);
}

nav a {
    color: var(--light);
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--light-green);
}

.admin-link {
    color: #ffd700 !important;
}

/* Hero */
.hero {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)),
                url('/static/images/main_foto.jpg');
    background-size: cover;
    background-position: center;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--light);
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
}

/* Categories Section */
.categories-section {
    padding: 4rem 0;
    background: white;
}

.categories-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--primary);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: var(--cream);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    text-decoration: none;
    color: var(--dark);
    transition: transform 0.3s, box-shadow 0.3s;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.cat-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.category-card h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.category-card p {
    color: #666;
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--secondary);
    color: var(--light);
    text-decoration: none;
    border-radius: 30px;
    font-weight: 700;
    transition: transform 0.3s, background 0.3s;
}

.btn:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

.btn-small {
    padding: 0.5rem 1rem;
    background: var(--secondary);
    color: var(--light);
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
}

.btn-large {
    padding: 1rem 2.5rem;
    background: var(--secondary);
    color: var(--light);
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-large:hover {
    background: var(--primary);
    transform: scale(1.05);
}

/* Products */
.products-section {
    padding: 4rem 0;
}

.products-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--primary);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background: var(--light);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.product-card:hover {
    transform: translateY(-10px);
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-info {
    padding: 1.5rem;
}

.category {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: var(--light-green);
    color: var(--light);
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.product-info h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.short-desc {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--secondary);
}

/* Search */
.search-section {
    padding: 3rem 0;
    min-height: 60vh;
}

.search-info {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: #666;
}

.no-results {
    text-align: center;
    padding: 3rem;
}

.no-results p {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #666;
}

/* Product Detail */
.product-detail {
    padding: 3rem 0;
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.product-detail img {
    width: 100%;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.category-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--light-green);
    color: var(--light);
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.product-detail-info h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.product-detail-info .description {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 1rem;
}

.detailed-desc {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.detailed-desc h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.detailed-desc p {
    color: #555;
    line-height: 1.8;
}

.price-detail {
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 1.5rem;
}

.product-meta {
    background: var(--cream);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.meta-item {
    display: flex;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.meta-item:last-child {
    border-bottom: none;
}

.meta-label {
    font-weight: 600;
    width: 200px;
    color: #333;
}

.meta-value {
    color: #666;
}

.quantity-selector {
    margin-bottom: 1.5rem;
}

.quantity-selector label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.quantity-selector input {
    padding: 0.5rem;
    width: 80px;
    font-size: 1rem;
    border: 2px solid var(--light-green);
    border-radius: 5px;
}

.related-products {
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 1px solid #eee;
}

.related-products h2 {
    margin-bottom: 2rem;
    color: var(--primary);
}

.back-link {
    display: inline-block;
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
    margin-top: 2rem;
}

/* Footer */
footer {
    background: var(--primary);
    color: var(--light);
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .search-form {
        width: 100%;
        max-width: 100%;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .product-detail-grid {
        grid-template-columns: 1fr;
    }

    .meta-item {
        flex-direction: column;
    }

    .meta-label {
        width: 100%;
        margin-bottom: 0.2rem;
    }
}