/* Стили для навигационной панели */
.navbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    padding: 0.5rem 1rem;
}

.navbar > .container {
    max-width: 2360px;
}

.navbar-brand {
    max-width: calc(100% - 80px); /* Оставляем место для кнопки toggler */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.navbar-toggler {
    margin-left: auto;
    order: 1;
    padding: 0;
    border: 1px solid rgba(0,0,0,.1);
    border-radius: 0.25rem;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    position: relative;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler .navbar-toggler-icon {
    position: relative;
    display: block;
    width: 22px;
    height: 2px;
    background-color: #000;
    border-radius: 1px;
    transition: background-color 0.2s ease;
    background-image: none !important;
}

.navbar-toggler .navbar-toggler-icon:before,
.navbar-toggler .navbar-toggler-icon:after {
    content: '';
    position: absolute;
    width: 22px;
    height: 2px;
    background-color: #000;
    border-radius: 1px;
    left: 0;
    transition: all 0.3s ease;
}

.navbar-toggler .navbar-toggler-icon:before {
    top: -6px;
}

.navbar-toggler .navbar-toggler-icon:after {
    bottom: -6px;
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon {
    background-color: transparent;
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon:before {
    top: 0;
    transform: rotate(45deg);
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon:after {
    bottom: 0;
    transform: rotate(-45deg);
}

@media (max-width: 767.98px) {
    .navbar {
        padding-right: 1rem;
        padding-left: 1rem;
        position: relative;
        z-index: 1031;
        background: white;
    }
    
    .navbar-collapse {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out;
        z-index: 1030;
        padding: 0 1rem;
    }

    .navbar-collapse.show {
        max-height: calc(100vh - 56px);
        padding: 1rem;
    }

    .navbar-nav {
        margin-top: 0;
        margin-bottom: 0;
    }

    .navbar-nav .nav-item {
        margin-bottom: 0.5rem;
    }

    .navbar-nav .nav-link {
        padding: 0.5rem 0;
        color: #333;
        transition: color 0.2s ease;
    }

    .navbar-nav .nav-link:hover {
        color: #0d6efd;
    }

    .navbar-toggler {
        position: relative;
        z-index: 1031;
    }
}

main > .container {
    padding: 70px 0px 20px;
    max-width: 2360px;
}

@media screen and (max-width: 768px) {
    main > .container {
        padding: 0px 0px 20px;
    }
}

.footer {
    background-color: #f5f5f5;
    font-size: .9em;
    border-top: 1px solid #dee2e6;
    padding-top: 48px !important;
    margin-top: 100px !important;
}

.footer > .container {
    max-width: 2360px;
    margin: auto;
}

.footer h5 {
    color: #495057;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.footer ul li {
    margin-bottom: 0.5rem;
}

.footer ul li a {
    color: #6c757d;
    transition: color 0.2s;
}

.footer ul li a:hover {
    color: #0d6efd;
}

.footer p {
    color: #6c757d;
}

.footer .copyright {
    color: #adb5bd;
    font-size: 0.875rem;
}

.not-set {
    color: #c55;
    font-style: italic;
}

/* add sorting icons to gridview sort links */
a.asc:after, a.desc:after {
    content: '';
    left: 3px;
    display: inline-block;
    width: 0;
    height: 0;
    border: solid 5px transparent;
    margin: 4px 4px 2px 4px;
    background: transparent;
}

a.asc:after {
    border-bottom: solid 7px #212529;
    border-top-width: 0;
}

a.desc:after {
    border-top: solid 7px #212529;
    border-bottom-width: 0;
}

.grid-view th {
    white-space: nowrap;
}

.hint-block {
    display: block;
    margin-top: 5px;
    color: #999;
}

.error-summary {
    color: #a94442;
    background: #fdf7f7;
    border-left: 3px solid #eed3d7;
    padding: 10px 20px;
    margin: 0 0 15px 0;
}

/* align the logout "link" (button in form) of the navbar */
.nav li > form > button.logout {
    padding-top: 7px;
    color: rgba(0, 0, 0, 0.55);
}

@media(max-width:767px) {
    .nav li > form > button.logout {
        display:block;
        text-align: left;
        width: 100%;
        padding: 10px 0;
    }
}

.nav > li > form > button.logout:focus,
.nav > li > form > button.logout:hover {
    text-decoration: none;
    color: rgba(0, 0, 0, 0.7);
}

.nav > li > form > button.logout:focus {
    outline: none;
}

.form-group {
    margin-bottom: 1rem;
}

.search-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: calc(100% - 48px);
}

.objects-container {
    width: 68%;
    padding: 0 0 20px;
    overflow-y: auto;
    max-width: 890px;
    margin: 0 auto;
}

.map-preview-container,
.map-popup {
    display: none;
}

@media (min-width: 769px) {
    .map-container {
        display: none; /* Скрываем по умолчанию, будет показана через JavaScript */
    }
    
    .map-container[style*="display: block"] {
        display: block !important; /* Перезаписываем стили при программном показе */
    }
}

@media (max-width: 768px) {
    .results-container {
        flex-direction: column;
    }
    
    .map-container {
        display: none;
    }
    
    .objects-container {
        width: 100%;
        padding: 20px 16px;
    }
}

.objects-container ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 1240px) {
    .objects-container ul {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .objects-container ul {
        grid-template-columns: 1fr;
    }
}

.objects-container li {
    margin-bottom: 20px;
}

.objects-container a {
    text-decoration: none;
    color: #000;
}

.objects-container a:hover {
    text-decoration: none;
}

.objects-container img {
    width: 100%;
    height: auto;
    aspect-ratio: 10/9;
    object-fit: cover;
    margin-bottom: 10px;
    border-radius: 12px;
    overflow: hidden;
}

.objects-container h2 {
    font-size: 16px;
    margin: 10px 0;
    color: #000000;
}

.objects-container p {
    width: 100%;
    margin: 5px 0;
    color: #666;
    font-size: 14px;
}

.object-details-container {
    display: flex;
    gap: 30px;
    margin: 20px 16px;
}

.object-info {
    flex: 1;
    max-width: 620px;
}

.object-contact {
    width: 100%;
}

.call-us-block {
    position: sticky;
    top: 80px;
    background: white;
    width: 300px;
    height: 300px;
    border: 1px solid rgb(221, 221, 221);
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    float: right;
}

.call-us-phone-strings{
    display: flex;
    flex-direction: column;
}

.phone-icon {
    font-size: 32px;
    margin-bottom: 15px;
    color: #000;
}

.call-us-block h3 {
    margin: 0 0 10px;
    font-size: 18px;
}

.call-us-block .phone {
    font-size: 20px;
    font-weight: bold;
    color: #000;
    text-decoration: none;
}

.call-us-block-mobile {
    display: none;
}

@media (max-width: 744px) {
    .object-details-container {
        flex-direction: column;
    }
    
    .call-us-block-mobile {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: calc(100% - 20px);
        height: auto;
        margin: 0 10px 10px;
        border-radius: 12px;
        flex-direction: row;
        gap: 15px;
        padding: 15px 20px;
        z-index: 9999;
        background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
        animation: slideUp 0.3s ease-out;
    }

    @keyframes slideUp {
        from {
            transform: translateY(100%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    .call-us-phone-strings {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        width: 100%;
    }
    
    .call-us-block-mobile h3 {
        margin: 0;
        font-size: 14px;
        color: #666;
    }

    .call-us-block-mobile .phone {
        font-size: 16px;
        font-weight: 600;
        color: #007bff;
        margin-left: 10px;
    }
}

.object-view{
    max-width: 1120px;
    margin: auto;
}

.popup_header{
    display: grid;
    justify-content: right;
}


@media (max-width: 480px) {
    .call-us-block-mobile {
        padding: 12px 15px;
        margin: 0 5px 5px;
    }
    
    .call-us-block-mobile .call-us-phone-strings {
        flex-direction: column;
        align-items: center;
        gap: 2px;
    }

    .call-us-block-mobile h3 {
        font-size: 12px;
    }

    .call-us-block-mobile .phone {
        font-size: 14px;
        margin-left: 0;
    }
}

/* Стили для списка опций объекта */
.object-features {
    margin: 20px 0;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eee;
}

.object-features h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
}

.features-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.features-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
}

.features-list li:last-child {
    border-bottom: none;
}

.features-list strong {
    margin-right: 5px;
}

.features-list .text-success {
    color: #28a745;
    font-weight: 500;
}

.features-list .text-danger {
    color: #dc3545;
    font-weight: 500;
}

/* Стили для секции удобств в стиле Airbnb */


.amenities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.amenity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 0;
}

.amenity-icon {
    font-size: 24px;
    color: #222222;
    line-height: 1;
}

.amenity-text {
    font-size: 16px;
    color: #222222;
    font-weight: 400;
}

@media (max-width: 744px) {
    .amenities-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .amenities-section h2 {
        font-size: 20px;
    }
    
    .amenity-text {
        font-size: 15px;
    }
}

.video-section {
    margin: 30px 0;
}

.video-section h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* Соотношение сторон 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Стили для страницы авто */
.car-description {
    padding-bottom: 20px;
}

.description-section {
    margin-bottom: 24px;
}

.description-section p {
    margin-bottom: 0;
}

/* Стили для списка дополнительных услуг */
.extras-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 16px;
}

.extra-item {
    display: flex;
    gap: 12px;
    padding: 8px 0;
}

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

.extra-icon {
    font-size: 24px;
    color: #222222;
    line-height: 1;
}

.extra-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.extra-name {
    font-size: 16px;
    font-weight: 600;
    color: #222222;
}

.extra-description {
    font-size: 14px;
    color: #717171;
    margin-top: 4px;
    overflow-wrap: anywhere;
}

.extra-price {
    font-size: 14px;
    color: #222222;
}

.extra-quantity {
    font-size: 14px;
    color: #222222;
}

/* CSS для кнопки бронирования/оплаты, используемой на всех страницах */
.booking-action-button {
    display: block;
    width: 100%;
    background: linear-gradient(to right, #E61E4D 0%, #E31C5F 50%, #D70466 100%);
    color: white !important;
    font-size: 16px;
    font-weight: 600;
    padding: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.1s ease, background 0.3s;
    text-align: center;
    text-decoration: none;
    margin-top: 10px;
}

.booking-action-button:hover {
    background: linear-gradient(to right, #D70466 0%, #E31C5F 50%, #E61E4D 100%);
    color: white !important;
    text-decoration: none;
    transform: scale(1.01);
}

/* Для мобильной версии */
@media (max-width: 768px) {
    .booking-action-button {
        font-size: 14px;
        padding: 12px;
    }
    
    /* Скрываем кнопку оплаты с id="payment-button" на мобильных устройствах */
    #payment-button {
        display: none;
    }
    
    /* Стили для фиксированной кнопки внизу экрана на мобильных устройствах */
    .mobile-action-button {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 15px;
        background: white;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
        z-index: 1000;
    }
    
    /* Отступ снизу для контента, чтобы он не скрывался под фиксированной кнопкой */
    .has-mobile-button {
        padding-bottom: 70px;
    }
}

/* Скрываем mobile-action-button на десктопах */
@media (min-width: 769px) {
    .mobile-action-button {
        display: none;
    }
}
