@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Тёплый уютный фон — светлый беж/крем для аппетитного вида */
body {
    background: #fefaf4;
    color: #3c2f2a;
    min-height: 100vh;
}

/* Шапка — тёплый золотисто-коричневый градиент, как свежая корочка */
header {
    background: linear-gradient(135deg, #5c4033 0%, #8b5e3c 50%, #a67c52 100%);
    border-bottom: none;
    box-shadow: 0 6px 28px rgba(139, 94, 60, 0.35);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.2rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: #fffaf0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.45);
}

/* Десктопное меню */
.desktop-nav {
    display: flex;
    align-items: center;
    gap: 2.2rem;
}

.desktop-nav a {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffe8d6;
    text-decoration: none;
    transition: color 0.2s;
}

.desktop-nav a:hover {
    color: #fffaf0;
}

/* Бургер-кнопка */
.burger-btn {
    display: none;
    width: 40px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 1100;
}

.burger-btn span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 4px;
    background: #fffaf0;
    border-radius: 2px;
    transition: all 0.35s ease;
}

.burger-btn span:nth-child(1) { top: 0; }
.burger-btn span:nth-child(2) { top: 14px; }
.burger-btn span:nth-child(3) { top: 28px; }

.burger-btn.active span:nth-child(1) {
    transform: translateY(14px) rotate(45deg);
}

.burger-btn.active span:nth-child(2) {
    opacity: 0;
}

.burger-btn.active span:nth-child(3) {
    transform: translateY(-14px) rotate(-45deg);
}

/* Мобильное меню */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 340px;
    height: 100vh;
    background: #5c4033;
    box-shadow: -12px 0 40px rgba(0,0,0,0.5);
    transition: right 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    overflow-y: auto;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 3.5rem;
    background: none;
    border: none;
    color: #fffaf0;
    cursor: pointer;
}

.mobile-menu nav {
    padding: 7rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 2.2rem;
}

.mobile-menu a {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fffaf0;
    text-decoration: none;
}

/* Запрет скролла при открытом меню */
body.menu-open {
    overflow: hidden;
}

/* Основной контент */
main {
    max-width: 1400px;
    margin: 2.5rem auto;
    padding: 0 1.5rem;
}

/* Товары на главной */
.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.product-card {
    background: white;
    border-radius: 1.2rem;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(139, 94, 60, 0.15);
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 40px rgba(139, 94, 60, 0.25);
}

.product-image-container {
    aspect-ratio: 4/5;
    overflow: hidden;
    background: #f9f5f0;
}

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.product-card:hover .product-image-container img {
    transform: scale(1.09);
}

.product-info {
    padding: 1.6rem 1.8rem;
}

.product-name {
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
}

.product-desc {
    font-size: 1.05rem;
    color: #6b7280;
    margin-bottom: 1.2rem;
}

.product-price {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 1.3rem;
    color: #c2410c;
}

.add-to-cart-btn {
    width: 100%;
    background: #c2410c;
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 0.9rem;
    font-weight: 700;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0;
    transform: translateY(12px);
}

.product-card:hover .add-to-cart-btn {
    opacity: 1;
    transform: translateY(0);
    background: #ea580c;
}

/* Страница товара */
.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.product-big-image img {
    width: 100%;
    border-radius: 1.4rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.product-info-block h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.2rem;
}

.price-big {
    font-size: 3.2rem;
    font-weight: 900;
    color: #c2410c;
    margin-bottom: 1.8rem;
}

.description {
    font-size: 1.35rem;
    color: #4b5563;
    margin-bottom: 3rem;
}

.add-form {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.add-form label {
    font-weight: 600;
    font-size: 1.3rem;
}

.add-form input[type="number"] {
    width: 120px;
    padding: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.8rem;
    font-size: 1.4rem;
    text-align: center;
}

.add-form button {
    flex: 1;
    min-width: 260px;
    background: #c2410c;
    color: white;
    border: none;
    padding: 1.2rem 2rem;
    border-radius: 1rem;
    font-size: 1.35rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.add-form button:hover {
    background: #ea580c;
}

/* Корзина */
.cart-container {
    background: white;
    border-radius: 1.4rem;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.09);
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.25rem;
}

.cart-table th,
.cart-table td {
    padding: 1.6rem 2rem;
    text-align: left;
}

.cart-table th {
    background: #f9f5f0;
    font-weight: 700;
    color: #1f2937;
    font-size: 1.3rem;
}

.cart-thumbnail {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 12px;
}

.cart-item-name {
    font-weight: 800;
    font-size: 1.65rem;
    margin-bottom: 0.4rem;
}

.cart-item-desc {
    font-size: 1.15rem;
    color: #64748b;
    margin-top: 0.4rem;
}

.subtotal-cell {
    font-size: 1.7rem;
    font-weight: 800;
    color: #c2410c;
}

#cart-total {
    font-size: 3rem !important;
    font-weight: 900;
    color: #c2410c;
}

