/* ===================== КОШИК (КЛАСИЧНИЙ) ===================== */

/* Основний контейнер */
.woocommerce {
  flex: 1;
  width: 100%;
  max-width: 1434px;
  margin: 40px auto;
  padding-inline: clamp(15px, 3vw, 30px);
  font-family: "Onest", "Arial", sans-serif;
  color: #222222;
  box-sizing: border-box;
}

.woocommerce * {
  box-sizing: border-box;
}
/* Сховати повідомлення на сторінці кошика */
.woocommerce-cart .woocommerce-notices-wrapper {
  display: none;
}
/* ===================== ДВОКОЛОНКОВИЙ ЛЕЯУТ (ДЕСКТОП) ===================== */
@media (min-width: 992px) {
  .woocommerce {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 30px;
  }

  .woocommerce-cart-form {
    flex: 1 1 65%;
    min-width: 0; /* Запобігає випадінню контенту з flex-контейнера */
  }

  .cart-collaterals {
    flex: 0 0 30%;
    min-width: 300px;
    margin-top: 0;
  }
}

/* ===================== ТАБЛИЦЯ ТОВАРІВ ===================== */

.woocommerce-cart-form__contents {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  font-size: 16px;
  overflow: hidden; /* Щоб радіус працював для фону thead */
}

.woocommerce-cart-form__contents thead th {
  text-align: left;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  background: #f8f8f8;
  border-bottom: 2px solid #eee;
  color: #555;
}

.woocommerce-cart-form__contents td {
  padding: 6px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

/* Зображення товару */
.woocommerce-cart-form__contents .product-thumbnail img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #eee;
  display: block;
}

/* Назва товару */
.woocommerce-cart-form__contents .product-name a {
  color: #800000;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s;
}

.woocommerce-cart-form__contents .product-name a:hover {
  color: #9a0000;
  text-decoration: underline;
}

/* Ціна та підсумок */
.woocommerce-cart-form__contents .product-price,
.woocommerce-cart-form__contents .product-subtotal {
  font-size: 16px;
  font-weight: 700;
  color: #800000;
}

/* Поле кількості */
.woocommerce-cart-form__contents .quantity input[type="number"] {
  width: 75px;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  text-align: center;
  font-size: 16px;
  transition: all 0.2s;
}

.woocommerce-cart-form__contents .quantity input[type="number"]:focus {
  border-color: #800000;
  outline: none;
  box-shadow: 0 0 0 2px rgba(128, 0, 0, 0.1);
}

/* Прибираємо стрілочки в інпуті number (опціонально, але виглядає краще) */
.woocommerce-cart-form__contents
  .quantity
  input[type="number"]::-webkit-inner-spin-button,
.woocommerce-cart-form__contents
  .quantity
  input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Кнопка видалення (Хрестик) */
.woocommerce-cart-form__contents .product-remove a.remove {
  color: #800000;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid #800000;
  background: transparent;
  transition: all 0.3s ease;
  margin: 0 auto;
}

.woocommerce-cart-form__contents .product-remove a.remove:hover {
  color: #fff;
  background: #800000;
}

/* ===================== ДІЇ З КОШИКОМ ===================== */

.woocommerce-cart-form__contents .actions {
  padding: 16px;
  background: #fafafa;
  border-top: 1px solid #eee;
}

/* Якщо ви використовуєте купони, вони зазвичай знаходяться тут. 
   Якщо ні, це просто вирівняє кнопку оновлення */
.woocommerce-cart-form__contents .actions .coupon {
  float: left;
  display: flex;
  gap: 10px;
}

