/* ============================================
   СТРАНИЦА ДОСТАВКИ - ВЕРСИЯ БЕЗ ДВОЙНОГО СКРОЛЛА
   ============================================ */

/* Принудительное переопределение стилей темы Woodmart */
.page-template-page-delivery .site-content,
.page-template-page-delivery .main-page-wrapper,
.page-template-page-delivery .container,
.page-template-page-delivery .content-area,
.page-template-page-delivery .site-main,
.page-template-page-delivery .wd-content-area,
.page-template-page-delivery .entry-content {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    background: none !important;
    box-shadow: none !important;
    border: none !important;
}

.page-template-page-delivery .woocommerce-breadcrumb,
.page-template-page-delivery .breadcrumbs,
.page-template-page-delivery .entry-title,
.page-template-page-delivery .page-title,
.page-template-page-delivery .entry-meta {
    display: none !important;
}

/* ============================================
   ОСНОВНОЙ WRAPPER
   ============================================ */
.delivery-page-wrapper {
    width: 100%;
    background: #fff;
    padding: 30px 20px;
    box-sizing: border-box;
    min-height: 100vh;
}

/* ============================================
   ГЛАВНЫЙ КОНТЕЙНЕР (без скролла внутри!)
   ============================================ */
.delivery-container {
    display: flex;
    flex-direction: row;
    max-width: 1240px;
    margin: 0 auto;
    gap: 0;
    background: #fff;
    border-radius: 0;
    box-shadow: none;
    overflow: visible; /* ВАЖНО: не hidden! */
    min-height: auto; /* ВАЖНО: не фиксированная высота! */
}

/* ============================================
   ЛЕВАЯ ПАНЕЛЬ (БЕЗ внутреннего скролла!)
   ============================================ */
.delivery-left-panel {
    flex: 0 0 45%;
    padding: 0;
    background: #fff;
    box-sizing: border-box;
    /* УБРАНО: max-height, overflow-y */
    /* Теперь контент течет естественно */
}

.delivery-left-panel h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 24px 0;
    padding: 24px 24px 0 24px;
    color: #333;
    line-height: 1.3;
}

/* ============================================
   ПОЛЕ ВВОДА АДРЕСА
   ============================================ */
.delivery-address-input {
    margin: 0 24px 24px 24px;
}

.delivery-address-input input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
    box-sizing: border-box;
    background: #fff;
}

.delivery-address-input input:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

/* ============================================
   ТИПЫ ТРАНСПОРТА
   ============================================ */
.delivery-vehicle-types {
    margin: 0 24px 24px 24px;
}

.delivery-vehicle-types h3 {
    font-size: 12px;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 8px;
    background: transparent !important;
    overflow: visible !important;
}

.vehicle-grid-single {
    grid-template-columns: 1fr;
}

.vehicle-btn {
    background: #f5f5f5 !important; /* неактивная — светло-серая */
    border: 2px solid #e8e8e8;
    border-radius: 12px; /* всегда закруглённые края */
    padding: 14px 10px;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 75px;
    box-sizing: border-box;
    overflow: hidden;
}

.vehicle-btn:hover {
    background: #fff; /* при наведении — белая */
    border-color: #ff6b35;
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.12);
    transform: translateY(-1px);
}

.vehicle-btn.active {
    background: #ff6b35 !important; /* при выборе — оранжевая */
    border-color: #ff6b35;
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.25);
}

.vehicle-btn.active .vehicle-name,
.vehicle-btn.active .vehicle-desc {
    color: white;
}

.vehicle-icon {
    font-size: 28px;
    line-height: 1;
}

.vehicle-name {
    font-weight: 700;
    font-size: 14px;
    color: #333;
    margin: 2px 0;
    line-height: 1.2;
}

.vehicle-desc {
    font-size: 11px;
    color: #999;
    line-height: 1;
}

/* ============================================
   ЦЕНЫ НА ДОСТАВКУ
   ============================================ */
.delivery-prices {
    margin: 0 24px 24px 24px;
}

.delivery-prices h3 {
    font-size: 12px;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.price-loading {
    text-align: center;
    padding: 20px;
    color: #999;
    font-style: italic;
    background: #f8f8f8;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
}

.price-item {
    background: #f8f8f8;
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    overflow: hidden;
}

.price-item:hover {
    border-color: #ff6b35;
    box-shadow: 0 1px 4px rgba(255, 107, 53, 0.1);
}

.price-item.active {
    background: #ff6b35;
    border-color: #ff6b35;
    color: white;
}

.price-item.active .price-amount,
.price-item.active .price-subtitle,
.price-item.active .price-arrow {
    color: white;
}

.price-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
}

