:root {
    --primary: #2FB24A;
    --primary-hover: #27ae60;
    --dark: #2c3e50;
    --light: #f4f7f6;
    --white: #ffffff;
    --text: #4a4a4a;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light);
    color: var(--text);
    line-height: 1.6;
}

.container {
    max-width: 90%;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    text-decoration: none;
    color: var(--dark);
    cursor: pointer;
}

.logo span {
    color: var(--primary);
}

.nav a {
    margin-left: 20px;
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
    transition: 0.3s;
}

.nav a:hover {
    color: var(--primary);
}

.btn-primary {
    background: var(--primary);
    color: white !important;
    padding: 10px 20px;
    border-radius: 8px;
    transition: 0.3s;
    text-decoration: none;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

/* --- HERO SECTION --- */
.hero {
    background: linear-gradient(rgba(44, 62, 80, 0.8), rgba(44, 62, 80, 0.8)), url('https://images.unsplash.com/photo-1581094794329-c8112a89af12?q=80&w=1400') center/cover;
    padding: 80px 0;
    text-align: center;
    color: white;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.hero h1 span {
    color: var(--primary);
}

.search-box {
    display: flex;
    max-width: 600px;
    margin: 30px auto 0;
    gap: 10px;
}

.search-box input {
    flex: 1;
    padding: 15px;
    border-radius: 8px;
    border: none;
    font-size: 16px;
    outline: none;
}

.search-box button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 25px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

/* --- GRID CATEGORIES (Твои стили) --- */
.section-title {
    text-align: center;
    margin: 60px 0 40px;
    font-size: 2rem;
    color: var(--dark);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 60px;
}

/* Делаем карточку категории кликабельной через ссылку */
.cat-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.cat-card {
    background: var(--white);
    padding: 40px 20px;
    text-align: center;
    border-radius: 15px;
    transition: 0.3s;
    cursor: pointer;
    border: 1px solid #eee;
}

.cat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.cat-card i {
    font-size: 45px;
    color: var(--primary);
    margin-bottom: 20px;
    display: block;
}

.cat-card h3 {
    font-size: 1.2rem;
    color: var(--dark);
}

/* --- МАСТЕР КАРТОЧКИ (ДЛЯ СТРАНИЦЫ КАТЕГОРИЙ) --- */
.master-card {
    position: relative;
    display: flex;
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid #eee;
    transition: 0.3s;
}

.master-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.stretched-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
}

.m-photo-side,
.m-info-side {
    position: relative;
    z-index: 2;
    pointer-events: none;
}

.m-photo-side {
    padding: 25px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 170px;
    text-align: center;
}

.m-photo-side img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    margin-bottom: 10px;
}

.m-info-side {
    padding: 25px;
    flex-grow: 1;
}

.m-action-side {
    position: relative;
    z-index: 10;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 200px;
    justify-content: center;
}

.d-action-side {
    display: none;
}

.btn-card {
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    font-weight: bold;
}

.btn-wa {
    background: #25D366;
    color: white;
}

.btn-call {
    background: #eee;
    color: #333;
}

/* --- HOW IT WORKS --- */
.bg-light {
    background: #edf2f7;
    padding: 80px 0;
}

.steps {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin-top: 40px;
}

.step {
    text-align: center;
    flex: 1;
    font-weight: bold;
}

.step span {
    display: block;
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    line-height: 40px;
    margin: 0 auto 15px;
}

/* --- FOOTER --- */
.footer {
    background: var(--dark);
    color: white;
    padding: 60px 0 20px;
}

.grid-footer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
}

.footer h4 {
    color: var(--primary);
    margin-bottom: 20px;
}

.footer a {
    color: #bdc3c7;
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    margin-top: 40px;
    border-top: 1px solid #3e4f5f;
    font-size: 14px;
    opacity: 0.6;
}



/* Разметка страницы с Aside */
.page-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    /* Фиксированная ширина для Aside */
    gap: 30px;
    padding-top: 30px;
    align-items: start;
}

/* Стили Sidebar */
.sidebar-box {
    background: #fff;
    padding: 25px;
    border-radius: 15px;
    border: 1px solid #eee;
    position: sticky;
    top: 90px;
    /* Чтобы панель не улетала при скролле */
}

.sidebar-logo {
    font-size: 22px;
    margin-bottom: 25px;
}

/* Поиск в Sidebar */
.sidebar-search {
    display: flex;
    margin-bottom: 30px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.sidebar-search input {
    border: none;
    padding: 10px;
    width: 100%;
    outline: none;
    font-size: 14px;
}

.sidebar-search button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 12px;
    cursor: pointer;
}

/* Навигация в Sidebar */
.sidebar-nav h4 {
    font-size: 14px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 10px;
}

.sidebar-nav a {
    text-decoration: none;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    transition: 0.3s;
    font-weight: 500;
}

.sidebar-nav a i {
    width: 20px;
    color: #bdc3c7;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: #e8f5e9;
    color: var(--primary);
}

