/* ===================================
   JUNIPER CATEGORY PAGE STYLES
   juniper/juniper-category.css
   =================================== */

/* Breadcrumb */
.juniper-breadcrumb {
    background: linear-gradient(135deg, rgba(0, 56, 101, 0.05), rgba(0, 163, 224, 0.05));
    padding: 100px 0 20px;
    border-bottom: 1px solid #dee2e6;
}

.breadcrumb {
    margin-bottom: 0;
    background: transparent;
    padding: 0;
}

.breadcrumb-item a {
    color: var(--juniper-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.breadcrumb-item a:hover {
    color: var(--juniper-dark);
}

.breadcrumb-item.active {
    color: var(--text-secondary);
}

/* Category Header */
.juniper-category-header {
    padding: 40px 0;
    background: white;
    border-bottom: 1px solid #eee;
}

.category-header-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.category-icon-large {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--juniper-primary), var(--juniper-secondary));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
}

.category-header-content h1 {
    font-size: 2.5rem;
    color: var(--juniper-dark);
    margin-bottom: 10px;
}

.category-header-content .lead {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.category-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.category-stats .badge {
    padding: 8px 15px;
    font-weight: 500;
}

/* Quick Links */
.category-quick-links {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 25px;
}

.category-quick-links h5 {
    margin-bottom: 20px;
    color: var(--juniper-dark);
}

.category-quick-links .list-group-item {
    border: none;
    background: white;
    margin-bottom: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.category-quick-links .list-group-item:hover {
    background: var(--juniper-light);
    transform: translateX(5px);
}

.category-quick-links .list-group-item.active {
    background: linear-gradient(135deg, var(--juniper-primary), var(--juniper-secondary));
    color: white;
}

/* Products Section */
.juniper-products-section {
    padding: 60px 0;
    background: #f8f9fa;
}

.filters-bar {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.filters-bar h2 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--juniper-dark);
    font-weight: 600;
}

/* ===================================
   КОМПАКТНЫЕ КАРТОЧКИ ТОВАРОВ
   =================================== */

/* Компактная карточка товара */
.juniper-product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 420px;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.juniper-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 163, 224, 0.15);
}

