body {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif; /* Меняем шрифт на Montserrat */
    background: #f0f4f8;
    color: #0d1b2a;
    min-height: 100vh;
    overflow: hidden;
}

/* Шапка */
.hero-section {
    background: linear-gradient(120deg, #2b2d42, #778da9);
    color: #ffffff;
    padding: 15px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    height: 60px;
    box-sizing: border-box;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 10px;
}

.header-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-family: 'Montserrat', sans-serif;
}

.header-title-sub {
    font-size: 1rem;
    font-weight: 400;
    color: #d3d8e0;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-nav-link {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s ease;
    font-family: 'Montserrat', sans-serif;
}

.header-nav-link:hover {
    color: #e63946;
}

.header-action-btn {
    background: #e63946;
    color: #ffffff;
    border: none;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.header-action-btn:hover {
    background: #d00000;
    transform: scale(1.05);
}

/* Основная область - прозрачный фон */
.search-section {
    position: fixed;
    top: 70px;
    bottom: 70px;
    left: 40px;
    right: 40px;
    background: transparent;
    z-index: 500;
    display: flex;
    flex-direction: column;
    padding: 10px 20px;
}

.search-section .container-fluid {
    flex: 1;
    padding: 0;
    margin: 0;
    height: 100%;
    overflow: hidden;
}

.cards-container {
    height: 100%;
    overflow-y: auto;
    box-sizing: border-box;
    background: transparent;
    padding: 4px;
}

/* Отступы между карточками */
.cards-container .row {
    margin: 0 -12px;
}

.cards-container .col {
    padding: 0 12px 28px 12px;
}

/* Карточки с белым кантом 2px */
.card {
    border: 2px solid #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    background: #ffffff;
    cursor: pointer;
    height: auto;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 30px -12px rgba(0, 0, 0, 0.15);
    border-color: #90EE90;  /* светло-зеленый */
}

/* Декоративная полоска сверху при наведении */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #28a745, #90EE90, #28a745);
    border-radius: 20px 20px 0 0;
    opacity: 0;
    transition: opacity 0.3s;
}

.card:hover::before {
    opacity: 1;
}

/* Контейнер для карты */
.card-map-container {
    position: relative;
    width: 100%;
    flex-shrink: 0;
    overflow: hidden;
    background: #f0f4f8;
}

.card-img-top {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    min-height: 180px;
    max-height: 220px;
    margin: 0;
    box-sizing: border-box;
    display: block;
}

/* Бейджи поверх карты - убираем, так как AdType переносим в metrics-row */
.card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
}

.card-badge .badge {
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.badge-transportation {
    background: #0d6efd !important;
}

.badge-delivery {
    background: #ffc107 !important;
    color: #000 !important;
}

.price-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
}

.price-badge .badge {
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 20px;
    background: #e63946;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-body {
    padding: 0.75rem;
}

/* Материал */
.material-title {
    font-size: 1rem;
    font-weight: 700;
    color: #2b2d42;
    margin-bottom: 8px;
    font-family: 'Montserrat', sans-serif;
}

/* Новая строка с бейджем типа, километражем, объемом и стоимостью */
.metrics-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding: 6px 0;
    border-bottom: 1px solid #e9ecef;
}

/* Стиль для бейджа AdType в metrics-row */
.ad-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #0d6efd;
    color: white;
}

.ad-type-badge.delivery {
    background: #ffc107;
    color: #000;
}

.metric-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #e9ecef;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2b2d42;
}

.metric-item i {
    font-size: 0.8rem;
    color: #6c757d;
}

.price-value {
    font-size: 1rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #28a745;
    background: #e9ecef;
    padding: 4px 10px;
    border-radius: 20px;
}

.price-value i {
    font-size: 0.8rem;
    color: #28a745;
}

.price-per-unit {
    font-size: 0.7rem;
    font-weight: 500;
}

/* Маршрут */
.route-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.8rem;
}

.route-item i {
    min-width: 16px;
    color: #778da9;
    margin-top: 2px;
    font-size: 0.75rem;
}

.route-item .address {
    color: #495057;
    line-height: 1.3;
    word-break: break-word;
    font-size: 0.75rem;
}

/* Тип самосвала и покрытие - увеличенный шрифт */
.spec-info {
    background: #f8f9fa;
    padding: 8px 10px;
    border-radius: 8px;
    margin-top: 8px;
    font-size: 0.8rem;
}

.spec-info i {
    width: 16px;
    margin-right: 6px;
    color: #6c757d;
    font-size: 0.8rem;
}

.spec-info div {
    margin-bottom: 4px;
}

.spec-info div:last-child {
    margin-bottom: 0;
}

/* Контакты */
.contact-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.contact-row i {
    min-width: 16px;
    color: #778da9;
    font-size: 0.75rem;
}

