/* изгой.рф — летающая корзина. Файл: cdek-direct/assets/izgoi-cart.css */

.ntgoi-cart {
    /* Отступ от края. Панель ниже привязывается к тому же значению. */
    --nt-cart-gap: 20px;
    position: fixed;
    right: var(--nt-cart-gap);
    /* Компьютер: центр кнопки совпадает с центром логотипа. */
    top: 87px;
    /* Без этой строки fixed-обёртка растягивается до низа экрана, и панель
       (позиционируется от неё) уезжает за пределы видимой области. */
    height: fit-content;
    width: fit-content;
    z-index: 9998;
    font-size: 15px;
    line-height: 1.35;
}

/* Кнопка-кружок */
.ntgoi-cart-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #333;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
    transition: transform .15s ease, box-shadow .15s ease;
}
.ntgoi-cart-toggle svg { width: 32px; height: 32px; }
.ntgoi-cart-toggle:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0, 0, 0, .3); }
.ntgoi-cart-toggle:focus { outline: 2px solid #607d8b; outline-offset: 2px; }

.ntgoi-cart-count {
    position: absolute;
    top: -2px;
    right: -2px;
    box-sizing: border-box;
    min-width: 25px;
    height: 25px;
    padding: 0 6px;
    border-radius: 11px;
    background: #d63638;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 25px;
    text-align: center;
}
.ntgoi-cart-count.is-empty { display: none; }


/* Подёргивание значка при добавлении товара */
@keyframes ntgoi-cart-shake {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(-12deg); }
    40% { transform: rotate(10deg); }
    60% { transform: rotate(-8deg); }
    80% { transform: rotate(6deg); }
}
.ntgoi-cart-toggle.is-shaking { animation: ntgoi-cart-shake .5s ease; }

/* Панель */
.ntgoi-cart-panel {
    position: absolute;
    top: calc(100% + 10px);
    /* Панель шире обёртки — компенсируем её отступ от края. */
    right: calc(-1 * var(--nt-cart-gap));
    display: flex;
    flex-direction: column;
    width: 440px;
    max-width: 92vw;
    max-height: 70vh;
    border-radius: 8px;
    background: #333;
    color: #eee;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: transform .2s ease, opacity .2s ease, visibility .2s;
}
.ntgoi-cart.is-open .ntgoi-cart-panel { transform: none; opacity: 1; visibility: visible; }

.ntgoi-cart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid #4a4a4a;
}
.ntgoi-cart-title { font-size: 17px; font-weight: 700; }
.ntgoi-cart-close {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #4a4a4a;
    color: #ccc;
    font-size: 20px;
    line-height: 28px;
    cursor: pointer;
}
.ntgoi-cart-close:hover { background: #4a4a4a; }

.ntgoi-cart-body { flex: 1 1 auto; overflow-y: auto; padding: 8px 18px; }
.ntgoi-cart-empty { padding: 28px 0; color: #999; text-align: center; }

.ntgoi-cart-items { margin: 0; padding: 0; list-style: none; }
.ntgoi-cart-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #4a4a4a;
}
.ntgoi-cart-thumb img { display: block; width: 56px; height: 56px; object-fit: cover; border-radius: 6px; }
.ntgoi-cart-info { flex: 1 1 auto; min-width: 0; }
.ntgoi-cart-name {
    display: block;
    color: #eee;
    font-weight: 600;
    text-decoration: none;
}
.ntgoi-cart-name:hover { color: #8fb3c4; }
.ntgoi-cart-qty { display: block; margin-top: 4px; color: #aaa; font-size: 14px; }
/* Кнопки количества внутри панели */
.ntgoi-cart-step { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; }
.ntgoi-cart-step button { width: 26px; height: 26px; padding: 0; border: 1px solid #607d8b; border-radius: 50%; background: #607d8b !important; color: #fff; font-size: 16px; line-height: 24px; cursor: pointer; }
.ntgoi-cart-step button:hover { background: #4e6a78; border-color: #4e6a78; color: #fff; }
.ntgoi-cart-step button:disabled { opacity: .5; cursor: default; }
/* Поле количества. Стили темы перебиваем принудительно — иначе оно огромное и тёмное. */
.ntgoi-cart .ntgoi-cart-num,
.ntgoi-cart-panel .ntgoi-cart-num {
    box-sizing: border-box !important;
    width: 48px !important;
    min-width: 0 !important;
    max-width: 48px !important;
    height: 30px !important;
    min-height: 0 !important;
    padding: 0 4px !important;
    margin: 0 !important;
    border: 1px solid #444 !important;
    border-radius: 6px !important;
    background: #3d3d3d !important;
    color: #eee !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 28px !important;
    text-align: center !important;
    box-shadow: none !important;
    -moz-appearance: textfield;
}
.ntgoi-cart-num::-webkit-outer-spin-button, .ntgoi-cart-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.ntgoi-cart-remove {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #4a4a4a;
    color: #bbb;
    font-size: 18px;
    line-height: 24px;
    text-align: center;
    text-decoration: none;
}
.ntgoi-cart-remove:hover { background: #4a2b2b; color: #e57373; }

.ntgoi-cart-foot {
    padding: 16px 18px 18px;
    border-top: 1px solid #4a4a4a;
    background: #3d3d3d;
}
.ntgoi-cart-sum { margin-bottom: 12px; font-size: 16px; }
.ntgoi-cart-sum strong { font-size: 17px; }
.ntgoi-cart-checkout {
    display: block;
    padding: 12px 16px;
    border-radius: 6px;
    background: #607d8b;
    color: #fff !important;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}
.ntgoi-cart-checkout:hover { background: #54707c; color: #fff; }
.ntgoi-cart-to-cart {
    display: block;
    margin-top: 8px;
    color: #aaa;
    font-size: 14px;
    text-align: center;
    text-decoration: underline;
}

/* Прокрутка внутри панели не должна «толкать» страницу */
.ntgoi-cart.is-open { touch-action: none; }

@media (max-width: 480px) {
    .ntgoi-cart {
    --nt-cart-gap: 14px;
    /* Телефон: выше на половину высоты значка (32px), иначе он задевает меню. */
    top: 38px;
  }
    .ntgoi-cart-toggle { width: 64px; height: 64px; }
    .ntgoi-cart-panel { width: 100vw; max-width: 100vw; }
}


/* --- Мобильное меню: отдельные кнопки вместо выпадающего списка --- */
@media (max-width: 48em) {
  /* Кнопка-гамбургер больше не нужна: все пункты видны сразу. */
  .navigation-top .menu-toggle { display: none; }

  .js .main-navigation ul,
  .main-navigation ul {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
  }

  .main-navigation li { display: block; width: auto; }

  /* Под логотипом зиял разрыв 139px — убираем. */
  .custom-header { margin-bottom: 0 !important; }

  .main-navigation a:hover { background: #4a4a4a; }

  .main-navigation a {
    display: block;
    padding: 8px 13px;
    font-size: 13px;
    line-height: 1.2;
    border: 1px solid #444;
    border-radius: 18px;
    /* Тон шапки: светлые кнопки на тёмной полосе выглядели чужеродно. */
    background: #333;
    color: #eee;
  }
}
