/* === Checkout: layout === */
.checkout .row-full {
    gap: 20px !important;
}
.checkout__layout {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 32px;
    align-items: flex-start;
}
.checkout__main {
  margin-top: 20px;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}
.checkout__sidebar {
  width: 293px;
  margin-top: 20px;
}
@media (min-width: 1201px) {
  .checkout__sidebar {
    position: sticky;
    top: 20px;
    align-self: flex-start;
  }
}
@media screen and (min-width: 768px) and (max-width: 1200px) {
  .checkout__layout {
    flex-direction: column;
  }
  .checkout__sidebar {
    width: 100%;
    order: -1;
  }
}
@media screen and (max-width: 767px) {
  .checkout__layout {
    flex-direction: column;
  }
  .checkout__sidebar {
    width: 100%;
    order: -1;
  }
  .checkout__main {
    width: 100%;
  }
}

/* === Checkout: choice__btn label fill === */
/* Растягиваем label на всю карточку, чтобы клик срабатывал по всему блоку */
.choice__btn .inner {
    flex: 1;
}

/* === Checkout: delivery list === */
.delivery-list-items {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 1fr;
    gap: 16px;
    margin-top: 16px;
}
@media screen and (max-width: 767px) {
    .delivery-list-items {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
    }
}
.delivery-list-items .choice__btn {
    overflow: hidden;
    height: 100%;
    background-color: #f4f4f5;
    border: 1px solid transparent;
}
.delivery-list-items .choice__btn:has(input:checked) {
    background-color: #fff;
    border: 2px solid #ef713b;
}
.delivery-list-items .choice__btn .head {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: hidden;
}
.delivery-list-items .choice__btn .head .head-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.delivery-list-items .choice__btn .head input[type="radio"] {
    flex-shrink: 0;
}
.delivery-list-items .choice__btn .caption {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.delivery-calculating {
    margin-top: 8px;
    font-size: 14px;
}
.delivery-preloader {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    padding: 24px 0;
}
.delivery-preloader span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ef713b;
    animation: delivery-bounce 0.9s ease-in-out infinite;
}
.delivery-preloader span:nth-child(2) { animation-delay: 0.15s; }
.delivery-preloader span:nth-child(3) { animation-delay: 0.3s; }
@keyframes delivery-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40%           { transform: scale(1);   opacity: 1; }
}

/* === Checkout: delivery === */
.delivery__choice {
    flex-wrap: nowrap !important;
    justify-content: flex-start;
}
.delivery__choice .left {
    margin-left: auto;
}
.delivery_line .row {
    justify-content: center;
}
.radio__wrap {
    margin-left: 12px;
}
.radio {
    display: flex;
    align-items: center;
}
.radio input[type="radio"] {
  flex-shrink: 0;
}

/* === Checkout: input size === */
.checkout .input-group input,
.checkout .input-group--transport input {
    height: auto;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 400;
}
.checkout .input-group input:focus,
.checkout .input-group:has(input:valid) input {
    padding-top: 10px;
}
.checkout .input-group label {
    font-size: 14px;
    position: static;
    transform: none;
    display: block;
    margin-bottom: 4px;
    color: #858585;
}
.checkout .input-group:focus-within label,
.checkout .input-group:has(input:valid) label {
    font-size: 14px;
    top: auto;
}

/* === Checkout: select fix === */
/* Сброс глобальных стилей select для страницы чекаута */
.checkout .select,
.checkout .selectcompany {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    height: auto;
    padding: 10px 36px 10px 12px;
    font-size: 14px;
    font-weight: 400;
    text-transform: none;
    margin-bottom: 8px;
}
.checkout .select:focus,
.checkout .selectcompany:focus {
    border: 1px solid #828487;
    border-radius: 8px;
    border-bottom: 1px solid #828487;
}
.checkout .select option,
.checkout .selectcompany option {
    text-transform: none;
    padding: 6px 12px;
    font-size: 14px;
}
.checkout select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
/* Терминалы Деловых линий (BX.Dellin.init() рендерит #terminals с классом bx-soa-customer-select) */
#dellin_pvz #terminals {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 400;
    text-transform: none;
    background-color: #eff0f0;
    border: none;
    border-radius: 8px;
    outline: none;
    appearance: none;
    margin: 0;
}

/* === Checkout: validation === */
.input-group.group_error input,
.input-group.group_error select,
.input-group.group_error textarea {
    border-color: #e53935;
}
.input-group.group_error label {
    color: #e53935;
}
.text__error-js {
    color: #e53935;
    font-size: 12px;
    margin-top: 4px;
}

/* === Checkout: map container === */
.pickup__delivery__map {
    position: relative;
    width: 100%;
    height: 550px;
}
.delivery-map-slot {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.delivery-map-slot > div {
    width: 100%;
    height: 100%;
}

/* Переопределяем фиксированные ширины виджетов карт */
#SDEK_map,
#PECOM_map {
    width: 100% !important;
}
#DELLIN_map {
    width: 100% !important;
    height: 100% !important;
}

