﻿/* ====== Кошик: базовий стиль ====== */
#comjshop {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  font-family: "Segoe UI", Arial, sans-serif;
}

/* ====== Таблиця товарів ====== */
.jshop.cart {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.jshop.cart th {
  background: #2e7d32;
  color: #fff;
  font-weight: 600;
  padding: 12px;
  text-align: center;
}

.jshop.cart td {
  padding: 12px;
  text-align: center;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}

.jshop.cart img.jshop_img {
  max-width: 80px;
  border-radius: 6px;
  border: 1px solid #ddd;
}

/* Назва товару */
.jshop.cart .product_name a {
  font-weight: 600;
  color: #2e7d32;
  text-decoration: none;
}
.jshop.cart .product_name a:hover { color: #1b5e20; }

.item-page, .shophead, .jshop {margin:0 !important;}


/* Ціна */
.jshop.cart .price {
  font-weight: 600;
  color: #388e3c;
}

/* Кількість */
.jshop.cart .quantity .data {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.jshop.cart input[type="number"] {
  width: 60px;
  padding: 6px;
  border: 1px solid #c8e6c9;
  border-radius: 6px;
  text-align: center;
}

.cart_reload {
  cursor: pointer;
  color: #388e3c;
  font-size: 1.2rem;
}
.cart_reload:hover { color: #1b5e20; }

/* Кнопка видалення */
.btn-danger {
  background: #e53935;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-weight: 600;
  cursor: pointer;
}
.btn-danger:hover { background: #c62828; }

/* ====== Підсумки ====== */
.jshop_subtotal {
  width: 100%;
  margin: 20px 0;
  background: #fafafa;
  border-radius: 8px;
  overflow: hidden;
}

.jshop_subtotal td {
  padding: 10px 14px;
  font-weight: 600;
}

.jshop_subtotal .total td.value {
  color: #388e3c;
  font-size: 1.2rem;
}

/* ====== Кнопки дій ====== */
.cart_buttons #checkout {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.cart_buttons a.btn {
  padding: 12px 15px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease;
  text-align: center;
}

.btn-secondary {
  background: #eee;
  color: #333;
}
.btn-secondary:hover { background: #ddd; }

.btn-success {
  background: #2e7d32;
  color: #fff;
}
.btn-success:hover { background: #2e7d32; }

/* ====== Дисконтний код ====== */
.cart_block_discount {
  margin-top: 20px;
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.cart_block_discount .name {
  font-weight: 600;
  margin-bottom: 8px;
}

.cart_block_discount input[type="text"] {
  padding: 8px;
  border: 1px solid #c8e6c9;
  border-radius: 6px;
  margin-right: 8px;
}

.cart_block_discount input[type="submit"] {
  padding: 8px 16px;
  border-radius: 6px;
  background: #388e3c;
  color: #fff;
  font-weight: 600;
  border: none;
  cursor: pointer;
}
.cart_block_discount input[type="submit"]:hover { background: #2e7d32; }

/* ====== Адаптивність ====== */

/* До 768px — таблиця ще зберігається */
@media (max-width: 768px) {
  .jshop.cart th, .jshop.cart td { font-size: 0.9rem; padding: 8px; }
  .jshop.cart img.jshop_img { max-width: 60px; }
}

/* До 480px — переходить у мобільний макет */
@media (max-width: 480px) {
  .jshop.cart, .jshop_subtotal { font-size: 0.9rem; }
  .jshop.cart tr {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    padding: 10px 0;
  }
  .jshop.cart th { display: none; }
  .jshop.cart td {
    border: none;
    text-align: center;
    padding: 6px;
  }
  .jshop.cart img.jshop_img { max-width: 120px; margin-bottom: 8px; }
  .jshop.cart .quantity .data { justify-content: center; }
  .btn-danger { margin-top: 8px; width: 100%; }
  .cart_buttons #checkout { flex-direction: column; gap: 12px; }
  .cart_buttons a.btn { width: 100%; }

  .cart_buttons #checkout {
    flex-direction: column;
    align-items: stretch;   /* вирівнює кнопки по ширині контейнера */
    gap: 12px;              /* відступ між кнопками */
  }

  .cart_buttons a.btn {
    display: block;
    width: 100%;            /* кожна кнопка займає всю ширину */
    box-sizing: border-box; /* запобігає переповненню */
    margin: 0;              /* прибирає зайві зовнішні відступи */
  }
}