.contact-row a {
    color: #2b2d42;
    text-decoration: none;
    transition: color 0.2s;
}

.contact-row a:hover {
    color: #e63946;
}

.messenger-icons-sm {
    display: inline-flex;
    gap: 8px;
    margin-left: 6px;
}

.messenger-icons-sm a {
    color: #6c757d;
    transition: all 0.2s;
    font-size: 1rem;
}

.messenger-icons-sm a:hover {
    transform: scale(1.1);
}

.messenger-icons-sm a.whatsapp:hover {
    color: #25D366;
}

.messenger-icons-sm a.telegram:hover {
    color: #0088cc;
}

.messenger-icons-sm a.max:hover {
    opacity: 0.8;
}

/* Даты - увеличенный размер */
.date-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #e9ecef;
    flex-wrap: wrap;
}

.date-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8f9fa;
    padding: 5px 12px;
    border-radius: 20px;
    color: #495057;
    font-size: 0.8rem;
    font-weight: 500;
}

.date-item i {
    font-size: 0.75rem;
    color: #e63946;
}

.date-item strong {
    color: #2b2d42;
    font-weight: 600;
    font-size: 0.8rem;
}

.date-item span {
    font-size: 0.8rem;
}

/* Footer карточки */
.card-footer-custom {
    padding: 10px 12px;
    background: transparent;
    border-top: 1px solid #e9ecef;
}

.condition-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 500;
    margin-right: 6px;
}

.condition-badge.prepayment {
    background: #fff3cd;
    color: #856404;
}

.condition-badge.postpayment {
    background: #d1ecf1;
    color: #0c5460;
}

.condition-badge.checkpoint {
    background: #e2e3e5;
    color: #383d41;
}

.btn-outline-custom {
    background: transparent;
    border: 1px solid #e63946;
    color: #e63946;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    transition: all 0.2s;
}

.btn-outline-custom:hover {
    background: #e63946;
    color: white;
}

/* Модальное окно с двухколоночной структурой */
.modal-fullscreen-custom {
    max-width: 95vw;
    margin: 0 auto;
    height: calc(100vh - 60px);
    max-height: calc(100vh - 60px);
}

.modal-fullscreen-custom .modal-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    overflow: hidden;
}

.modal-fullscreen-custom .modal-body {
    flex: 1;
    overflow: hidden;
    padding: 0;
}

.modal-fullscreen-custom .row {
    height: 100%;
    margin: 0;
}

.modal-fullscreen-custom .col-lg-7,
.modal-fullscreen-custom .col-lg-5 {
    height: 100%;
    padding: 0;
}

.modal-map-full {
    width: 100%;
    height: 100%;
    min-height: 400px;
    background: #e9ecef;
}

.modal-details {
    height: 100%;
    overflow-y: auto;
    background: #ffffff;
    padding: 1rem;
    font-family: 'Montserrat', sans-serif;
}

.modal-details p {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9rem;
    line-height: 1.4;
}

.modal-details p:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.modal-details strong {
    display: inline-block;
    min-width: 140px;
    color: #2b2d42;
    font-weight: 600;
}

.modal-details .section {
    margin-bottom: 1rem;
}

.modal-details .section-title {
    font-weight: 600;
    color: #415a77;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    border-left: 3px solid #e63946;
    padding-left: 8px;
}

.modal-details .contact-info {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 12px;
    margin-top: 1rem;
}

.modal-details .contact-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.modal-details .contact-row i {
    width: 20px;
    color: #e63946;
}

.modal-details .messenger-links {
    display: inline-flex;
    gap: 12px;
    margin-left: 10px;
}

.modal-details .messenger-links a {
    color: #6c757d;
    transition: color 0.2s;
}

.modal-details .messenger-links a:hover {
    color: #e63946;
}

/* Для больших экранов */
@media (min-width: 1400px) {
    .modal-fullscreen-custom {
        max-width: 85vw;
    }
}

@media (min-width: 992px) and (max-width: 1399px) {
    .modal-fullscreen-custom {
        max-width: 95vw;
    }
}

/* Адаптивность для мобильных */
@media (max-width: 991.98px) {
    .modal-fullscreen-custom {
        height: 90vh;
        max-height: 90vh;
        margin: 1rem auto;
    }

    .modal-fullscreen-custom .modal-body {
        overflow-y: auto;
    }

    .modal-map-full {
        height: 300px;
    }

    .modal-details {
        height: auto;
        max-height: 400px;
    }

    .modal-details strong {
        min-width: 100px;
    }
}

@media (max-width: 576px) {
    .modal-map-full {
        height: 250px;
    }

    .modal-details {
        padding: 1rem !important;
    }

    .modal-details p {
        font-size: 0.8rem;
    }

    .modal-details strong {
        min-width: 80px;
        font-size: 0.8rem;
    }
}