/* === Dellin: info-панель (оверлей слева, как у СДЭК/ПЭК) === */
#dellin_pvz {
    position: relative;
    width: 100%;
    height: 100%;
}
#dellin_info {
    position: absolute;
    top: 0;
    left: 10px;
    width: 245px;
    height: calc(100% - 20px);
    background: white;
    border-radius: 5px;
    box-shadow: 0 0 5px #5D5D5D;
    overflow: hidden;
    z-index: 1;
}
#dellin_sign {
    height: 38px;
    line-height: 38px;
    font-size: 14px;
    padding: 0 10px;
    border-bottom: 1px solid #e3e3e3;
    flex-shrink: 0;
}
.dellin_all-items {
    height: calc(100% - 38px);
    overflow-y: auto;
}
#DELLIN_wrapper {
    width: 100% !important;
    height: auto !important;
    background-color: transparent;
}
#DELLIN_wrapper p {
    cursor: pointer;
    padding: 5px 6px;
    margin: 5px 6px;
    font-size: 12px;
}
#DELLIN_wrapper p:hover,
#DELLIN_wrapper p.sdek_chosen {
    background-color: #ebebeb;
}

/* === Мобилка: инфо-блок под картой === */
@media screen and (max-width: 767px) {
    .pickup__delivery__map {
        height: 600px;
    }

    /* SDEK */
    #SDEK_pvz1 {
        display: flex !important;
        flex-direction: column !important;
    }
    #SDEK_map {
        float: none !important;
        height: 350px !important;
        order: 1;
    }
    #SDEK_info {
        display: block !important;
        position: static !important;
        float: none !important;
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        box-shadow: none !important;
        order: 0;
    }
    .SDEK_all-items {
        display: block !important;
        width: 100% !important;
        max-height: 200px;
        overflow-y: auto;
    }
    #SDEK_wrapper,
    #SDEK_ten {
        width: 100% !important;
        height: auto !important;
    }

    /* PECOM */
    #pecom_pvz {
        display: flex !important;
        flex-direction: column !important;
    }
    #PECOM_map {
        float: none !important;
        height: 350px !important;
        order: 1;
    }
    #pecom_info {
        display: block !important;
        position: static !important;
        float: none !important;
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        box-shadow: none !important;
        order: 0;
    }
    .pecom_all-items {
        display: block !important;
        width: 100% !important;
        max-height: 200px;
        overflow-y: auto;
    }
    #pecom_wrapper,
    #pecom_ten {
        width: 100% !important;
        height: auto !important;
    }

    /* Dellin */
    #dellin_pvz {
        display: flex !important;
        flex-direction: column !important;
    }
    #DELLIN_map {
        height: 350px !important;
        order: 1;
    }
    #dellin_info {
        position: static !important;
        width: 100% !important;
        height: auto !important;
        box-shadow: none !important;
        border-radius: 0;
        order: 0;
    }
    .dellin_all-items {
        height: auto !important;
        max-height: 200px;
        overflow-y: auto;
    }
}

/* === Checkout: Rusbelt PVZ map === */
#rusbelt_pvz {
    position: relative;
    width: 100%;
    height: 100%;
}
#RUSBELT_map {
    width: 100%;
    height: 100%;
}
#RUSBELT_info {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 245px;
    height: calc(100% - 20px);
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 0 5px #5d5d5d;
    overflow: hidden;
    z-index: 1;
    display: flex;
    flex-direction: column;
}
#RUSBELT_sign {
    height: 38px;
    line-height: 38px;
    font-size: 14px;
    padding: 0 10px 0 44px;
    background: url('/local/templates/rusbelt2025/assets/images/logo.svg') no-repeat 10px center / auto 18px;
    border-bottom: 1px solid #e3e3e3;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#RUSBELT_wrapper { overflow-y: auto; flex: 1; background-color: #fafafa; }
#RUSBELT_wrapper p {
    margin: 5px 6px;
    padding: 5px 6px;
    font-size: 12px;
    cursor: pointer;
    border-bottom: none;
}
#RUSBELT_wrapper p:hover,
#RUSBELT_wrapper p.active { background-color: #fff3ee; color: #ef713b; border-radius: 3px; }
@media screen and (max-width: 767px) {
    #rusbelt_pvz {
        display: flex !important;
        flex-direction: column !important;
    }
    #RUSBELT_map {
        height: 350px !important;
        order: 1;
    }
    #RUSBELT_info {
        position: static !important;
        width: 100% !important;
        height: auto !important;
        max-height: 200px;
        overflow-y: auto;
        box-shadow: none !important;
        border-radius: 0;
        order: 0;
    }
}

/* === Sidebar: список товаров === */
.order__basket__items {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.order__basket__item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}
.order__basket__item__name {
    font-size: 13px;
    line-height: 1.4;
}
.order__basket__item__qty {
    font-size: 12px;
}
.order__basket__item__sum {
    font-size: 13px;
    font-weight: 500;
}

/* === Sidebar: сохранённые адреса доставки === */
.checkout__saved-delivery {
    padding: 28px 20px;
    border: thin dashed #a0a3a7;
    border-radius: 8px;
    margin-top: 16px;
}
.checkout__saved-delivery__header {
    flex-direction: row;
    gap: 6px;
    align-items: center;
    cursor: pointer;
    user-select: none;
}
#checkout__saved-delivery__body {
    display: none;
    margin-top: 16px;
}
.checkout__saved-delivery.is-open #checkout__saved-delivery__body {
    display: block;
}
#checkout__saved-delivery__body .select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

