/* ========= СТИЛИ ДЛЯ КАРТОЧЕК КАТЕГОРИЙ ========= */

/* Базовая карточка */
.category-card {
    background: white;
    border-radius: 22px;
    padding: 30px 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    height: 100%;
    border: 1px solid rgba(42,125,46,0.1);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

/* Карточка с фоновым изображением */
.category-card.with-bg {
    background-size: cover;
    background-position: center;
    position: relative;
    border: none;
    color: white;
    padding: 0;
    min-height: 550px;
}

/* Затемнение фона */
.category-card.with-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(145deg,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.5) 100%);
    z-index: 1;
}

/* Контент карточки */
.category-card.with-bg .category-content {
    position: relative;
    z-index: 2;
    padding: 30px 25px;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

/* Заголовок категории в стеклянном фоне */
.category-card.with-bg .category-header {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    width: 100%;
}

/* Легкий блик сверху для стекла */
.category-card.with-bg .category-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%);
    border-radius: 18px 18px 0 0;
    pointer-events: none;
}

.category-card.with-bg .category-header .category-icon {
    background: rgba(255, 255, 255, 0.2);
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.category-card.with-bg .category-header .category-icon i {
    font-size: 2rem;
    color: white !important;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.3));
}

.category-card.with-bg .category-header .category-title {
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.category-card.with-bg .category-header .category-description {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95rem; /* Уменьшил */
    line-height: 1.4; /* Уменьшил */
    text-shadow: 0 1px 5px rgba(0,0,0,0.3);
    margin-bottom: 0;
}

/* Статистика */
.category-card.with-bg .category-stats {
    margin-bottom: 15px; /* Уменьшил */
    width: 100%;
}

.category-card.with-bg .category-stats .category-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 16px; /* Уменьшил */
    border-radius: 30px;
    font-size: 0.9rem; /* Уменьшил */
    font-weight: 600;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: inline-block;
}

/* Стеклянные фреймы для услуг */
.category-card.with-bg .services-frames {
    display: flex;
    flex-direction: column;
    gap: 8px; /* Уменьшил отступ между фреймами */
    margin: 8px 0 12px;
    flex-grow: 1;
    width: 100%;
}

.category-card.with-bg .service-frame {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 12px; /* Немного уменьшил скругление */
    padding: 10px 14px; /* Уменьшил отступы */
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    width: 100%;
}

/* Легкий блик сверху для стекла */
.category-card.with-bg .service-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%);
    border-radius: 12px 12px 0 0;
    pointer-events: none;
}

.category-card.with-bg .service-frame:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(15px) saturate(200%);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Содержимое фрейма - вертикальное расположение */
.category-card.with-bg .service-frame-content {
    display: flex;
    flex-direction: column;
    gap: 4px; /* Уменьшил отступ между названием и ценой */
    width: 100%;
}

.category-card.with-bg .service-frame-name {
    font-weight: 600;
    color: white;
    font-size: 0.85rem; /* Уменьшил с 1rem до 0.85rem */
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    line-height: 1.3;
    white-space: normal;
    word-break: break-word;
}

.category-card.with-bg .service-frame-price {
    color: white;
    font-weight: 600; /* Уменьшил жирность с 700 до 600 */
    font-size: 0.8rem; /* Уменьшил с 1.1rem до 0.8rem */
    background: rgba(255, 255, 255, 0.15); /* Чуть прозрачнее */
    padding: 3px 8px; /* Уменьшил отступы */
    border-radius: 20px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: inline-block;
    align-self: flex-start;
    text-align: center;
}

/* Для карточек без фона */
.category-card:not(.with-bg) .service-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-card:not(.with-bg) .service-list li {
    display: flex;
    flex-direction: column;
    padding: 6px 0; /* Уменьшил с 10px до 6px */
    border-bottom: 1px dashed rgba(42,125,46,0.1);
    gap: 3px; /* Уменьшил отступ */
}

.category-card:not(.with-bg) .service-list li:last-child {
    border-bottom: none;
}

.category-card:not(.with-bg) .service-name {
    flex-grow: 1;
    font-size: 0.85rem; /* Уменьшил с 1rem до 0.85rem */
    line-height: 1.3;
    color: #212529;
    font-weight: 500;
}

.category-card:not(.with-bg) .service-price {
    color: #2a7d2e;
    font-weight: 600;
    font-size: 0.8rem; /* Уменьшил с 1.1rem до 0.8rem */
    background: rgba(42,125,46,0.08); /* Чуть прозрачнее */
    padding: 2px 8px; /* Уменьшил отступы */
    border-radius: 20px;
    display: inline-block;
    align-self: flex-start;
}

/* Заголовок категории тоже немного уменьшим */
.category-card.with-bg .category-header .category-title {
    color: white;
    font-size: 1.5rem; /* Уменьшил с 1.8rem до 1.5rem */
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.category-card.with-bg .category-header .category-description {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.85rem; /* Уменьшил */
    line-height: 1.3;
    text-shadow: 0 1px 5px rgba(0,0,0,0.3);
    margin-bottom: 0;
}

/* Статистика */
.category-card.with-bg .category-stats {
    margin-bottom: 10px;
    width: 100%;
}

.category-card.with-bg .category-stats .category-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.75rem; /* Уменьшил */
    font-weight: 600;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: inline-block;
}

/* Ссылка "Все услуги" */
.category-card.with-bg .category-footer .category-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: white;
    font-weight: 600;
    font-size: 0.8rem; /* Уменьшил */
    padding: 8px 16px;
    background: var(--glass-bg-strong);
    backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 40px;
    transition: all 0.3s ease;
    text-decoration: none;
    width: 100%;
}

.category-card.with-bg .category-footer .category-link i {
    transition: transform 0.2s ease;
    font-size: 0.8rem;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .category-card.with-bg {
        min-height: 550px; /* Немного уменьшил */
    }
}

@media (max-width: 992px) {
    .category-card.with-bg {
        min-height: 500px;
    }

    .category-card.with-bg .service-frame-name {
        font-size: 0.8rem; /* Еще меньше */
    }

    .category-card.with-bg .service-frame-price {
        font-size: 0.75rem;
        padding: 2px 6px;
    }
}

@media (max-width: 768px) {
    .category-card {
        min-height: 400px;
    }

    .category-card.with-bg {
        min-height: 480px;
    }

    .category-card.with-bg .service-frame-name {
        font-size: 0.75rem;
    }

    .category-card.with-bg .service-frame-price {
        font-size: 0.7rem;
        padding: 2px 5px;
    }

    .category-card:not(.with-bg) .service-name {
        font-size: 0.8rem;
    }

    .category-card:not(.with-bg) .service-price {
        font-size: 0.75rem;
        padding: 2px 6px;
    }
}

@media (max-width: 576px) {
    .category-card {
        min-height: 380px;
    }

    .category-card.with-bg {
        min-height: 500px;
    }

    .category-card.with-bg .service-frame {
        padding: 8px 10px;
    }

    .category-card.with-bg .service-frame-name {
        font-size: 0.7rem;
    }

    .category-card.with-bg .service-frame-price {
        font-size: 0.65rem;
        padding: 2px 4px;
    }

    .category-card:not(.with-bg) .service-name {
        font-size: 0.75rem;
    }

    .category-card:not(.with-bg) .service-price {
        font-size: 0.7rem;
        padding: 2px 5px;
    }
}