.sidebar-nav a.active i {
    color: var(--primary);
}




.sidebar-search {
    position: relative;
    display: flex;
    background: #f9f9f9;
    border-radius: 10px;
    padding: 5px 10px;
    border: 1px solid #ddd;
}

.sidebar-search input {
    background: transparent;
    border: none;
    width: 100%;
    padding: 8px;
    outline: none;
}

.sidebar-search button {
    background: transparent;
    border: none;
    color: var(--primary);
    cursor: pointer;
}

.search-container {
    position: relative;
    margin-bottom: 30px;
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    z-index: 100;
    display: none;
    overflow: hidden;
}

.search-hint {
    padding: 10px 15px;
    font-size: 12px;
    text-transform: uppercase;
    color: #999;
    background: #f9f9f9;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--dark);
    font-size: 14px;
    transition: 0.2s;
    border-bottom: 1px solid #eee;
}

.category-item:last-child {
    border-bottom: none;
}

.category-item:hover {
    background: #e8f5e9;
    color: var(--primary);
}

.category-item i {
    font-size: 12px;
    color: var(--primary);
}


.sidebar-nav h4 {
    font-size: 12px;
    text-transform: uppercase;
    color: #999;
    margin: 25px 0 15px;
    letter-spacing: 1px;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
}

.sidebar-nav li {
    margin-bottom: 8px;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--dark);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    transition: 0.2s;
}

.sidebar-nav li a i {
    color: var(--primary);
    width: 20px;
    text-align: center;
}

.sidebar-nav li a:hover {
    background: #f0fdf4;
    /* Очень светлый зеленый */
    color: var(--primary);
}

/* Выделение активной категории (например, если мы в электриках) */
.sidebar-nav li a.active {
    background: var(--primary);
    color: white;
}

.sidebar-nav li a.active i {
    color: white;
}


.header {
    background: var(--white);
    padding: 12px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* Логотип */
.logo {
    font-size: 26px;
    font-weight: 800;
    text-decoration: none;
    color: var(--dark);
    letter-spacing: -1px;
}

.logo span {
    color: var(--primary);
}

/* Контейнер поиска */
.header-search-container {
    max-width: 600px;
    position: relative;
}

.header-search {
    display: flex;
    background: #f1f3f4;
    border-radius: var(--border-radius);
    padding: 4px 15px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.header-search:focus-within {
    background: var(--white);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.15);
}

.header-search input {
    border: none;
    background: transparent;
    width: 100%;
    padding: 10px;
    outline: none;
    font-size: 16px;
    color: var(--dark);
}

.header-search button {
    background: transparent;
    border: none;
    color: var(--gray);
    cursor: pointer;
    font-size: 18px;
    padding: 0 5px;
}

/* Стили для выпадающего списка (общие) */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    display: none;
}

/* Адаптивность для мобилок (убираем aside или переносим) */
@media (max-width: 992px) {
    .page-layout {
        grid-template-columns: 1fr;
        /* На мобильных колонки в один ряд */
    }

    .sidebar {
        display: none;
        /* Или можно скрыть боковую панель на мобильных */
    }
}


/* Базовый стиль для описания */
.m-desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--gray);
    font-size: 14px;
    line-height: 1.4;
}

/* КОМПЬЮТЕРНАЯ ВЕРСИЯ (Desktop) */
@media (min-width: 769px) {
    .m-desc {
        -webkit-line-clamp: 3; /* Ограничиваем примерно 3 строками (около 120-140 символов) */
        max-height: 4.2em;    /* line-height * 3 */
    }
}

/* МОБИЛЬНАЯ ВЕРСИЯ (Mobile) */
@media (max-width: 768px) {
    .m-desc {
        -webkit-line-clamp: 2; /* Ограничиваем 2 строками (около 60-80 символов) */
        max-height: 2.8em;    /* line-height * 2 */
        font-size: 13px;      /* На мобилках можно чуть уменьшить шрифт */
    }
}

@media (max-width: 768px) {

    #masters-grid {
        display: flex;
        flex-wrap: wrap;

    }

    .master-card {
        width: 50%;
    }


    .m-photo-side img {
        width: 100% !important;
        height: 200px;
    }

    .m-photo-side {
        padding: 10px;
        align-items: start;
        min-width: 170px;
        text-align: start;
    }

    .m-info-side {
        padding: 10px;
    }

    .m-info-side .tag {
        font-size: 10px;
    }


    .m-name {
        font-size: 16px;
    }



    .d-action-side {
        position: relative;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    
    }

 .d-action-side a {
    padding: 10px;
color: #ffffff;
    background-color: #2FB24A;
}
    .btn-card {
        padding: 0px;
    }

    .btn-wa {
        display: none;
    }

    .master-card,
    .steps {
        flex-direction: column;
    }

    .m-action-side {
        display: none;
        flex-direction: row;
    }

    

    .container {
        max-width: 100%;

    }
}