/* === Загальний контейнер === */
.custom-cart-wrapper {
  font-family: 'Inter', sans-serif;
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  box-sizing: border-box;
}

.custom-cart-h2 {
	font-weight: 600 !important;
	font-size: 24px !important;
	line-height: 40px !important;
	margin: 0;
	padding-bottom: 30px;
}

/* === Окрема картка товару === */
.custom-cart-item {
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05), 
            0 0 8px rgba(0, 0, 0, 0.03);
  padding: 10px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* === Головний рядок: зображення + деталі === */
.custom-cart-item-main {
  display: flex;
  gap: 20px;
  align-items: center;
}

/* Зображення */
.custom-cart-thumb img {
  width: 120px;
  height: auto;
  border-radius: 12px;
  flex-shrink: 0;
}

/* Блок з деталями: назва + контролі */
.custom-cart-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* === Назва + контролі в одному рядку === */
.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

/* Назва товару */
.cart-product-title {
  font-weight: 600;
  font-size: 18px;
  line-height: 1.3;
  width: 300px;
  gap: 12px;
}

/* === Контролі: кількість, ціна, видалити === */
.cart-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 300px;
}

/* Кастомна кількість */
.quantity {
  display: flex;
  align-items: center;
  border-radius: 12px;
  overflow: hidden;
}

.quantity input.qty {
  font-size: 18px !important;
  border: 1px solid #000 !important;
  border-radius: 12px;
  width: auto !important;
}

/* Chrome, Safari, Edge */
.quantity input[type=number]::-webkit-inner-spin-button,
.quantity input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
.quantity input[type=number] {
  -moz-appearance: textfield;
}

/* Інші (загальне вирівнювання + зовнішній вигляд) */
.quantity input[type=number] {
  appearance: textfield;
}


.quantity .minus,
.quantity .plus {
  padding: 8px 12px;
  font-size: 24px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}
.quantity .minus:hover,
.quantity .plus:hover {
  background: #e0e0e0;
}
.quantity input.qty {
  max-width: 50px;
  padding: 8px 0;
  border: none;
  text-align: center;
  font-size: 24px;
  font-weight: 500;
  background: #fff;
}

/* Ціна та кнопка видалення */
.cart-item-price {
  font-weight: 600;
  font-size: 18px;
  color: #1F88C9;
}

.cart-item-price .woocommerce-Price-amount bdi {
  font-size: 24px;
}

.cart-item-price .woocommerce-Price-currencySymbol {
  font-size: 24px;
}

.cart-remove {
  font-size: 18px;
  color: #000;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease;
}
.cart-remove:hover {
  color: #f00;
}

/* === Опис під карткою === */
.custom-cart-description {
  width: 100%;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Обрізка тексту до двох рядків + "..." */
.description-text {
  font-size: 14px;
  color: #444;
  line-height: 1.4;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  max-height: calc(2.5em * 1);
}

/* Розгорнутий стан: показує увесь текст */
.custom-cart-description.expanded .description-text {
  -webkit-line-clamp: unset;
  max-height: unset;
  overflow: visible;
}

/* Кнопка View full list — новий рядок, зліва */
.toggle-description {
  display: inline-flex;
  align-items: center;
  background: none;
  margin-bottom: 15px;
  border: none;
  padding: 0;
  font-size: 14px;
  text-decoration: mone;
  cursor: pointer;
  gap: 6px;
}

/* Іконка, що повертається */
.toggle-icon {
  display: inline-block;
  transition: transform 0.2s ease;
  line-height: 0;
}

/* Поворот іконки на 180° при expanded */
.toggle-description[aria-expanded="true"] .toggle-icon {
  transform: rotate(180deg);
}

/* === Чекбокс згоди === */
.cart-agreement {
  font-size: 18px;
  font-weight: 400;
}
.cart-agreement input[type="checkbox"] {
  margin-right: 8px;
}

/* === Top up поле === */
.cart-donation-note {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  font-size: 18px;
  font-weight: 400;
  color: #6B6B6B;
}

.donation-label {
  align-items: center;
  gap: 6px;
  font-size: 18px;
  color: #6B6B6B;
}

.donation-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    padding: 6px 12px;
    border-radius: 20px;
    background: #f8f8f8;
    max-width: 80px;
}

.donation-input-wrapper input.donation-input {
    border: none;
    background: transparent;
    font-size: 1rem;
    width: 100%;
    outline: none;
}

.donation-input-wrapper .edit-icon {
  font-size: 1rem;
  color: #888;
  margin-left: 8px;
}

.info-icon-wrapper {
  position: relative;
  display: inline-block;
}

.donation-info-popup {
  display: none;
  position: absolute;
  z-index: 10;
  background: #fff;
  color: #000;
  border: 1px solid #1F88C9;
  border-radius: 20px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
  padding: 15px;
  width: 400px;
  font-size: 14px;
  line-height: 1.4;
}

.cart-donation-note .donation-info-popup {
  max-width: 360px;
  white-space: normal;
  word-break: break-word;
  padding: 8px 12px;
  background: #f9f9f9;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.4;
}

.info-icon-wrapper.active .donation-info-popup {
  display: block;
}


/* === Кнопки внизу: назад, сума, фініш === */
.cart-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  gap: 12px;
  flex-wrap: wrap;
}
.cart-btn {
  display: inline-block;
  padding: 12px 24px;
  font-size: 22px;
  font-weight: 600;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease;
}
.cart-back {
  border: 2px solid #1F88C9;
  color: #1F88C9;
  background: #fff;
}
a.cart-back:visited {
  color: #1F88C9 !important;
}
.cart-finish {
  background: #ffdc00;
  color: #000;
  border: none;
}
.cart-finish:hover {
  background: #ffcc00;
}

