/* ===== БАЗА ===== */
:root{
  --cart-radius: 16px;
  --cart-shadow: 0 18px 60px rgba(17,17,17,.18);
  --cart-line: rgba(17,17,17,.12);
}

/* Обёртка триггера */
.mycart_wrapp{
  position: relative;
  display: block;
  float: right;
  z-index: 1000;
  height: 40px;
  padding: 3px;
  font-size: 10px;
  margin-right: 210px; /* как было на десктопе */
}

/* Попап корзины */
.mycart_content{
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: none;
  z-index: 1001;

  min-width: 320px;
  max-width: 341px;

  background: rgba(255,255,255,.98);
  backdrop-filter: saturate(1.05) blur(4px);
  border: 1px solid var(--cart-line);
  border-radius: var(--cart-radius);
  box-shadow: var(--cart-shadow);

  padding: 8px 6px 10px;
}

/* Стрелочка */
.mycart_content::before{
  content:"";
  position:absolute;
  top:-8px; right:18px;
  width:14px; height:14px;
  background: inherit;
  border-left: 1px solid var(--cart-line);
  border-top: 1px solid var(--cart-line);
  transform: rotate(45deg);
}

/* Показ попапа при .is-open на .mycart_wrapp (если используешь JS-класс) */
.mycart_wrapp.is-open .mycart_content{ display:block; }

/* ===== Контент ===== */

table.module_cart_detail{
  border:none !important;
  width:100%;
  min-width:270px;
  margin: 1px 0 10px;
  table-layout: auto;
}
table.module_cart_detail tr.even,
table.module_cart_detail tr.odd{
  background: transparent;
}

/* --- Строка товара (внутри одного td) --- */
table.module_cart_detail tr.odd > td,
table.module_cart_detail tr.even > td{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 2px;
  border-bottom:1px dashed var(--cart-line);
}

/* Фото слева */
div.mycart_img{
  flex:0 0 80px;
 /*  width:120px;*/ height:120px;
  margin:0;
  border-radius:12px;
  background:#f6f6f6;
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;
}
div.mycart_img img{max-width:100%; max-height:100%; object-fit:contain;}

/* Название по центру/левее, занимает свободное место */
div.mycart_name{
  flex:1 1 auto;
  margin:0;
  padding:0;
  min-width:0;
  color:#111;
  line-height:1.35;
  font-size:12px;
  font-family:'GothamProRegular', Arial, sans-serif;
  text-align:left;
  overflow:hidden; text-overflow:ellipsis;
}

/* Цена справа одной строкой */
div.mycart_summ{
  flex:0 0 auto;
  margin:0;
  color:#111;
  font-family:'GothamProRegular', Arial, sans-serif;
  font-weight:700;
  font-size:13px;
  white-space:nowrap;
  text-align:right;
}

/* Служебные блоки убираем */
.mycart_content .clear,
div.mycart_qtty, div.delcart, div.delcart a, div.hidden_for_cart{ display:none !important; }

/* --- Блок «СУММА» + кнопки --- */
/* превращаем td с итогом в флекс-контейнер (селектор :has поддерживается в современных браузерах) */
table.module_cart_detail td:has(.mycart_summ_text){
  display:flex;
  flex-wrap:wrap;
  align-items:baseline;
  gap:12px;
  padding:14px 12px 0;
  border-top:1px dashed var(--cart-line);
}

div.mycart_summ_text{
  margin:0; padding:3px; border:0;
  font-size:14px; font-weight:600; color:#111; float: left;
}
div.mycart_summ_total{
  margin-left:auto;
  font-size:14px; font-weight:800; color:#111;
  white-space:nowrap; float: right;
}

/* Кнопки под суммой */
div.mycart_link, div.mycart_checkout_link{ width:100%; }
div.mycart_link{ margin:10px 12px 10px; text-align:center; }
div.mycart_checkout_link{ margin:0; }

div.mycart_link a{
  display:inline-flex;
  align-items:center; justify-content:center;
  height:44px; padding:0 18px;
  border:1px solid #111; border-radius:12px;
  color:#111; background:#fff; text-decoration:none;
  font-size:12px; font-weight:600; letter-spacing:.02em;
}
div.mycart_checkout_link a{
  display:flex; align-items:center; justify-content:center;
  height:52px; width:100%;
  border-radius:14px;
  background:#111; color:#fff; text-decoration:none;
  font-size:13px; font-weight:800; letter-spacing:.08em; text-transform:uppercase;
  transition: transform .15s ease, box-shadow .15s ease;
}
div.mycart_checkout_link a:hover{ transform:translateY(-1px); box-shadow:0 10px 22px rgba(17,17,17,.16); }

