/* ===== ОСНОВНЫЕ СТИЛИ ===== */
* {
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #fcf8ec;
    margin: 0;
    padding: 0;
}

/* ===== ССЫЛКИ И НАВИГАЦИЯ ===== */
.linkd {
    padding-left: 100px;
    line-height: 24px;
}

h1 { font-size: 20px; }
h2 { font-size: 16px; display: inline; margin-right: 12px; }

A.lin,
A.linon,
span.linon {
    text-decoration: none;
    font-weight: bold;
    font-size: 18px;
    transition: color 0.2s ease;
}

A.lin { color: #000000; }
A:hover.lin,
A.linon,
span.linon { color: #c72d2c; }

.lin_a {
    text-decoration: none;
    font-weight: bold;
    font-size: 15px;
    color: #c72d2c;
}

A.surname {
    font-size: 16px;
    color: #000000;
    text-decoration: none;
    transition: color 0.2s ease;
}

A.surname_с { color: #714321; }
A:hover.surname { color: #c72d2c; }

a.bukv_catal {
    text-decoration: none;
    font-size: 17px;
    color: #c72d2c;
    transition: color 0.2s ease;
}

a.bukv_catal_on {
    text-decoration: none;
    font-size: 17px;
    color: #000000;
    font-weight: bold;
}

a.bukv_catal_dop {
    text-decoration: none;
    font-size: 12px;
    color: #8a2423;
}

/* ===== ЛЕЙАУТ ===== */
.site-wrapper {
    display: grid;
    grid-template-columns: 360px 1fr;
    max-width: 1400px;
    margin: 0 auto;
    background: #fcf8ec;
}

.sidebar { background: transparent; }
.content { background: transparent; padding: 0; }

/* ===== ШАПКА ===== */
.header-banner {
    display: flex;
    height: 265px;
}

.header-banner img {
    width: auto;
    height: 100%;
}

.rh1, .rh2 {
    background-size: cover;
    background-position: center;
}

.rh1 {
    background: url(/img/r_h_02.jpg);
    width: 227px;
    height: 265px;
}

.rh2 {
    background: url(/img/r_h_03.jpg);
    width: 162px;
    height: 265px;
}

.div_serch {
    padding-left: 45px;
    padding-top: 7px;
}

/* ===== ЛЕВАЯ КОЛОНКА ===== */
.l1, .l2, .l3, .l5 {
    background-repeat: no-repeat;
    background-position: top left;
    background-size: cover;
}

.l1 { background: url(/img/l_01.jpg); height: 237px; }
.l2 { background: url(/img/l_02.jpg); height: 186px; }
.l3 { background: url(/img/l_03.jpg); height: 269px; }
.l5 { background: url(/img/l_04.jpg); height: 132px; }

/* ===== КОНТЕНТ ===== */
.middle-content { padding: 20px; }
.top-ad { margin-bottom: 20px; }
.bukvy {
    text-align: center;
    margin: 15px 0;
}
.about-text {
    font-size: 14px;
    line-height: 1.5;
}

/* ===== ФУТЕР ===== */
.footer-banners {
    display: flex;
    height: 133px;
}

.rmd1, .rmd2, .rmd3 {
    background-size: cover;
    background-position: center;
}

.rmd1 { background: url(/img/r_d_01.jpg); width: 301px; height: 133px; }
.rmd2 { background: url(/img/r_d_02.jpg); width: 42px; height: 133px; }
.rmd3 { background: url(/img/r_d_03.jpg); width: 297px; height: 133px; }

/* ===== ПАГИНАЦИЯ ===== */
.pagination-container {
    margin: 20px 0;
    text-align: center;
}

.pagination {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 5px;
}

.pagination li a,
.pagination li span {
    display: inline-block;
    padding: 8px 14px;
    font-size: 14px;
    font-family: Tahoma, sans-serif;
    text-decoration: none;
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.pagination li a:hover {
    background-color: #c72d2c;
    border-color: #c72d2c;
    color: #fff;
}

.pagination li.active span {
    background-color: #c72d2c;
    border-color: #c72d2c;
    color: #fff;
    cursor: default;
}

.pagination li.disabled span {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.pagination-dots span {
    background: none;
    border: none;
    color: #666;
    padding: 8px 4px;
}

.pagination-prev a,
.pagination-next a,
.pagination-prev span,
.pagination-next span {
    font-weight: bold;
}

.pagination-info {
    margin-top: 10px;
    font-size: 12px;
    color: #666;
}

/* ===== СЕТКА ФАМИЛИЙ ===== */
.surnames-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px 20px;
}

.surname-item { break-inside: avoid; }

/* ===== КНОПКА "ПОКАЗАТЬ ЕЩЁ" ===== */
.load-more-container {
    text-align: center;
    margin: 20px 0;
}

.load-more-btn {
    display: inline-block;
    background-color: #c72d2c;
    color: #fff;
    border: none;
    padding: 10px 30px;
    font-size: 14px;
    border-radius: 25px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.load-more-btn:hover {
    background-color: #a0201f;
}

.load-more-btn:active {
    transform: scale(0.98);
}

.load-more-loader {
    padding: 10px;
    color: #666;
}

/* ===== МОБИЛЬНЫЙ ВЕРХНИЙ БАННЕР ===== */
.mobile-top-banner {
    display: none;
    background: #fcf8ec;
    text-align: center;
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

/* ===== МОБИЛЬНАЯ ШАПКА ===== */
.mobile-header {
    display: none;
    position: fixed;
    top: 90px;
    left: 0;
    right: 0;
    height: 50px;
    background: #c72d2c;
    z-index: 1004;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.mobile-header.hide {
    transform: translateY(-100%);
}

.mobile-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 10px;
}

.mobile-menu-icon,
.mobile-search-icon {
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: background 0.2s ease;
}

.mobile-menu-icon:active,
.mobile-search-icon:active {
    background: rgba(255,255,255,0.4);
}

.mobile-logo img {
    height: 36px;
    width: auto;
    display: block;
}

/* ===== ОВЕРЛЕЙ ДЛЯ МЕНЮ ===== */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1002;
    display: none;
}

.menu-overlay.active {
    display: block;
}

/* ===== ДЕСКТОПНЫЕ ЭЛЕМЕНТЫ ===== */
.desktop-top-banner { display: block; }

/* ===== ДОПОЛНИТЕЛЬНЫЕ ЭЛЕМЕНТЫ ===== */
.f_text { width: 50px; }
.f_but {
    border: 1px solid #CCCCAA;
    background-color: #fcf8ec;
    cursor: pointer;
}

.f_reg {
    border: 0;
    font-size: 14px;
    background-color: #fcf8ec;
    font-weight: bold;
    color: #906151;
}

.catal_count { font-size: 11px; color: #000000; }
.catal_count_12 { font-size: 12px; color: #000000; }
.catal_count_12poyasnenie { font-size: 11px; color: #999999; }

#catal_cont_1 { font-size: 15px; }
.linkz { margin-left: 7px; }
.linkz, .linkz a { color: #997766; font-size: 12px; }
.linkz strong, .linkz strong a { font-size: 14px; line-height: 26px; }

.grey1 { color: #555555; }

a.acatalog_page { font-size: 14px; color: #666666; }
a.acatalog_page_vernutsy { font-size: 14px; color: #a3774a; }
a.acatalog_page_strelki {
    text-decoration: none;
    font-size: 12px;
    color: #000000;
}
a:hover.acatalog_page_strelki { color: #666611; }

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 1024px) {
    .site-wrapper {
        grid-template-columns: 280px 1fr;
    }
    .linkd {
        padding-left: 20px;
    }
}


@media (max-width: 768px) {
    .site-wrapper {
        display: block;
        padding-top: 64px !important;
        margin-top: 0 !important;
    }
    
    .header-banner {
        display: none !important;
    }
    
    .mobile-top-banner {
        display: block;
        min-height: 90px;
        height: auto;
        position: relative;
        z-index: 1;
    }
    
    .mobile-header {
        display: block;
        top: 120px;
    }

	.mobile-title {
		flex: 1;
		text-align: center;
		color: white;
		font-size: 15px !important;
		font-weight: bold;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		padding: 0 5px;
	}

    .sidebar {
        position: fixed;
        top: 140px;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: calc(100% - 140px);
        background: #fcf8ec;
        z-index: 1003;
        overflow-y: auto;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
        padding-top: 20px;
    }
    .sidebar.active {
        left: 0;
    }
    
    .sidebar .l1,
    .sidebar .l2,
    .sidebar .l3,
    .sidebar .l5 {
        background-image: none !important;
        background-color: #fcf8ec;
        height: auto;
        min-height: 0;
        padding: 0;
    }
    
    .sidebar .l2 .linkd {
        padding: 15px 20px;
    }
    
    .mobile-menu-toggle {
        display: none;
    }
    
    .div_serch {
        display: none;
    }
    
    /* Панель поиска */
    .mobile-search-panel {
        position: fixed;
        top: 170px !important;
        left: 0;
        right: 0;
        background: #c72d2c;
        padding: 20px 36px 20px 15px;
        transform: translateY(-100%);
        transition: transform 0.3s ease;
        z-index: 1001;
        box-sizing: border-box;
        display: block !important;
    }
    
    .mobile-search-panel.active {
        transform: translateY(0) !important;
    }
    
    .mobile-search-panel .search-form {
        display: flex;
        gap: 10px;
        background: white;
        border-radius: 30px;
        padding: 5px;
        margin-bottom: 15px;
    }
    
    .mobile-search-panel .search-input {
        flex: 1;
        padding: 12px 15px;
        border: none;
        border-radius: 30px;
        font-size: 16px;
        outline: none;
    }
    
    .mobile-search-panel .search-submit {
        background: #c72d2c;
        color: white;
        border: none;
        padding: 0 20px;
        border-radius: 30px;
        font-size: 14px;
        cursor: pointer;
    }
    
    .mobile-search-panel .search-close {
        position: absolute;
        top: 2px;
        right: 2px;
        background: rgba(255,255,255,0.2);
        color: white;
        border: none;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        font-size: 20px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-search-panel .search-type {
        display: flex;
        justify-content: center;
        gap: 20px;
        margin-top: 15px;
    }
    
    .mobile-search-panel .search-type label {
        color: white;
        font-size: 14px;
        cursor: pointer;
    }
    
    .mobile-search-overlay {
        position: fixed;
        top: 140px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1000;
        display: none;
    }
    
    .mobile-search-overlay.active {
        display: block;
    }
    
    .middle-content {
        padding: 10px;
    }
    .surnames-grid {
        grid-template-columns: 1fr;
    }
    .footer-banners {
        flex-wrap: wrap;
        height: auto;
    }
    .rmd1, .rmd2, .rmd3 {
        width: 100%;
        min-height: 80px;
    }
    .pagination-container {
        display: none;
    }
}


@media (max-width: 480px) {
    .linkd a, .linkd span {
        font-size: 16px;
    }
    .mobile-menu-icon,
    .mobile-search-icon {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
    .mobile-logo img {
        height: 30px;
    }
    .mobile-title {
        font-size: 12px;
    }
}

@media (min-width: 769px) {
    .mobile-search-panel,
    .mobile-search-overlay,
    .mobile-top-banner,
    .mobile-header {
        display: none !important;
    }
    
    .load-more-container {
        display: none;
    }
}
