/* reset & базовые настройки */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #fafafa;
    color: #1e1e1e;
    line-height: 1.5;
    padding: 2rem 1.5rem;
    max-width: 100%;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
}

.logo {
    font-size: 28px;
    color: #540111
}

/* навигация — минималистичная */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0 2rem 0;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.nav .phone,
.nav .email {
    font-weight: 500;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    color: #111;
    text-decoration: none;
    background-repeat: no-repeat;
    background-position: 0 center;
    padding-left: 42px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg version='1.1' id='Layer_1' fill='%23540111' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 512 512' tyle='enable-background:new 0 0 512 512;' xml:space='preserve'%3E%3Cg%3E%3Cg%3E%3Cpath d='M436.992,74.953c-99.989-99.959-262.08-99.935-362.039,0.055s-99.935,262.08,0.055,362.039s262.08,99.935,362.039-0.055 c48.006-48.021,74.968-113.146,74.953-181.047C511.986,188.055,485.005,122.951,436.992,74.953z M387.703,356.605 c-0.011,0.011-0.022,0.023-0.034,0.034v-0.085l-12.971,12.885c-16.775,16.987-41.206,23.976-64.427,18.432 c-23.395-6.262-45.635-16.23-65.877-29.525c-18.806-12.019-36.234-26.069-51.968-41.899 c-14.477-14.371-27.483-30.151-38.827-47.104c-12.408-18.242-22.229-38.114-29.184-59.051 c-7.973-24.596-1.366-51.585,17.067-69.717l15.189-15.189c4.223-4.242,11.085-4.257,15.326-0.034 c0.011,0.011,0.023,0.022,0.034,0.034l47.957,47.957c4.242,4.223,4.257,11.085,0.034,15.326c-0.011,0.011-0.022,0.022-0.034,0.034 l-28.16,28.16c-8.08,7.992-9.096,20.692-2.389,29.867c10.185,13.978,21.456,27.131,33.707,39.339 c13.659,13.718,28.508,26.197,44.373,37.291c9.167,6.394,21.595,5.316,29.525-2.56l27.221-27.648 c4.223-4.242,11.085-4.257,15.326-0.034c0.011,0.011,0.022,0.022,0.034,0.034l48.043,48.128 C391.911,345.502,391.926,352.363,387.703,356.605z'/%3E%3C/g%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3Cg%3E%3C/g%3E%3C/svg%3E%0A");
}

.nav .email {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' width='36' height='36' viewBox='0 0 36 36' xml:space='preserve'%3E%3Cg style='stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: none; fill-rule: nonzero; opacity: 1;' transform='translate(0.1978021978021978 0.1978021978021978) scale(0.3956043956043956 0.3956043956043956)'%3E%3Ccircle cx='45' cy='45' r='45' style='stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: %23540111; fill-rule: nonzero; opacity: 1;' transform=' matrix(1 0 0 1 0 0) '/%3E%3Cpath d='M 45 42.66 l 22.511 -7.647 v -3.028 c 0 -1.8 -1.46 -3.26 -3.26 -3.26 H 25.749 c -1.8 0 -3.26 1.46 -3.26 3.26 v 3.028 L 45 42.66 z' style='stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1;' transform=' matrix(1 0 0 1 0 0) ' stroke-linecap='round'/%3E%3Cpath d='M 45 47.34 l -22.511 -7.647 v 18.323 c 0 1.8 1.46 3.26 3.26 3.26 h 38.501 c 1.8 0 3.26 -1.46 3.26 -3.26 V 39.692 L 45 47.34 z' style='stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(255,255,255); fill-rule: nonzero; opacity: 1;' transform=' matrix(1 0 0 1 0 0) ' stroke-linecap='round'/%3E%3C/g%3E%3C/svg%3E");
}

.logo span {
    font-weight: 300;
    color: #666;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    font-size: 0.95rem;
    flex-wrap: wrap;
}

.nav-links a {
    text-decoration: none;
    color: #222;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
    padding-bottom: 0.2rem;
    white-space: nowrap;
    color: #540111;
}

.nav-links a:hover {
    border-bottom-color: #540111;
}

.nav-links a.active {
    border-bottom-color: #540111;
    font-weight: 500;
}

/* Главная страница */
.main-content {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 20px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.main-content h1 {
    font-weight: 500;
    font-size: 2rem;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    color: #111;
}

.main-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

/* сетка товаров (каталог) */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 2rem 1.5rem;
    margin: 2.5rem 0 3rem;
    width: 100%;
    max-width: 100%;
}