.quantity-control.compact {
    display: inline-flex;
    align-items: center;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 6px 12px;
    border: 1px solid #cbd5e1;
    user-select: none;
}

.qty-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: transparent;
    font-size: 2.2rem;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: scale(1.1);
}

.qty-display {
    min-width: 60px;
    text-align: center;
    font-size: 2.1rem;
    font-weight: 900;
    color: #111827;
    padding: 0 16px;
}

.remove-btn {
    background: none;
    border: none;
    padding: 0.6rem;
    cursor: pointer;
    color: #ef4444;
    border-radius: 0.6rem;
    transition: all 0.2s ease;
}

.remove-btn:hover {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.12);
    transform: scale(1.2);
}

.remove-btn svg {
    width: 28px;
    height: 28px;
}

.cart-actions {
    margin-top: 3rem;
    text-align: right;
}

.checkout-btn {
    background: #c2410c;
    color: white;
    padding: 1.3rem 3rem;
    border-radius: 1rem;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 800;
    display: inline-block;
    transition: all 0.2s;
}

.checkout-btn:hover {
    background: #ea580c;
    transform: translateY(-2px);
}

.empty-cart {
    text-align: center;
    color: #9ca3af;
    font-size: 2.2rem;
    font-weight: 600;
    margin: 8rem 0;
}

/* Checkout */
.checkout-options {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 800px;
}

.payment-method {
    background: white;
    border-radius: 1.4rem;
    padding: 2.5rem;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
}

.payment-method h3 {
    margin-bottom: 1.6rem;
    font-size: 1.8rem;
    font-weight: 700;
}

.payment-btn {
    width: 100%;
    padding: 1.4rem;
    background: #c2410c;
    color: white;
    border: none;
    border-radius: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.payment-btn:hover {
    background: #ea580c;
}

/* Медиа-запросы для мобильных */
@media (max-width: 900px) {
    main {
        padding: 0 1rem;
        margin: 1.5rem auto;
    }

    .desktop-nav {
        display: none;
    }

    .burger-btn {
        display: flex;
    }

    .products {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.5rem;
    }

    .product-detail-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .product-info-block h1 {
        font-size: 2.4rem;
    }

    .price-big {
        font-size: 2.8rem;
    }

    .add-form {
        flex-direction: column;
        align-items: stretch;
    }

    .add-form input[type="number"] {
        width: 100%;
    }

    .cart-table th,
    .cart-table td {
        padding: 1rem 1.2rem;
        font-size: 1.1rem;
    }

    .cart-thumbnail {
        width: 70px;
        height: 70px;
    }

    .qty-display {
        font-size: 1.9rem;
        min-width: 55px;
    }

    .qty-btn {
        width: 46px;
        height: 46px;
        font-size: 2.1rem;
    }

    #cart-total {
        font-size: 2.6rem !important;
    }

    .checkout-btn {
        width: 100%;
        padding: 1.2rem;
        font-size: 1.4rem;
    }

    h2 {
        font-size: 2.2rem;
    }
}

@media (max-width: 600px) {
    header h1 {
        font-size: 1.8rem;
        text-align: center;
    }

    .products {
        grid-template-columns: 1fr;
    }

    .cart-table {
        font-size: 1rem;
    }

    .cart-table th,
    .cart-table td {
        padding: 0.8rem 1rem;
    }

    .remove-btn svg {
        width: 26px;
        height: 26px;
    }
}

/* Поиск в шапке */
.search-form {
    max-width: 220px;
    width: 100%;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 10px;
    color: #6b7280;
    pointer-events: none;
    transition: color 0.2s;
}

.search-form input {
    width: 100%;
    padding: 0.7rem 0.9rem 0.7rem 2.8rem;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.2s;
    background: #f9f5f0;
}

.search-form input:focus {
    outline: none;
    border-color: #c2410c;
    box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.2);
    background: white;
}

