﻿/* ============================================
   CATALOG-PAGES.CSS — каталог и карточка товара
   Подключать на: Catalog/Index, Catalog/Category,
   Catalog/Product
   ============================================ */

/* ===== КАТАЛОГ: КОНТЕЙНЕР (старое определение) ===== */
.catalog-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    margin: 30px auto;
    max-width: 1200px;
    padding: 0 40px;
}

/* ===== LEGACY: СТАРОЕ БОКОВОЕ МЕНЮ =====
   Если Ctrl+F по solution не найдёт 'category-menu',
   'category-link-menu', 'cat-count', 'catalog-main',
   'add-to-cart' — удали этот блок целиком. */
.catalog-sidebar h3 {
    color: #1d3557;
    margin-bottom: 15px;
}

.category-menu {
    list-style: none;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

    .category-menu li {
        border-bottom: 1px solid #f0f0f0;
    }

.category-link-menu {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    text-decoration: none;
    color: #333;
    gap: 12px;
    transition: all 0.3s;
}

    .category-link-menu:hover {
        background: #f5f7fa;
    }

    .category-link-menu.active {
        background: #1d3557;
        color: #fff;
    }

.cat-icon {
    font-size: 1.4rem;
}

.category-link-menu span:nth-child(2) {
    flex-grow: 1;
    font-weight: 500;
}

.cat-count {
    background: rgba(230,57,70,0.1);
    color: #e63946;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
}

.category-link-menu.active .cat-count {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.catalog-main h1 {
    color: #1d3557;
    margin-bottom: 10px;
}

.catalog-count {
    color: #666;
    margin-bottom: 25px;
}
/* ===== END LEGACY ===== */

/* ===== КАТАЛОГ: НОВАЯ ВЕРСИЯ ===== */
.catalog-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.catalog-header {
    margin-bottom: 30px;
}

    .catalog-header h1 {
        font-size: 2rem;
        font-weight: 800;
        color: #000;
        margin-bottom: 10px;
    }

.catalog-subtitle {
    color: #666;
    font-size: 1rem;
}

.catalog-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}

/* Боковое меню категорий */
.catalog-sidebar {
    position: sticky;
    top: 20px;
    align-self: start;
}

.categories-block {
    background: #fff;
    border: 2px solid #000;
    border-radius: 12px;
    padding: 20px;
}

    .categories-block h3 {
        font-size: 1.2rem;
        font-weight: 800;
        margin-bottom: 15px;
        padding-bottom: 10px;
        border-bottom: 2px solid #FFE733;
    }

.categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .categories-list li {
        margin-bottom: 5px;
    }

/* Сайдбарная версия category-link (карточная — в home.css) */
.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #f8f8f8;
    border-radius: 8px;
    text-decoration: none;
    color: #000;
    transition: all 0.3s;
    font-weight: 600;
}

    .category-link:hover {
        background: #FFE733;
        transform: translateX(5px);
    }

    .category-link.active {
        background: #000;
        color: #FFE733;
    }

.category-count {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 700;
}

.category-link.active .category-count {
    background: rgba(255, 232, 31, 0.2);
}

/* ===== ГЛАВНАЯ СТРАНИЦА КАТАЛОГА ===== */
.catalog-home-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
}

    .catalog-home-container .catalog-header h1,
    .catalog-header h1 {
        font-size: 2.5rem;
        font-weight: 800;
        color: #000;
        margin-bottom: 40px;
        padding-bottom: 15px;
        border-bottom: 3px solid #FFE733;
    }

.catalog-grid {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

/* Основные категории */
.main-categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.category-card-main {
    background: #fff;
    border: 2px solid #f0f0f0;
    border-radius: 16px;
    padding: 30px;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    min-height: 250px;
}

    .category-card-main:hover {
        border-color: #000;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
        transform: translateY(-4px);
    }

.category-card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.category-card-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #000;
    margin-bottom: 15px;
    line-height: 1.3;
}

.category-card-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 15px;
    flex: 1;
}