/* Футер страницы */
.pagination-section {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 12px 0;
    background: linear-gradient(120deg, #2b2d42, #778da9);
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    height: 65px;
    box-sizing: border-box;
    color: #ffffff;
    display: flex;
    align-items: center;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 10px;
}

.footer-contact {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-contact-text {
    font-size: 0.8rem;
    color: #ffffff;
    margin: 0;
}

.footer-btn {
    background: #ffffff;
    color: #e63946;
    border: none;
    padding: 6px 16px;
    border-radius: 25px;
    font-size: 0.8rem;
    font-family: 'Montserrat', sans-serif;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.2s ease;
}

.footer-btn:hover {
    background: #f8f9fa;
    transform: scale(1.05);
}

.footer-disclaimer {
    font-size: 0.7rem;
    max-width: 380px;
    text-align: right;
    position: relative;
    padding-left: 20px;
}

.footer-disclaimer::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23e63946" stroke-width="2"><path d="M12 2L2 19h20L12 2z"/><path d="M12 8v4"/><path d="M12 16h.01"/></svg>') no-repeat center;
    background-size: contain;
    border: 1px solid #ffffff;
    border-radius: 50%;
}

.pagination {
    margin: 0;
}

.page-link {
    background: #ffffff;
    color: #0d1b2a;
    border: none;
    border-radius: 8px;
    margin: 0 4px;
    font-size: 0.85rem;
    transition: background 0.3s, transform 0.2s;
    padding: 6px 12px;
    font-family: 'Montserrat', sans-serif;
}

.page-link:hover {
    background: #e63946;
    color: #ffffff;
    transform: scale(1.05);
}

.page-item.active .page-link {
    background: #e63946;
    color: #ffffff;
}

.page-item.disabled .page-link {
    background: #d3d3d3;
    color: #6c757d;
}

/* Формы */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    font-weight: 500;
    color: #0d1b2a;
    margin-bottom: 5px;
    display: block;
    font-family: 'Montserrat', sans-serif;
}

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #ced4da;
    padding: 8px 12px;
    font-family: 'Montserrat', sans-serif;
}

.form-control:focus, .form-select:focus {
    border-color: #415a77;
    box-shadow: 0 0 5px rgba(65, 90, 119, 0.3);
}

.required::after {
    content: " *";
    color: #e63946;
}

.toggle-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-toggle {
    padding: 6px 15px;
    border-radius: 20px;
    background: #e9ecef;
    color: #0d1b2a;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-toggle.active {
    background: #415a77;
    color: #fff;
}

.inline-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.form-check-input:checked {
    background-color: #415a77;
    border-color: #415a77;
}

.textarea {
    resize: vertical;
}

.pikaday-input {
    width: 100%;
}

#map {
    height: 400px;
    width: 100%;
    border-radius: 10px;
}

.route-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.start-block {
    border: 2px solid #e63946;
    padding: 10px;
    border-radius: 8px;
}

.end-block {
    border: 2px solid #415a77;
    padding: 10px;
    border-radius: 8px;
}

.map-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: 5px solid transparent;
    border-top: 5px solid #e63946;
    border-right: 5px solid #415a77;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    background: rgba(255, 255, 255, 0.9);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.messenger-badges {
    display: inline-flex;
    gap: 8px;
    margin-left: 8px;
}

.messenger-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f5f5f5;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background 0.3s;
}

.messenger-btn:hover {
    transform: translateY(-2px);
}

.messenger-btn.telegram:hover {
    background: #0088cc;
}

.messenger-btn.whatsapp:hover {
    background: #25D366;
}

.messenger-btn.max:hover {
    background: #0066cc;
}

.messenger-btn i, .messenger-btn img {
    transition: filter 0.3s;
}

.messenger-btn:hover i, .messenger-btn:hover img {
    filter: brightness(0) invert(1);
}

@media (max-width: 768px) {
    .cards-container .col {
        padding: 0 10px 20px 10px;
    }

    .card:hover {
        transform: translateY(-3px);
    }

    .card-img-top {
        min-height: 160px;
        max-height: 180px;
    }

    .metrics-row {
        gap: 6px;
    }

    .metric-item {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    .ad-type-badge {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    .price-value {
        font-size: 0.8rem;
        padding: 3px 8px;
    }

    .material-title {
        font-size: 0.9rem;
    }

    .route-item {
        font-size: 0.7rem;
    }

    .date-info {
        gap: 8px;
    }

    .date-item {
        font-size: 0.7rem;
        padding: 4px 10px;
    }

    .date-item span {
        font-size: 0.7rem;
    }

    .spec-info {
        font-size: 0.7rem;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .cards-container .col {
        padding: 0 12px 24px 12px;
    }
}

@media (min-width: 1200px) {
    .card-img-top {
        min-height: 200px;
        max-height: 240px;
    }
}