.woocommerce-cart-form__contents .actions button[name="update_cart"] {
  float: right;
  background: #f1f1f1;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.woocommerce-cart-form__contents
  .actions
  button[name="update_cart"]:not(:disabled):hover {
  background: #e4e4e4;
}

.woocommerce-cart-form__contents .actions button[name="update_cart"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Очищення флоатів для блоку actions */
.woocommerce-cart-form__contents .actions::after {
  content: "";
  display: table;
  clear: both;
}

/* ===================== ПІДСУМОК КОШИКА ===================== */

.cart-collaterals .cart_totals {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

@media (min-width: 992px) {
  .cart-collaterals {
    position: sticky;
    top: 20px;
  }
}

.cart-collaterals h2 {
  color: #800000;
  font-size: 22px;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f0f0;
}

.cart-collaterals table {
  width: 100%;
  border-collapse: collapse;
}

.cart-collaterals tr {
  border-bottom: 1px solid #f0f0f0;
}

.cart-collaterals th {
  text-align: left;
  padding: 15px 0;
  font-size: 16px;
  font-weight: 600;
  color: #555;
}

.cart-collaterals td {
  text-align: right;
  padding: 15px 0;
  font-size: 16px;
  font-weight: 500;
}

/* Рядок "Загалом" */
.cart-collaterals .order-total th,
.cart-collaterals .order-total td {
  font-size: 18px;
  font-weight: 700;
  color: #800000;
  border-top: 2px solid #ddd;
  padding-top: 20px;
  border-bottom: none;
}

/* Доставка Безкоштовна та Самовивіз */
.woocommerce-shipping-methods {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: right;
  font-size: 15px;
}
.woocommerce-shipping-methods li {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.woocommerce-shipping-methods li:last-child {
  margin-bottom: 0;
}

.woocommerce-shipping-methods input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #ccc;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.2s;
}

.woocommerce-shipping-methods input[type="radio"]:checked {
  border-color: #800000;
}

.woocommerce-shipping-methods input[type="radio"]::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #800000;
  opacity: 0;
  transition: opacity 0.2s;
}

.woocommerce-shipping-methods input[type="radio"]:checked::after {
  opacity: 1;
}

.woocommerce-shipping-methods label {
  cursor: pointer;
  transition: color 0.2s;
}

.woocommerce-shipping-methods input[type="radio"]:checked + label {
  color: #800000;
  font-weight: 600;
}

.woocommerce-shipping-destination {
  font-size: 13px;
  color: #888;
  text-align: right;
  margin-top: 8px;
  margin-bottom: 0;
}

/* Кнопка "Перейти до оформлення" */
.wc-proceed-to-checkout {
  margin-top: 25px;
}

.wc-proceed-to-checkout .checkout-button {
  display: block;
  width: 100%;
  padding: 16px;
  background: #800000;
  color: #fff;
  text-align: center;
  border-radius: 8px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  transition: background 0.3s;
  border: none;
  cursor: pointer;
}

.wc-proceed-to-checkout .checkout-button:hover {
  background: #9a0000;
  color: #fff;
}

/* =====Контейнер порожнього кошика =======*/
.woocommerce-cart--empty .woocommerce {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 400px;
}
/* Прибираємо стандартний синій фон повідомлення woocommerce-info */
.woocommerce-cart .cart-empty.woocommerce-info {
  background: transparent;
  border: none;
  color: #222;
  font-size: clamp(20px, 4vw, 28px); /* Адаптивний шрифт */
  font-weight: 700;
  padding: 0;
  margin-bottom: 30px;
  position: relative;
  display: block;
}

/* Блок з повідомленням */
.wc-empty-cart-message {
  margin-bottom: 20px;
}

/* Стилізація кнопки повернення */
.woocommerce-cart .return-to-shop .button.wc-backward {
  display: inline-block;
  background-color: #800000; /* Ваш фірмовий колір */
  color: #ffffff;
  padding: 10px 30px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
  border-radius: 8px;
  transition: all 0.3s ease;
  text-decoration: none;
  border: none;
}

.woocommerce-cart .return-to-shop .button.wc-backward:hover {
  background-color: #9a0000;
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(128, 0, 0, 0.15);
}

/* ===================== АДАПТИВНІСТЬ ===================== */

/* Планшети (768px - 991px) */
@media (max-width: 991px) {
  .woocommerce {
    flex-direction: column;
  }

  .woocommerce-cart-form {
    width: 100%;
    margin-bottom: 40px;
  }

  .cart-collaterals {
    width: 100%;
    max-width: 600px; /* Трохи ширше для планшетів */
    margin: 0 auto;
  }
}

/* Мобільні (до 767px) */
@media (max-width: 767px) {
  /* Ховаємо заголовки таблиці */
  .woocommerce-cart-form__contents thead {
    display: none;
  }

  /* Скидаємо стилі таблиці для карток */
  .woocommerce-cart-form__contents,
  .woocommerce-cart-form__contents tbody,
  .woocommerce-cart-form__contents tr,
  .woocommerce-cart-form__contents td {
    display: block;
    width: 100%;
  }

  /* Рядок товару стає карткою */
  .woocommerce-cart-form__contents tr.cart_item {
    position: relative;
    margin-bottom: 20px;
    padding: 20px 15px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #eaeaea;
  }

  /* Комірки всередині картки */
  .woocommerce-cart-form__contents td {
    padding: clamp(5px, 2vw, 10px) 0;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: right;
  }

  /* Виводимо назви колонок через data-title */
  .woocommerce-cart-form__contents td[data-title]::before {
    content: attr(data-title);
    font-weight: 600;
    color: #555;
    text-align: left;
    margin-right: 15px;
    flex-shrink: 0;
  }

  /* Специфічні комірки без data-title */
  .woocommerce-cart-form__contents td.product-remove::before,
  .woocommerce-cart-form__contents td.product-thumbnail::before,
  .woocommerce-cart-form__contents td.actions::before {
    display: none;
  }

  /* Хрестик видалення в правому верхньому куті */
  .woocommerce-cart-form__contents td.product-remove {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 0;
    width: auto;
    border: none;
  }

  /* Картинка товару */
  .woocommerce-cart-form__contents td.product-thumbnail {
    justify-content: flex-start;
    padding-top: 0;
    margin-bottom: 10px;
  }

  .woocommerce-cart-form__contents td.product-thumbnail img {
    width: 90px;
    height: 90px;
    margin: 0; /* Вирівнювання по лівому краю */
  }

  /* Назва товару */
  .woocommerce-cart-form__contents td.product-name {
    justify-content: flex-start; /* Назва зліва під картинкою */
    text-align: left;
  }

  .woocommerce-cart-form__contents td.product-name::before {
    display: none; /* Ховаємо слово "Товар" */
  }

  /* Дії (Оновлення кошика) */
  .woocommerce-cart-form__contents td.actions {
    display: block;
    padding: 15px;
    margin-top: 20px;
    border-top: none;
    background: transparent;
  }

  .woocommerce-cart-form__contents .actions .coupon {
    float: none;
    flex-direction: column;
    width: 100%;
    margin-bottom: 15px;
  }

  .woocommerce-cart-form__contents .actions .coupon input[type="text"] {
    width: 100%;
    padding: 12px;
  }

  .woocommerce-cart-form__contents .actions button {
    width: 100%;
    float: none;
    padding: 14px;
  }

  /* Підсумки кошика на мобільному */
  .cart-collaterals .cart_totals {
    padding: 20px 15px;
  }
}