.category-card-count {
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.category-card-btn {
    display: inline-block;
    padding: 12px 25px;
    background: #f8f8f8;
    color: #000;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.3s;
    border-bottom: 3px solid #FFE733;
}

    .category-card-btn:hover {
        background: #FFE733;
        transform: translateX(5px);
    }

/* Прочие товары (чёрная карточка) */
.other-categories-card {
    background: #000;
    border-radius: 16px;
    padding: 30px;
    color: #fff;
    height: fit-content;
}

.other-categories-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #FFE733;
}

.other-categories-list {
    list-style: none;
    padding: 0;
    margin: 0 0 25px 0;
}

.other-category-item {
    margin-bottom: 10px;
}

.other-category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 0.95rem;
}

    .other-category-link:hover {
        background: rgba(255, 232, 31, 0.2);
        transform: translateX(5px);
    }

.other-category-count {
    color: #FFE733;
    font-weight: 700;
    font-size: 0.85rem;
}

.other-categories-btn {
    display: inline-block;
    width: 100%;
    padding: 15px 25px;
    background: #FFE733;
    color: #000;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 800;
    font-family: 'Montserrat', sans-serif;
    text-align: center;
    transition: all 0.3s;
}

    .other-categories-btn:hover {
        background: #fff;
        transform: translateY(-2px);
        box-shadow: 0 5px 20px rgba(255, 232, 31, 0.4);
    }

/* ===== ПУСТОЙ КАТАЛОГ ===== */
.empty-catalog {
    background: #fff;
    border: 2px solid #f0f0f0;
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    max-width: 600px;
    margin: 40px auto;
}

.empty-catalog-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-catalog-title {
    font-size: 2rem;
    font-weight: 800;
    color: #000;
    margin-bottom: 15px;
}

.empty-catalog-text {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.6;
}

/* ===== СТРАНИЦА ДЕТАЛЕЙ ТОВАРА ===== */
.product-details-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: #fff;
    border: 2px solid #000;
    border-radius: 12px;
    padding: 30px;
    margin: 20px 0;
}

.product-details-image {
    width: 100%;
    height: 400px;
    background: #f8f8f8;
    border: 2px solid #000;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.main-product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Самодостаточный блок (база .no-image-icon — в cabinet.css) */
.no-image-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    text-align: center;
}

    .no-image-large .no-image-icon {
        font-size: 6rem;
        margin-bottom: 20px;
        opacity: 0.5;
    }

    .no-image-large p {
        font-size: 1.1rem;
        font-weight: 600;
    }

.product-details-info h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #000;
    margin-bottom: 25px;
    line-height: 1.3;
}

.detail-row {
    display: flex;
    margin-bottom: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

    .detail-row:last-child {
        border-bottom: none;
    }

/* Переопределение глобальных detail-label/value для страницы товара */
.detail-label {
    font-weight: 700;
    color: #000;
    min-width: 150px;
    font-family: 'Montserrat', sans-serif;
}

.detail-value {
    color: #333;
    font-family: 'Montserrat', sans-serif;
}

.product-actions-large {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn-cart-large {
    flex: 1;
    min-width: 200px;
    padding: 15px 30px;
    background: #000;
    color: #FFE733;
    border: 2px solid #000;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

    .btn-cart-large:hover {
        background: #FFE733;
        color: #000;
        transform: translateY(-2px);
    }

/* Белая версия кнопки "назад" (чёрная — в order-pages.css) */
.btn-back {
    padding: 15px 30px;
    background: #fff;
    color: #000;
    border: 2px solid #000;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s;
}

    .btn-back:hover {
        background: #f0f0f0;
    }

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 1024px) {
    .catalog-grid {
        grid-template-columns: 1fr;
    }

    .main-categories-grid {
        grid-template-columns: 1fr;
    }

    .other-categories-card {
        order: -1;
    }
}

@media (max-width: 968px) {
    .catalog-layout {
        grid-template-columns: 1fr;
    }

    .catalog-sidebar {
        position: static;
    }

    .product-details-container {
        grid-template-columns: 1fr;
    }

    .product-details-image {
        height: 300px;
    }
}

@media (max-width: 640px) {
    .catalog-header h1 {
        font-size: 1.8rem;
    }

    .category-card-title {
        font-size: 1.3rem;
    }

    .other-categories-title {
        font-size: 1.3rem;
    }

    .product-actions-large {
        flex-direction: column;
    }

    .btn-cart-large,
    .btn-back {
        width: 100%;
    }
}