/* === Сума === */
.cart-total {
  font-size: 18px;
  font-weight: 700;
  padding: 10px 20px;
  background: #fff5c2;
  border-radius: 999px;
}

/* === Модальне вікно === */
.donation-info-modal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.4);
  display: none;
  z-index: 1000;
}
.donation-info-content {
  background: #fff;
  margin: 15% auto;
  padding: 20px;
  border-radius: 12px;
  max-width: 400px;
  position: relative;
}
.close-modal {
  position: absolute;
  top: 8px; right: 12px;
  font-size: 20px;
  color: #666;
  cursor: pointer;
}
.close-modal:hover {
  color: #000;
}

.cart-combined {
  display: flex;
  align-items: center;
  overflow: hidden;
  text-decoration: none;
  font-size: 18px;
  font-weight: 600;
  border-radius: 50px;
  border: 1px solid var(--Primary-COH_Yellow, #FFE205);
  color: #000;
  padding: 0;
}

.cart-total-inside {
  background-color: #fff9cf;
  color: #1F88C9;
  font-size: 22px;
  font-weight: 600;
  padding: 12px 30px;
  border-radius: 50px;
  border-right: 2px solid #ffdc00;
  display: flex;
  align-items: center;
  height: 100%;
}

.cart-checkout-label {
  padding: 12px 25px;
  border-radius: 50px;
  display: flex;
  font-size: 22px;
  font-weight: 600;
  align-items: center;
  justify-content: center;
  background-color: #ffdc00;
  margin-left: -25px;
}



.cart-combined.disabled {
  pointer-events: none;
  opacity: 0.5;
}

.cart-total-label {
  font-size: 18px;
  font-weight: 400;
  color: #6B6B6B;
  margin-top: 30px;
  margin-bottom: 6px;
  text-align: right;
  width: 100%;
}

/* Контейнер, що скролиться */
.custom-cart-scrollable {
  max-height: 47vh;
  overflow-y: auto;
  margin-bottom: 24px;
  padding-right: 8px;
}

/* Фіксована нижня частина */
.cart-fixed-footer {
  position: sticky;
  bottom: 0;
  background: #fff;
  padding: 10px;
  z-index: 1;
}



/* === Адаптивність === */
/* Мобільні: до 480px */
@media (max-width: 480px) {
  .custom-cart-wrapper {
    padding: 16px;
  }

  .custom-cart-h2 {
    font-size: 20px !important;
    line-height: 1.3 !important;
    padding-bottom: 20px;
    font-weight: 600 !important;
  }

  .custom-cart-item-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .custom-cart-thumb img {
    width: 100%;
    max-width: 100%;
    height: auto;
  }

  .cart-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .cart-product-title {
    font-size: 16px;
  }

  .cart-controls {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
  }

  .quantity input.qty {
    font-size: 18px;
    max-width: 40px;
  }

  .cart-item-price {
    font-size: 16px;
  }

  .cart-item-price .woocommerce-Price-amount bdi,
  .cart-item-price .woocommerce-Price-currencySymbol {
    font-size: 20px;
  }

  .cart-remove svg {
    width: 20px;
    height: 20px;
  }

  .toggle-description {
    font-size: 13px;
  }

  .description-text {
    font-size: 13px;
  }

  .cart-agreement {
    font-size: 14px;
    line-height: 1.4;
  }

  .donation-label {
    font-size: 14px;
    flex-direction: row;
    align-items: flex-start;
    gap: 4px;
  }

  .cart-donation-note {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .donation-input-wrapper {
    width: 30%;
  }

  .cart-total-label {
    font-size: 16px;
    margin: 20px 0 8px 0;
    text-align: center;
    display: none;
  }

  .cart-actions {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .cart-btn {
    justify-content: center;
    font-size: 18px;
    border: none;
	padding: 12px 0;
  }
	 
  .cart-combined {
    justify-content: center;
    font-size: 18px;
  }

  .cart-total-inside {
    padding: 10px 20px;
    font-size: 22px;
    width: 120px;
  }

  .cart-checkout-label {
    padding: 10px 20px;
    font-size: 22px;
  }

/*   .donation-info-popup {
    font-size: 13px;
	left: 50%;
    transform: translateX(-45%);
    width: calc(70vw);
    margin-right: 0;
  } */
  .donation-info-popup {
    font-size: 13px;
    width: 70vw;
    transform: none;
  }

  .donation-info-popup.popup-centered {
    left: 50%;
    right: auto;
    transform: translateX(-45%);
  }

  .custom-cart-scrollable {
    max-height: 35vh;
    padding-right: 0;
    margin-bottom: 16px;
  }
}


/* Планшети: 481px–1023px */
@media (min-width: 481px) and (max-width: 1023px) {
  .custom-cart-wrapper {
    padding: 24px;
  }

  .custom-cart-h2 {
    font-size: 22px !important;
    line-height: 1.4 !important;
    padding-bottom: 24px;
  }

  .custom-cart-thumb img {
    width: 100px;
  }

  .cart-product-title {
    font-size: 17px;
  }

  .cart-controls {
    gap: 10px;
  }

  .cart-actions {
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
  }

  .cart-btn,
  .cart-combined {
    font-size: 20px;
  }

  .cart-total-inside,
  .cart-checkout-label {
    padding: 10px 24px;
    font-size: 20px;
  }

  .donation-info-popup {
    width: 360px;
    font-size: 14px;
  }

  .custom-cart-scrollable {
    max-height: 55vh;
  }
}