/* Мобильный поиск — короче */
@media (max-width: 768px) {
    .search-form {
        max-width: 150px;
    }

    .search-form input {
        padding: 0.65rem 0.8rem 0.65rem 2.5rem;
        font-size: 0.95rem;
        border-radius: 8px;
    }

    .search-icon {
        left: 8px;
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 480px) {
    .search-form {
        max-width: 140px;
    }

    .search-form input {
        font-size: 0.9rem;
        padding-left: 2.3rem;
    }
}

/* Закреплённый поиск внизу */
.search-fixed {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 0.8rem 1rem;
    z-index: 1000;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
}

@media (max-width: 768px) {
    .search-fixed {
        display: block;
    }
}

.search-form {
    max-width: 100%;
    margin: 0 auto;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: #6b7280;
    pointer-events: none;
}

.search-form input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 3rem;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 1rem;
    background: #f9f5f0;
    transition: all 0.2s;
}

.search-form input:focus {
    outline: none;
    border-color: #c2410c;
    background: white;
    box-shadow: 0 0 0 3px rgba(194, 65, 12, 0.2);
}

@media (max-width: 480px) {
    .search-fixed {
        padding: 0.6rem 0.8rem;
    }

    .search-form input {
        padding: 0.7rem 0.9rem 0.7rem 2.8rem;
        font-size: 0.95rem;
    }

    .search-icon {
        left: 10px;
        width: 18px;
        height: 18px;
    }
}

.logo-link {
    color: #fffaf0;
    text-decoration: none;
    font-weight: 800;
    font-size: 2.2rem;
    transition: color 0.2s;
    text-shadow: 0 2px 8px rgba(0,0,0,0.45);
}

.logo-link:hover {
    color: #ffe8d6;
}

/* Панель сортировки/вида */
.sort-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.sort-select {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.sort-select label {
    font-weight: 600;
    color: #4b5563;
}

.sort-select select {
    padding: 0.6rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    font-size: 1rem;
    cursor: pointer;
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    width: 44px;
    height: 44px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.view-btn:hover {
    background: #e2e8f0;
}

.view-btn.active {
    background: #c2410c;
    color: white;
    border-color: #c2410c;
}

/* Контейнер товаров */
.products {
    display: grid;
    transition: all 0.3s ease;
}

.products.grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.products.list {
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.products.list .product-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 1rem;
    border-radius: 12px;
}

.products.list .product-image-container {
    width: 140px;
    height: 140px;
    margin-right: 1.5rem;
    flex-shrink: 0;
}

.products.list .product-info {
    flex: 1;
    padding: 0;
}

.products.list .add-to-cart-btn {
    width: auto;
    margin-top: 1rem;
}

.products.tile {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.2rem;
}

.products.tile .product-name {
    font-size: 1.2rem;
}

.products.tile .product-price {
    font-size: 1.4rem;
}

/* Мобильная адаптация видов */
@media (max-width: 768px) {
    .products.grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .products.grid .product-card {
        flex-direction: column;
        text-align: center;
    }

    .products.grid .product-image-container {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .products.tile {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }

    .products.tile .product-card {
        font-size: 0.9rem;
        padding: 0.8rem;
    }

    .products.tile .product-image-container {
        aspect-ratio: 1 / 1;
        height: auto;
    }

    .products.tile .product-name {
        font-size: 1rem;
        margin-bottom: 0.4rem;
    }

    .products.tile .product-desc {
        display: none;
    }

    .products.tile .product-price {
        font-size: 1.1rem;
    }

    .products.tile .add-to-cart-btn {
        font-size: 0.9rem;
        padding: 0.6rem;
    }

    .products.list {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .products.list .product-card {
        display: flex;
        flex-direction: row;
        align-items: center;
        padding: 0.8rem;
    }

    .products.list .product-image-container {
        width: 90px;
        height: 90px;
        margin-right: 1rem;
        flex-shrink: 0;
    }

    .products.list .product-info {
        flex: 1;
    }

    .products.list .product-name {
        font-size: 1.2rem;
    }

    .products.list .add-to-cart-btn {
        width: auto;
        margin-top: 0.5rem;
    }
}

/* Логотип */
.logo {
    display: flex;
    align-items: center;
    max-width: 400px;
    overflow: hidden;
}

.logo-img {
    height: 100px;
    width: auto;
    max-height: 130px;
    object-fit: contain;
    transition: transform 0.2s;
}

.logo a:hover .logo-img {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .logo {
        max-width: 250px;
    }

    .logo-img {
        height: 90px;
        max-height: 105px;
    }
}

/* Название магазина по центру */
.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.shop-title {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 800;
    color: #fffaf0;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0,0,0,0.45);
}

.shop-link {
    color: #fffaf0;
    text-decoration: none;
    transition: color 0.2s;
}

.shop-link:hover {
    color: #ffe8d6;
}

@media (max-width: 768px) {
    .shop-title {
        font-size: 1.8rem;
    }

    .header-center {
        flex: 0 1 auto;
    }
}
