/* cart.css (НОВАЯ ВЕРСИЯ) */
.cart-page-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
}

.cart-page-title {
    font-size: 36px;
    font-weight: 500;
    color: #68A1D6;
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-page-title a {
    font-size: 28px;
    color: #adb5bd;
    text-decoration: none;
    transition: color 0.2s, transform 0.2s;
}

.cart-page-title a:hover {
    color: #6c757d;
    transform: scale(1.1);
} 

.cart-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: flex-start;
}

/* Список товаров */
.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 50px;
}

.cart-item-card {
    display: flex;
    gap: 20px;
    border-radius: 16px;
    position: relative;
    align-items: center;
}

.cart-item-image {
    flex-shrink: 0;
    width: 250px;
    height: 250px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cart-item-image img {
    object-fit: cover;
}

.cart-item-details {
    flex-grow: 1;
    display: flex; /* Добавлено для управления вложенными элементами */
    flex-direction: column; /* Элементы внутри будут в столбик */
}

.cart-item-name {
    font-size: 28px;
    font-weight: 700;
    color: #68A1D6;
    margin: 0 0 5px 0;
}

/* ИЗМЕНЕНИЕ: Добавлен класс .cart-item-days */
.cart-item-form,
.cart-item-days {
    font-size: 20px;
    color: #68A1D6;
    margin-bottom: 8px;
}
.composition-label {
    font-size: 20px;
    color: #68A1D6;
}

/* ===== НАЧАЛО ИЗМЕНЕНИЯ: СТИЛИ ДЛЯ ОБЕРТКИ СОСТАВА ===== */

/* Новый контейнер, который включает и заголовок, и таблетки */
.cart-item-composition-wrapper {
    display: flex; /* Располагаем элементы в строку */
    flex-wrap: wrap; /* Разрешаем перенос на новую строку */
    align-items: center; /* Выравниваем по вертикали */
    gap: 8px; /* Одинаковый отступ между всеми элементами */
    margin-bottom: auto; /* Заставляет этот блок занять все доступное место, отодвигая футер вниз */
    padding-bottom: 20px; /* Отступ от футера */
}



.composition-pill {

    color: #68A1D6;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid;
    border-color: #68A1D6;
}

/* ===== УДАЛЕН БЛОК .cart-item-price-and-controls ===== */


/* ===== НОВЫЙ СТИЛЬ ДЛЯ "ПОДВАЛА" КАРТОЧКИ ===== */
.cart-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto; /* Прижимает этот блок к низу .cart-item-details */
}

.cart-item-price {
    font-size: 30px; /* Немного увеличим для акцента */
    font-weight: 600;
    color: #4680B6;
    white-space: nowrap;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 20px;
    background-color: rgba(104, 161, 214, 0.7);
    border-radius: 20px;
    padding: 4px;
}

.quantity-btn {

    color: #fff;
    width: 28px;
    height: 28px;

    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background-color 0.2s, color 0.2s;
    border: none;
    background: none;
}



.quantity-value {
    font-size: 16px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    color: #fff;
}

.cart-item-remove {
    position: absolute;
    top: 0px;
    right: 0px;
    font-size: 40px;
    font-weight: 500;
    color: #68A1D6;
    text-decoration: none;
    transition: color 0.2s, transform 0.2s;
}

.cart-item-remove:hover {
    color: #dc3545;
    transform: scale(1.2);
    text-decoration: none;
}

.cart-item-remove:hover::after {
    width: 0;
}

/* Блок Итога */
.cart-summary-box {
    background-color: #f8f9fa;
    padding: 25px;
    border-radius: 16px;
    position: sticky;
    top: 100px; /* Отступ от верха, если шапка фиксированная */
}

.cart-summary-box h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #68A1D6;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 20px;
    margin-bottom: 25px;
}
.cart-total span {
    color: #68A1D6;
    font-weight: 600;
}

.cart-total-value {
    font-weight: 700;
    font-size: 22px;
    color: #4680B6;
}

.checkout-button {
    width: 100%;
    padding: 14px;
    font-size: 18px;
    background-color: #68A1D6;
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.checkout-button:hover {
    background-color: #5a8dbb;
    transform: scale(1.02);
}
.checkout-button:hover::after {
    width: 0;
}

/* Блок "Хорошее дополнение" */
.cross-sell-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #e9ecef;
}