/* Статус товара */
.product-status {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.product-status.in-stock {
    color: #28a745;
    border: 1px solid #28a745;
}

.product-status.order {
    color: #ffc107;
    border: 1px solid #ffc107;
}

/* Изображение товара - уменьшенная высота */
.product-image {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa, #fff);
    padding: 15px;
    position: relative;
    overflow: hidden;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.juniper-product-card:hover .product-image img {
    transform: scale(1.05);
}

/* Контент товара - компактный */
.product-content {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-info {
    flex: 1;
}

.product-model {
    font-size: 0.75rem;
    color: var(--juniper-primary);
    font-weight: 600;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-name {
    font-size: 1rem;
    color: var(--juniper-dark);
    margin-bottom: 8px;
    line-height: 1.2;
    font-weight: 600;
    min-height: 2.4em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Краткое описание */
.product-description {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.4;
    margin-bottom: 10px;
    /* Убираем ограничения */
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
    text-overflow: unset;
    min-height: unset;
}

/* Блок с ценой */
.product-price-wrapper {
    margin-bottom: 12px;
    min-height: 32px;
    display: flex;
    align-items: center;
}

.product-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: #28a745;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.price-value {
    letter-spacing: -0.5px;
}

.price-currency {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.9;
}

.product-price-request {
    font-size: 0.9rem;
    color: #6c757d;
    font-style: italic;
    padding: 6px 12px;
    background: #f8f9fa;
    border-radius: 20px;
    display: inline-block;
}



/* Кнопки действий - компактные */
.product-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.product-actions .btn {
    flex: 1;
    padding: 6px 10px;
    font-size: 0.85rem;
    border-radius: 6px;
    font-weight: 500;
}

.product-actions .btn i {
    font-size: 0.9rem;
}

/* Адаптация для List View */
.list-view .col-md-6.col-lg-4 {
    max-width: 33.333%;
    flex: 0 0 33.333%;
    padding: 0 10px;
}

.list-view .juniper-product-card {
    flex-direction: row;
    min-height: 100px;
    height: auto;
    margin-bottom: 15px;
}

.list-view .product-status {
    top: 5px;
    right: 5px;
    padding: 2px 6px;
    font-size: 0.65rem;
}

.list-view .product-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    padding: 8px;
}

.list-view .product-content {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.list-view .product-info {
    flex: 1;
    min-width: 0;
}

.list-view .product-model {
    font-size: 0.7rem;
    margin-bottom: 2px;
    color: #6c757d;
}

.list-view .product-name {
    min-height: auto;
    font-size: 0.85rem;
    margin-bottom: 3px;
    -webkit-line-clamp: 1;
    font-weight: 600;
    line-height: 1.2;
}

.list-view .product-description {
    display: none; /* Скрываем описание для компактности */
}

.list-view .product-price-wrapper {
    margin: 5px 0;
    text-align: left;
}

.list-view .product-price {
    font-size: 1rem;
    font-weight: 700;
    color: #28a745;
}

.list-view .product-price-request {
    font-size: 0.75rem;
}

.list-view .product-actions {
    flex-direction: row;
    gap: 5px;
    margin-top: 5px;
}

.list-view .product-actions .btn {
    padding: 4px 8px;
    font-size: 0.7rem;
    flex: 1;
}

.list-view .product-actions .btn i {
    font-size: 0.8rem;
    margin-right: 2px;
}

/* Адаптивность для list view */
@media (max-width: 1200px) {
    .list-view .col-md-6.col-lg-4 {
        max-width: 50%;
        flex: 0 0 50%;
    }
}

@media (max-width: 768px) {
    .list-view .col-md-6.col-lg-4 {
        max-width: 100%;
        flex: 0 0 100%;
    }

    .list-view .product-image {
        width: 60px;
        height: 60px;
    }
}

/* Empty State */
.empty-state {
    background: white;
    border-radius: 16px;
    padding: 60px;
    margin: 40px 0;
}

/* CTA Section */
.juniper-category-cta {
    padding: 60px 0;
    background: linear-gradient(135deg, rgba(0, 163, 224, 0.05), rgba(120, 190, 32, 0.05));
}

.juniper-category-cta .cta-content h2 {
    font-size: 2rem;
    color: var(--juniper-dark);
    margin-bottom: 15px;
}

.juniper-category-cta .cta-content p {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
}

/* ===================================
   СТИЛИ ДЛЯ ПОИСКА
   =================================== */

.search-box {
    flex: 1;
    max-width: 400px;
    margin: 0 15px;
}

.search-box .input-group {
    border-radius: 25px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    overflow: hidden;
    transition: all 0.3s ease;
}

.search-box .input-group:focus-within {
    background: white;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-box .input-group-text {
    background: transparent;
    border: none;
    padding: 0.5rem 0.75rem 0.5rem 1rem;
    color: #6c757d;
}

.search-box .form-control {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem 0.5rem 0;
    font-size: 0.95rem;
}

.search-box .form-control:focus {
    box-shadow: none;
    background: transparent;
}

.search-box .form-control::placeholder {
    color: #adb5bd;
}

/* Кнопка очистки */
.search-box .btn-clear {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem 0.5rem 0.5rem;
    color: #6c757d;
    cursor: pointer;
    transition: color 0.2s;
}

.search-box .btn-clear:hover {
    color: #495057;
}

/* Выравнивание элементов в filters-bar */
.filters-bar .row {
    align-items: center;
}

.filters-bar .d-flex {
    align-items: center;
    gap: 10px;
}

/* Метка категории в результатах поиска */
.product-group-label {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-bottom: 10px;
    font-weight: 500;
}

.product-group-label i {
    font-size: 0.75rem;
}

/* ===================================
   АНИМАЦИИ
   =================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.juniper-product-card {
    animation: fadeInUp 0.4s ease backwards;
}

.juniper-product-card:nth-child(1) { animation-delay: 0.05s; }
.juniper-product-card:nth-child(2) { animation-delay: 0.1s; }
.juniper-product-card:nth-child(3) { animation-delay: 0.15s; }
.juniper-product-card:nth-child(4) { animation-delay: 0.2s; }
.juniper-product-card:nth-child(5) { animation-delay: 0.25s; }
.juniper-product-card:nth-child(6) { animation-delay: 0.3s; }

/* ===================================
   МОБИЛЬНАЯ АДАПТАЦИЯ
   =================================== */

@media (max-width: 991px) {
    .category-header-content h1 {
        font-size: 2rem;
    }

    .category-quick-links {
        margin-top: 30px;
    }
}

@media (max-width: 768px) {
    .juniper-breadcrumb {
        padding-top: 80px;
    }

    .filters-bar .row {
        gap: 15px;
    }

    .filters-bar h2 {
        font-size: 1.25rem;
        margin-bottom: 15px;
    }

    .product-image {
        height: 140px;
    }

    .product-content {
        padding: 12px;
    }

    .product-name {
        font-size: 0.95rem;
    }

    .product-price {
        font-size: 1.25rem;
    }

    .product-actions {
        flex-direction: row;
    }

    .product-actions .btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .search-box {
        max-width: 100%;
        margin: 15px 0;
    }

    .filters-bar .col-md-6 {
        margin-bottom: 15px;
    }

    .filters-bar .d-flex {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .product-actions .btn span {
        display: none;
    }

    .product-actions .btn i {
        margin: 0 !important;
    }
}

/* ===================================
   MOBILE STYLES FOR JUNIPER CATEGORY PAGE
   Добавьте эти стили в конец juniper-category.css
   =================================== */

/* Базовые мобильные стили для планшетов */
@media (max-width: 768px) {

    /* Breadcrumb */
    .juniper-breadcrumb {
        padding: 75px 0 15px;
    }

    .breadcrumb {
        font-size: 0.85rem;
    }

    /* Category Header */
    .juniper-category-header {
        padding: 25px 0;
    }

    .category-icon-large {
        width: 60px;
        height: 60px;
        font-size: 2rem;
        border-radius: 15px;
    }

    .category-header-content h1 {
        font-size: 1.75rem;
        margin-bottom: 8px;
    }

    .category-header-content .lead {
        font-size: 1rem;
        margin-bottom: 15px;
    }

    .category-stats {
        gap: 5px;
    }

    .category-stats .badge {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    /* Quick Links - скрываем на планшетах */
    .category-quick-links {
        margin-top: 20px;
    }

    /* Products Section */
    .juniper-products-section {
        padding: 30px 0;
    }

    /* Filters Bar */
    .filters-bar {
        padding: 15px;
        margin-bottom: 20px;
    }

    .filters-bar h2 {
        font-size: 1.25rem;
        margin-bottom: 15px;
    }

    .filters-bar .d-flex {
        flex-wrap: wrap;
        gap: 10px;
    }

    /* Search Box */
    .search-box {
        width: 100%;
        max-width: none;
        margin: 10px 0;
        order: -1; /* Поиск наверх */
    }

    /* View buttons */
    .btn-group {
        order: 1;
    }

    /* Sort select */
    #sortSelect {
        width: 100%;
        order: 2;
        margin-top: 10px;
    }

    /* View buttons - исправляем отображение */
    .filters-bar .btn-group {
        order: 1;
        display: inline-flex !important;
        border-radius: 0.375rem !important;
        overflow: hidden !important;
    }


    .filters-bar .btn-group #grid-view {
        border-right: none !important;
    }

    .filters-bar .btn-group #list-view {
        border-left: 1px solid #dee2e6 !important;
    }

    /* Размер иконок */
    .filters-bar .btn-group button i {
        font-size: 16px !important;
    }
}


/* Исправление размера кнопок переключения вида на мобильных */
@media (max-width: 768px) {
    #grid-view,
    #list-view {
        padding: 4px 6px !important;  /* Минимальные отступы */
    }
}

/* ФИНАЛЬНЫЙ ФИКС для узких кнопок на мобильных */
    @media (max-width: 768px) {
        .filters-bar .d-flex .btn-group button#grid-view,
        .filters-bar .d-flex .btn-group button#list-view {
            padding: 4px 6px !important;
            width: auto !important;
            flex: none !important;
        }
    }

    @media (max-width: 576px) {
        .filters-bar .d-flex .btn-group button {
            width: auto !important;
            flex: none !important;
        }
    }