.price-amount {
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.price-arrow {
    font-size: 12px;
    color: #666;
    transition: transform 0.2s;
}

.price-subtitle {
    font-size: 12px;
    color: #666;
    padding: 0 16px 12px 16px;
    margin-top: -4px;
}

.price-item.active .price-subtitle {
    color: rgba(255, 255, 255, 0.95);
}

.price-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(255, 255, 255, 0.95);
}

.price-details.active {
    max-height: 150px;
    padding: 12px 16px 16px 16px;
}

.price-description {
    font-size: 12px;
    color: #555;
    line-height: 1.5;
    margin-bottom: 8px;
}

.price-note {
    font-size: 11px;
    color: #888;
    font-style: italic;
}

/* ============================================
   ИНФОРМАЦИОННАЯ ЗАМЕТКА
   ============================================ */
.delivery-note {
    background: #fff5f1;
    border-left: 3px solid #ff6b35;
    padding: 14px 16px;
    border-radius: 6px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 12px;
    line-height: 1.5;
    margin: 6px 0 24px 0; /* Убираем боковые отступы, чтобы ширина совпадала с price-item */
    box-sizing: border-box; /* Учитываем padding в общей ширине */
}

.note-icon {
    font-size: 20px;
    flex-shrink: 0;
    display: none; /* Скрываем иконку человечка */
}

/* ============================================
   КНОПКИ-ТАБЫ (как у Петровича)
   ============================================ */
.delivery-info-tabs {
    margin: 0 24px 30px 24px;
}

.tabs-nav {
    display: flex;
    gap: 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
}

.tab-btn {
    flex: 1;
    padding: 14px 20px;
    background: #f5f5f5 !important; /* Неактивная - серая */
    border: none;
    border-right: 1px solid #e8e8e8;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #333 !important; /* Неактивная - темно-серый текст */
    transition: all 0.2s ease;
    text-align: center;
}

.tab-btn:last-child {
    border-right: none;
}

.tab-btn:hover {
    background: #ffe8e0 !important;
    color: #ff6b35 !important;
}

.tab-btn.active {
    background: #ff6b35 !important; /* Активная - оранжевая */
    color: white !important; /* Активная - белый текст */
}

