/* Стили тэгов */

h1 {
    font-family: 'nunito';
    font-weight: 700;
}

h2, h3, h4, p, li, div, i {
    font-family: 'nunito';
    font-weight: 400;
}

header {
    background: #fafafa;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

body {
    background-color: #eceef0;
}

footer {
    background-color: #fafafa;
}


/* Стили карты */
#map {
    position: relative;
    width: 100%;
    height: 600px;
}

.maplibregl-ctrl-fullscreen {
    position: absolute;
    top: 3px;
    left: 3px;
    z-index: 1;
}

#map:-webkit-full-screen {
    width: 100% !important;
    height: 100% !important;
}

#map:-moz-full-screen {
    width: 100% !important;
    height: 100% !important;
}

#map:fullscreen {
    width: 100% !important;
    height: 100% !important;
}


/* Стили разделителя */
.divider-sc {
    height: 2px;
    background-color: #eceef0;
    margin: 2rem auto;
    width: 80%;
    max-width: 2160px;
    border-radius: 1px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

@media (max-width: 2160px) {
    .divider-sc {
        width: 90%;
    }
}

@media (max-width: 480px) {
    .divider-sc {
        width: 95%;
        height: 1px;
        box-shadow: none;
    }
}


/* Стили ссылок */
.link-grid-sc {
    color: #000000;
    text-decoration: none;
    position: relative;
    padding: 2px 0;
    font-family: 'nunito';
    font-weight: 400;
    display: inline-block;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.link-grid-sc::after {
    display: none;
}

.link-grid-sc:focus {
    outline: none;
}

.link-grid-sc:hover {
    color: #2563eb;
    background-color: #eff6ff;
    border-radius: 4px;
}

.link-sc {
    color: #000000;
    text-decoration: none;
    font-family: 'nunito';
    font-weight: 400;
    display: inline;
    transition: all 0.3s ease;
    padding: 2px 4px;
    box-sizing: border-box;
}

.link-sc:focus {
    outline: none;
}

.link-sc:hover {
    color: #2563eb;
    background-color: #eff6ff;
    border-radius: 4px;
}

/* Стили сообщений и ошибок */
.message-sc {
    color: #721c24;
    font-size: 14px;
    margin: 8px 0;
    padding: 10px 12px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    display: block;
    line-height: 1.4;
    animation: fadeIn 0.3s ease-in;
    font-family: 'nunito';
    font-weight: 400;
}

.error-sc {
    color: #856404;
    font-size: 14px;
    margin-bottom: 15px;
    padding: 12px;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    display: block;
    line-height: 1.4;
    animation: fadeIn 0.3s ease-in;
    font-family: 'nunito';
    font-weight: 400;
}

/* Стили иконок */
.icon-sc {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    background: none !important;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    line-height: normal;
    color: #fff8e5;
    -webkit-text-stroke: 2px #a48c37;
    text-stroke: 2px #a48c37;
}

.icon-sc--none {
    color: #cbd5e1;
    -webkit-text-stroke: 2px #8fa9d0;
    text-stroke: 2px #8fa9d0;
}

.icon-sc--disabled {
    color: #8fa9d0;
    -webkit-text-stroke: 0px #000000;
    text-stroke: 0px #000000;
}

.icon-sc--lined {
    color: #a48c37;
    -webkit-text-stroke: 0px #000000;
    text-stroke: 0px #000000;
}

/* Стиль разделителя иконок */
.divider-sc-vertical {
    width: 2px;
    min-height: 20px;
    max-height: 100%;
    background-color: #eceef0;
    margin: 0 1rem;
    border-radius: 1px;
    box-shadow: 1px 0 2px rgba(0, 0, 0, 0.05);
    flex: 0 0 auto;
}

/* Дополнительные стили dropdown */
.dropdown-container {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 150px;
    transition: all 0.3s ease;
    margin-top: 5px;
}

/* Sticky класс, требуется только шапкой */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Стили кнопки back-to-top */
.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 60px;
    height: 60px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.4s ease;
    z-index: 1000;
    background-color: transparent;
}

.back-to-top.show {
    opacity: 1;
    transform: translateY(0);
}

/* Стили кнопок */
.button-sc {
    position: relative;
    padding: 2px 0;
    text-align: center;
    width: 100%;
    display: inline-block;
    padding: 12px 24px;
    background-color: transparent;
    color: #000;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-family: 'nunito';
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;

    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
    text-decoration-color: transparent;
}

.button-sc:hover {
    background-color: #eceef0;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 2px;
    text-decoration-color: #a48c37;
}

.button-sc--disabled:hover {
    text-decoration-color: #8fa9d0;
}

/* Адаптивные параграфы */
@media (max-width: 768px) {
  .p-sc-medium {
    display: none !important;
  }
}

@media (max-width: 586px) {
  .p-sc-small {
    display: none !important;
  }
}

/* Стили пагинации */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
    padding: 0;
    list-style: none;
}