/* Заголовок/счётчик около иконки */
.mycart_headertxt{ font-size:10px; }
.mycart_header_name{ color:#0088cc; border-bottom:1px dotted #0088cc; font-size:12px; }
.click_mycart_name{ cursor:pointer; }

/* Позиционирование (совместимость со старым поведеним) */
.mycart_rel_pos{ position:relative; }
.mycart_abs_pos{ position:absolute; }

/* ===== Режимы выравнивания (по желанию) ===== */
/* Центрирование: добавь cart--center на .mycart_content */
.mycart_content.cart--center table.module_cart_detail tr.odd > td,
.mycart_content.cart--center table.module_cart_detail tr.even > td{ justify-content:center; gap:16px; }
.mycart_content.cart--center .mycart_name,
.mycart_content.cart--center .mycart_summ{ text-align:center; }
.mycart_content.cart--center td:has(.mycart_summ_text){ justify-content:center; }

/* По умолчанию — split: текст слева, цена справа */

/* ===== Адаптив ===== */

/* Планшеты/ноутбуки */
@media only screen and (min-width:965px) and (max-width:1024px){
  .mycart_wrapp{ margin-right:20px; z-index:1000; }
}
@media only screen and (min-width:1024px) and (max-width:1200px){
  .mycart_wrapp{ margin-right:0; }
}
@media only screen and (min-width:500px) and (max-width:965px){
  .mycart_wrapp{ margin-right:20px; }
}

/* Мобилки */
@media (max-width:768px){
  .mycart_wrapp{
    position: fixed;
    top: 6px; right: 10px;
    z-index: 1000;
    margin-right: 0;
    text-transform: uppercase;
  }
  .mycart_content{
    position: fixed;
    left: 10px; right: 10px;
    top: 62px;                     /* ниже шапки */
    max-width: none;
    border-radius: 14px;
    display:none;                  /* по умолчанию скрыт */
  }

  table.module_cart_detail tr.odd > td,
  table.module_cart_detail tr.even > td{
    padding:12px 1px; gap:10px;
  }
  .mycart_img{ flex-basis:64px; width:64px; height:64px; border-radius:10px; }
  .mycart_name{ font-size:12px; }
  .mycart_summ{ font-size:13px; }

  table.module_cart_detail td:has(.mycart_summ_text){ padding:12px 10px 0; }
  div.mycart_link{ margin:15px 10px 8px; }
  div.mycart_checkout_link{ margin:0 0px 14px; }
}
/* Сумма и итог в одну линию */
.mycart_summ_text,
.mycart_summ_total {
  display: inline-block;
  vertical-align: middle;
  font-size: 14px;
  font-weight: 600;
  margin-top: 10px;
}

.mycart_summ_total {
  font-weight: 800;
  margin-left: auto;
}

/* Контейнер суммы */
table.module_cart_detail td:has(.mycart_summ_text) {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-top: 1px dashed var(--cart-line);
}

/* Кнопки строго по центру */
.mycart_link,
.mycart_checkout_link {
  text-align: center;
  clear: both;
}
.mycart_link a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* меню открыто (любой из двух классов) → скрываем фикс-корзину */
#s5_responsive_mobile_sidebar.s5_responsive_mobile_sidebar_show_ltr
  ~ #s5_responsive_mobile_top_bar_wrap .mycart_wrapp,
#s5_responsive_mobile_sidebar_body_wrap.s5_responsive_mobile_sidebar_body_wrap_show_ltr
  ~ #s5_responsive_mobile_top_bar_wrap .mycart_wrapp {
  display: none !important;
}
#s5_responsive_mobile_sidebar.s5_responsive_mobile_sidebar_show_ltr
  ~ #s5_responsive_mobile_top_bar_wrap .mycart_wrapp,
#s5_responsive_mobile_sidebar_body_wrap.s5_responsive_mobile_sidebar_body_wrap_show_ltr
  ~ #s5_responsive_mobile_top_bar_wrap .mycart_wrapp {
  transform: translateX(383px);
  transition: transform .28s ease;
  pointer-events: none; /* чтобы клики не перехватывала */
}
.s5_responsive_mobile_sidebar_body_wrap_show_ltr #s5_responsive_mobile_sidebar_body_wrap_inner .mycart_wrapp{

  display: none !important;
}