.tab-content {
    display: none;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-top: 12px;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

.tab-content.active {
    display: block;
}

.tab-content h3 {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
}

.tab-content ul {
    margin: 12px 0;
    padding-left: 20px;
}

.tab-content li {
    margin-bottom: 8px;
}


/* ============================================
   ПРАВАЯ ПАНЕЛЬ С КАРТОЙ (sticky!)
   ============================================ */
.delivery-right-panel {
    flex: 0 0 60%;
    position: -webkit-sticky; /* Для Safari */
    position: sticky;
    top: 20px !important; /* Отступ от верха при прилипании - карта будет следовать за скроллом */
    height: fit-content;
    max-height: calc(100vh - 40px); /* Максимальная высота = высота экрана минус отступы */
    background: #e0e0e0;
    align-self: flex-start; /* ВАЖНО: чтобы sticky работал правильно */
    z-index: 10; /* Чтобы карта была поверх других элементов при скролле */
    will-change: transform; /* Оптимизация для плавного скролла */
}

.yandex-map-container {
    width: 100%;
    height: 600px; /* Фиксированная высота карты */
    position: relative;
}

/* ============================================
   РЕЗУЛЬТАТ РАСЧЕТА НА КАРТЕ
   ============================================ */
.delivery-result {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #212326;
    color: #fff;
    border-radius: 10px;
    padding: 16px 20px;
    min-width: 220px;
    z-index: 1000;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.delivery-result.hidden {
    display: none;
}

.delivery-result h4 {
    font-size: 13px;
    margin-bottom: 8px;
    color: #fff;
    font-weight: 600;
}

.result-zone {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 6px;
}

.result-price {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.result-extra {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

/* ============================================
   АДАПТИВНОСТЬ
   ============================================ */

/* Планшеты */
@media (max-width: 1024px) {
    .delivery-container {
        flex-direction: column;
        max-width: 95%;
    }

    .delivery-left-panel {
        flex: 1;
        width: 100%;
        display: flex;
        flex-direction: column;
    }

    /* Порядок элементов на планшетах: h1 → адрес → карта → транспорт → цены → табы */
    .delivery-left-panel h1 {
        order: 1;
    }

    .delivery-address-input {
        order: 2;
    }

    .delivery-right-panel {
        order: 3; /* Карта после адреса */
        flex: 1;
        width: 100%;
        position: relative !important;
        top: 0 !important;
        max-height: none;
        margin: 20px 0;
    }

    .delivery-vehicle-types {
        order: 4;
    }

    .delivery-prices {
        order: 5;
    }

    .delivery-info-tabs {
        order: 6;
    }

    .yandex-map-container {
        height: 500px;
    }
}

/* Мобильные устройства */
@media (max-width: 768px) {
    .delivery-page-wrapper {
        padding: 15px 10px;
    }

    .delivery-container {
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    .delivery-left-panel {
        display: flex;
        flex-direction: column;
    }

    /* Порядок элементов на мобильных: h1 → адрес → карта → транспорт → цены → табы */
    .delivery-left-panel h1 {
        font-size: 22px;
        padding: 20px 16px 0 16px;
        margin-bottom: 20px;
        order: 1;
    }

    .delivery-address-input {
        order: 2;
        margin: 0 16px 20px 16px;
    }

    .delivery-right-panel {
        order: 3 !important; /* Карта после адреса */
        position: relative !important;
        top: 0 !important;
        width: 100% !important;
        margin: 0 0 20px 0 !important;
    }

    .delivery-vehicle-types {
        order: 4;
        margin: 0 16px 20px 16px;
    }

    .delivery-prices {
        order: 5;
        margin: 0 16px 20px 16px;
    }

    .delivery-info-tabs {
        order: 6;
        margin: 0 16px 20px 16px;
    }

    .delivery-note {
        margin-left: 16px;
        margin-right: 16px;
    }

    .vehicle-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px;
    }

    .vehicle-btn {
        min-height: 70px;
        padding: 12px 8px;
    }

    .vehicle-icon {
        font-size: 24px;
    }

    .vehicle-name {
        font-size: 13px;
    }

    .vehicle-desc {
        font-size: 11px;
    }

    .yandex-map-container {
        height: 350px;
    }

    .delivery-result {
        top: 12px;
        left: 12px;
        right: 12px;
        min-width: auto;
        padding: 12px 16px;
    }
}

/* Очень маленькие экраны */
@media (max-width: 480px) {
    .delivery-page-wrapper {
        padding: 10px 5px;
    }

    .delivery-left-panel h1 {
        font-size: 20px;
        padding: 16px 12px 0 12px;
        order: 1;
    }

    .delivery-address-input {
        order: 2;
        margin: 0 12px 16px 12px;
    }

    .delivery-right-panel {
        order: 3 !important;
        margin: 0 0 16px 0 !important;
    }

    .delivery-vehicle-types {
        order: 4;
        margin: 0 12px 16px 12px;
    }

    .delivery-prices {
        order: 5;
        margin: 0 12px 16px 12px;
    }

    .delivery-info-tabs {
        order: 6;
        margin: 0 12px 16px 12px;
    }

    .delivery-note {
        margin-left: 12px;
        margin-right: 12px;
    }

    .vehicle-grid {
        gap: 6px;
    }

    .vehicle-btn {
        min-height: 65px;
        font-size: 11px;
    }

    .price-header {
        padding: 10px 14px;
    }

    .price-subtitle {
        padding: 0 14px 10px 14px;
    }

    .yandex-map-container {
        height: 300px;
    }
}

/* ============================================
   ДОПОЛНИТЕЛЬНЫЕ ФИКСЫ ДЛЯ ТЕМЫ WOODMART
   ============================================ */

/* Убираем все возможные padding/margin от темы */
.page-template-page-delivery .site {
    margin: 0 !important;
    padding: 0 !important;
}

.page-template-page-delivery .site-content {
    margin: 0 !important;
    padding: 0 !important;
}

/* Убираем белый фон от темы если есть */
.page-template-page-delivery .main-page-wrapper {
    background: transparent !important;
}

/* Контейнер должен быть на всю ширину */
.page-template-page-delivery .container {
    max-width: 100% !important;
    padding: 0 !important;
}



/* === ВОССТАНОВЛЕНИЕ ХЭДЕРА НА СТРАНИЦЕ ДОСТАВКИ === */
.page-template-page-delivery .whb-header,
.page-template-page-delivery .site-header {
  width: 100% !important;
  background: #fff !important;
}

/* === ВОССТАНОВЛЕНИЕ ХЭДЕРА И ФУТЕРА С ШИРИНОЙ, КАК В ТЕМЕ === */
.page-template-page-delivery .whb-header .container,
.page-template-page-delivery .whb-general-header .container,
.page-template-page-delivery .site-header .container,
.page-template-page-delivery footer.site-footer .container {
  max-width: var(--wd-container-width, 1570px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 15px !important;
  padding-right: 15px !important;
  width: auto !important;
  box-sizing: border-box !important;
}


.page-template-page-delivery .whb-header .whb-row {
  justify-content: space-between !important;
  gap: 0 !important;
}