.link-pag-sc {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    background: #ffffff;
    color: #666;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
}

.link-pag-sc:hover {
    border-color: #a48c37;
    background-color: #fff8e5;
    color: #8a6d3b;
}

.page-item.active .link-pag-sc {
    background: #fff8e5;
    border-color: #a48c37;
    color: #8a6d3b;
    font-weight: 600;
}

.page-item.disabled .link-pag-sc {
    background: #f9f9f9;
    border-color: #eeeeee;
    color: #cccccc;
    cursor: not-allowed;
}

/* Стили картинок недвижимости */
.estate-img-sc {
    height: 300px;
    width: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 12px;
}

.estate-img-sc--fav {
    height: 200px;
}

/* Стили галлереи */
.main-image {
    width: 100%;
    height: auto;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
}

.main-image {
    text-align: center;
}

.estate-img-main {
    max-width: 100%;
    max-height: 500px;
    height: auto;
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;

    border-radius: 8px;
    border: 2px solid transparent;
}

.thumb {
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    margin-top: 6px;
}

.thumb.active {
    border-color: #a48c37;
}

.thumb:hover {
    transform: translateY(-1px);
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .main-image {
        height: 300px;
    }

    .thumb {
        height: 70px;
    }
}

@media (max-width: 480px) {
    .main-image {
        height: 250px;
    }

    .thumb {
        height: 60px;
    }
}


/* Стили значков продавца */
.seller-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.2;
    max-height: 80px;
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: pointer;
}

.seller-badge:hover {
    color: white;
    text-decoration: none;
}

.source {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s ease;
    justify-content: flex-start;
}

.seller-badge:hover .source {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.seller-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.seller-type {
    background: #5a6268;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s ease;
    justify-content: flex-start;
}

.seller-badge:hover .seller-type {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.date {
    font-size: 12px;
    transition: all 0.3s ease;
    font-weight: 400;
}

.seller-badge.cian {
    background: #eff6ff;
    border: 2px solid #7d9ed8;
    color: #263238;
}

.seller-badge.cian:hover {
    background: #7d9ed8;
    border-color: #7d9ed8;
    color: white;
}

.seller-badge.cian:hover .seller-type {
    background: white;
    color: #7d9ed8;
}

.source.cian {
    background: #7d9ed8;
    color: white;
    font-weight: 600;
}

.seller-badge:hover .source.cian {
    background: white;
    color: #7d9ed8;
}

.seller-badge.etagi {
    background: #fff5f5;
    border: 2px solid #e27878;
    color: #450a0a;
}

.seller-badge.etagi:hover {
    background: #e27878;
    border-color: #e27878;
    color: white;
}

.seller-badge.etagi:hover .seller-type {
    background: white;
    color: #e27878;
}

.source.etagi {
    background: #e27878;
    color: white;
    font-weight: 600;
}

.seller-badge:hover .source.etagi {
    background: white;
    color: #e27878;
}

@media (max-width: 480px) {
    .thumb.ad {
        height: 70px;
    }
}

.price-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
    max-height: 60px;
    transition: all 0.3s ease;
    text-decoration: none;
    background: #f4fef9;
    border: 2px solid #10b981;
    color: #031812;
}

/* Дополнительные стили маркеров основной карты */
.cluster-marker, .detail-marker {
    transition: transform 0.2s ease;
}

.cluster-marker:hover, .detail-marker:hover {
    transform: scale(1.2);
}

/* Стили нижней панели */
#estates-panel {
    position: fixed;
    bottom: -350px;
    left: 0;
    right: 0;
    background: #eceef0;
    border-top: 2px solid white;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    transition: bottom 0.3s ease-in-out;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    font-size: 30px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.estate-item {
    background: #f8f9fa;
    border-radius: 5px;
    padding: 15px;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    min-height: 50px;
}

.estate-item:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.estate-item a {
    text-decoration: none;
    color: #333;
    display: block;
}

.estate-item strong {
    display: block;
    margin-bottom: 5px;
}

.estate-item small {
    color: #666;
    display: block;
    margin-bottom: 3px;
}

/* Анимация загрузки нижней панели */
.loading-spinner {
    text-align: center;
    padding: 20px;
    color: #a48c37;
}

.loading-spinner::after {
    content: "";
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #a48c37;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    #estates-panel {
        max-height: 200px;
        padding: 10px;
    }

    .panel-title {
        font-size: 1.1em;
        margin-right: 30px;
    }

    .estate-item {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    #estates-panel {
        max-height: 180px;
    }

    .panel-title {
        font-size: 1em;
    }
}

#estates-panel.loading-transition {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

#estates-panel .estates-list {
    transition: opacity 0.3s ease;
}

#estates-panel.loading-transition .estates-list {
    opacity: 0.5;
}

.maplibregl-map .panel-title {
    font-size: 1.5em;
}
.maplibregl-map .estates-list {
    font-size: 1.3em;
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}