.cross-sell-section h2 {
    text-align: center;
    font-size: 28px;
    color: #4680B6;
    margin-bottom: 30px;
}

.cross-sell-carousel {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc(25% - 15px);
    gap: 20px;
    overflow-x: auto;
    padding: 10px;
    -ms-overflow-style: none; /* IE и Edge */
    scrollbar-width: none; /* Firefox */
}
.cross-sell-carousel::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}


.cross-sell-item {
    text-decoration: none;
    color: inherit;
    display: block;

    border-radius: 12px;
    padding: 15px;

    transition: transform 0.2s, box-shadow 0.2s;
}

.cross-sell-item:hover {
    transform: translateY(-5px);

}
.cross-sell-item:hover::after {
    width: 0;
}

.cross-sell-item img {
    width: 100%;

    object-fit: contain;
    margin-bottom: 10px;
}

.cross-sell-item-name {
    font-weight: 600;
    text-align: center;
    font-size: 22px;
    color: #68A1D6;
}

/* Пустая корзина */
.cart-empty-message { text-align: center; padding: 50px 20px; background-color: #f8f9fa; border-radius: 12px; }
.cart-empty-message p { font-size: 20px; color: #6c757d; margin-bottom: 30px; }
.cart-empty-message .order-btn { display: inline-block; width: auto; padding: 12px 30px; }

/* 1. Стили для общего контейнера .wrapperCartTitle */
.wrapperCartTitle {
  display: flex;
  align-items: center; 
  gap: 15px;           
  position: relative;
  padding-bottom: 10px; 
}

/* 2. Создаем саму линию с помощью псевдоэлемента ::after */
.wrapperCartTitle::after {
  content: '';
  width: 100%; 
  height: 1px;
  background: linear-gradient(to right, #7EAFDC, #68A1D6);
  border-radius: 2px;
  position: absolute;
  bottom: 0;
  left: 0;
}

/* 3. Важный штрих: сброс отступов у заголовка */
.wrapperCartTitle > h1.cart-page-title {
  margin: 0;
}



.wrapperCartTitle img {
    width: 48px;
    height: 48px;
}




.form-title {
    font-weight: 700;
}

@media (max-width: 360px) {
    .wrapperCartTitle {
        flex-direction: column;
    }
}
/* Адаптивность */
@media (max-width: 992px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }
    .cart-summary-box {
        position: static;
    }
}

@media (max-width: 767px) {
    .cart-item-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .cart-item-details {
       width: 100%; /* Занимает всю ширину на мобильных */
    }
    /* Старый блок для .cart-item-price-and-controls удален, 
       новый .cart-item-footer будет хорошо выглядеть по умолчанию */

    .cart-item-remove {
        top: 10px;
        right: 10px;
    }
    .cross-sell-carousel {
        grid-auto-columns: calc(50% - 10px);
    }
}


/* cart.css */

/* ... (весь ваш существующий код) ... */


/* ========================================================== */
/* == НОВЫЕ СТИЛИ ДЛЯ РАЗДЕЛЕНИЯ ДЕСКТОПНОЙ И МОБИЛЬНОЙ ПАНЕЛИ == */
/* ========================================================== */

/* По умолчанию наша новая мобильная панель скрыта */
.mobile-sticky-footer {
  display: none;
}

@media (max-width: 767px) {
  /* 1. Добавляем отступ снизу для основного контента */
  .cart-page-container {
    padding-bottom: 100px;
  }

  /* 2. На мобильных устройствах ПОЛНОСТЬЮ СКРЫВАЕМ старый блок */
  .cart-summary-box {
    display: none;
  }

  /* 3. ПОКАЗЫВАЕМ и стилизуем нашу новую мобильную панель */
  .mobile-sticky-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 12px 20px;
    background-color: #f8f9fa;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    box-sizing: border-box; /* Важно для корректного расчета ширины */
  }

  /* Используем те же стили для дочерних элементов, что и раньше */
  .mobile-sticky-footer .cart-total {
    margin: 0;
  }

  .mobile-sticky-footer .checkout-button {
    width: auto;
    flex-shrink: 0;
  }
  
  .mobile-sticky-footer .cart-total-value {
    font-size: 18px;
  }
}