.category-title {
    font-size: 1.6rem;
    font-weight: 500;
    margin: 2rem 0 1.5rem 0;
    color: #540111;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0.5rem;
}

.category-filter {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.category-filter .filter-btn {
    padding: 0.4rem 1.2rem;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.category-filter .filter-btn:hover {
    background: #f5f5f5;
}

.category-filter .filter-btn.active {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

.category-section {
    display: block;
}

.category-section.hidden {
    display: none;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.product-card {
    background: white;
    border-radius: 20px;
    padding: 1.5rem 1rem 1.8rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.02), 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: transform 0.15s ease, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    border: 1px solid #f0f0f0;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.04);
    border-color: #ddd;
}

.product-image {
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    font-weight: 300;
    color: #333;
    transition: background 0.2s;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.product-title {
    font-weight: 500;
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
    letter-spacing: -0.01em;
    color: #540111;
}

.product-desc {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

.product-price {
    font-weight: 500;
    font-size: 1.2rem;
    margin-top: auto;
    padding-top: 0.6rem;
    border-top: 1px solid #eee;
    letter-spacing: -0.01em;
}

.product-price small {
    font-weight: 400;
    font-size: 0.75rem;
    color: #888;
    margin-left: 0.3rem;
}

/* детальная страница товара */
.product-detail {
    background: white;
    border-radius: 20px;
    padding: 1.5rem 1rem 1.8rem;
    margin: 1.5rem 0 3rem;
    border: 1px solid #f0f0f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.detail-image {
    flex: 1 1 280px;
    border-radius: 24px;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: 300;
    color: #2a2a2a;
    min-height: 200px;
    overflow: hidden;
    width: 100%;
}

.detail-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.detail-info {
    flex: 2 1 340px;
    display: flex;
    flex-direction: column;
}

.detail-info h1 {
    font-weight: 500;
    font-size: 2rem;
    letter-spacing: -0.02em;
    margin-bottom: 0.4rem;
    color: #540111;
}

.detail-info .sub {
    color: #555;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #ececec;
    padding-bottom: 1rem;
}

.detail-price {
    font-size: 2rem;
    font-weight: 500;
    margin: 0.5rem 0 1.2rem;
}

.detail-price small {
    font-size: 1rem;
    font-weight: 400;
    color: #777;
    margin-left: 0.5rem;
}

.cheaper a {
    font-weight: bold;
    color: #F00;
    text-decoration: none;
}

.detail-description {
    color: #333;
    font-size: 1rem;
    line-height: 1.6;
    margin: 1rem 0 1.8rem;
}

.btn {
    background: #111;
    color: white;
    border: none;
    padding: 0.9rem 2.4rem;
    border-radius: 60px;
    font-size: 1rem;
    font-weight: 500;
    cursor: default;
    transition: background 0.2s;
    align-self: flex-start;
    letter-spacing: 0.01em;
    background: #1a1a1a;
    text-decoration: none;
}

.btn:hover {
    background: #2e2e2e;
}

.back-link {
    display: inline-block;
    margin: 2rem 0 1rem;
    text-decoration: none;
    color: #444;
    border-bottom: 1px solid #ccc;
    padding-bottom: 0.2rem;
    transition: border-color 0.15s;
    cursor: pointer;
}

.back-link:hover {
    border-bottom-color: #111;
}

/* разделитель и футер */
.section-label {
    font-size: 1.1rem;
    font-weight: 400;
    color: #555;
    letter-spacing: -0.01em;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #e4e4e4;
    margin-top: 1.2rem;
}

hr {
    border: 0;
    border-top: 1px solid #eaeaea;
    margin: 3rem 0 1.5rem;
}

.footer {
    font-size: 0.8rem;
    color: #888;
    text-align: center;
    padding: 1.5rem 0 0.5rem;
    border-top: 1px solid #ececec;
    margin-top: 2rem;
}

.no-products {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 1.1rem;
}

/* Управление видимостью страниц */
.page {
    display: none;
}

/* По умолчанию показываем главную страницу */
.page#main {
    display: block;
}

/* Показываем страницу при наличии класса active */
.page.active {
    display: block !important;
}

/* Скрываем главную страницу, если активна другая */
.page#main.active ~ .page#main {
    display: none;
}

/* Скрываем главную страницу, когда активен каталог или товар */
.page#catalog.active ~ .page#main {
    display: none;
}

.page[id^="product-"].active ~ .page#main {
    display: none;
}

/* Также скрываем главную, если она неактивна и есть активная другая страница */
body:has(.page.active:not(#main)) .page#main:not(.active) {
    display: none;
}

/* адаптив для мобильных устройств */
@media (max-width: 640px) {
    body { 
        padding: 1rem; 
    }
    
    .nav { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 0.8rem; 
        padding: 0.5rem 0 1.5rem 0;
    }
    
    .nav-links { 
        gap: 0.8rem;
        font-size: 0.85rem;
        width: 100%;
    }
    
    .nav-links a {
        white-space: nowrap;
        font-size: 0.85rem;
        padding: 0.2rem 0;
    }
    
    .logo {
        font-size: 2rem;
    }

    .main-content {
        padding: 1.5rem;
        margin: 1rem auto;
    }

    .main-content h1 {
        font-size: 1.6rem;
    }

    .main-text {
        font-size: 1rem;
        line-height: 1.6;
    }

    .category-title {
        font-size: 1.3rem;
        margin: 1.5rem 0 1rem 0;
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }
    
    .product-card {
        padding: 1rem 0.8rem 1.2rem;
        border-radius: 16px;
    }
    
    .product-title {
        font-size: 0.95rem;
    }
    
    .product-desc {
        font-size: 0.8rem;
    }
    
    .product-price {
        font-size: 1rem;
    }
    
    .product-price small {
        font-size: 0.7rem;
    }
    
    .product-image {
        border-radius: 12px;
        margin-bottom: 0.8rem;
    }

    .detail-info h1 { 
        font-size: 1.6rem; 
    }
    
    .detail-price {
        font-size: 1.6rem;
    }
    
    .detail-price small {
        font-size: 0.85rem;
    }
    
    .product-detail {
        padding: 1rem 0.8rem 1.2rem;
        gap: 1.5rem;
        border-radius: 16px;
    }
    
    .detail-image {
        min-height: 150px;
        border-radius: 16px;
        flex: 1 1 200px;
    }
    
    .detail-info {
        flex: 1 1 200px;
    }
    
    .detail-description {
        font-size: 0.95rem;
    }
    
    .btn {
        padding: 0.7rem 1.8rem;
        font-size: 0.9rem;
    }
    
    .back-link {
        margin: 1rem 0 0.5rem;
        font-size: 0.9rem;
    }
    
    .footer {
        font-size: 0.7rem;
        padding: 1rem 0 0.3rem;
        margin-top: 1.5rem;
    }
}

/* адаптив для очень маленьких экранов */
@media (max-width: 400px) {
    .category-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }
    
    .product-card {
        padding: 0.8rem 0.6rem 1rem;
    }
    
    .product-title {
        font-size: 0.85rem;
    }
    
    .product-desc {
        font-size: 0.7rem;
    }
    
    .product-price {
        font-size: 0.9rem;
    }
}

/* чтобы ссылки вели на якоря, и страницы переключались */
.catalog-link, .product-link {
    cursor: pointer;
}

/* дополнительные стили для имитации */
.note {
    background: #f5f5f5;
    border-radius: 40px;
    padding: 0.2rem 1.2rem;
    font-size: 0.7rem;
    color: #777;
    display: inline-block;
    margin-top: 0.25rem;
}

/* Страница контактов */
.contacts-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 0;
}

.contacts-content h1 {
    font-size: 32px;
    color: #1a1a1a;
    margin-bottom: 30px;
    text-align: center;
}

.contacts-info {
    background: #f8f8f8;
    border-radius: 12px;
    padding: 30px 40px;
    margin-bottom: 30px;
}

.contact-item {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #e8e8e8;
}

.contact-item:last-child {
    border-bottom: none;
}

.contact-label {
    font-weight: 600;
    min-width: 140px;
    color: #333;
}

.contact-value {
    color: #555;
}

.contact-value a {
    color: #540111;
    text-decoration: none;
}

.contact-value a:hover {
    text-decoration: underline;
}

.contact-map {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Скрытие категорий на странице контактов */
.category-section.hidden {
    display: none;
}

/* Адаптив для контактов */
@media (max-width: 768px) {
    .contact-item {
        flex-direction: column;
        padding: 8px 0;
    }
    
    .contact-label {
        min-width: auto;
        margin-bottom: 4px;
    }
    
    .contacts-info {
        padding: 20px;
    }
    
    .contacts-content h1 {
        font-size: 24px;
    }
}