/* Оверлей */
.side-cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.side-cart-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Контейнер кошика */
.side-cart-container {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 100%;
  height: 100vh;
  /* background: rgba(var(--clr-black), 1); */
  background: rgba(var(--clr-white), 1);
  z-index: 99999;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
}
.side-cart-container.open {
  transform: translateX(0);
}
.side-cart-container.loading {
  /* opacity: 0.7; */
  pointer-events: none;
}
.side-cart-container.loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.6);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 50 50'%3E%3Cpath fill='%23000' d='M25,5A20.14,20.14,0,0,1,45,22.88a2.51,2.51,0,0,0,2.49,2.26h0A2.52,2.52,0,0,0,50,22.33a25.14,25.14,0,0,0-50,0,2.52,2.52,0,0,0,2.5,2.81h0A2.51,2.51,0,0,0,5,22.88,20.14,20.14,0,0,1,25,5Z'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 25 25' to='360 25 25' dur='0.8s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  z-index: 10;
}
#side-cart-inner {
  font-family: var(--ff-main, sans-serif);
  color: rgba(var(--clr-dark), 1);
  background-color: rgba(var(--clr-light), 1);
}

/* Шапка */
.side-cart-header {
  background-color: rgba(var(--clr-white), 1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #eeeeee;
}
.side-cart-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: rgba(var(--clr-black), 1);
}
.close-side-cart {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #333;
}

/* Тіло кошика */
.side-cart-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px;
}
.side-cart-items {
  list-style: none;
  margin: 0;
  padding: 0;
}
.side-cart-item {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(var(--clr-dark-lighter), 0.1);
}
.sci-img {
  flex-shrink: 0;
  width: 80px;
}
.sci-img img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  object-fit: cover;
}
.sci-info {
  padding-left: 15px;
  flex-grow: 1;
}
.sci-info h4 {
  margin: 0 0 5px;
  font-size: 1rem;
}
.sci-info h4 a {
  text-decoration: none;
  color: #333;
}
.sci-price {
  font-weight: bold;
  margin-bottom: 10px;
}
.sci-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sci-qty {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 3px;
}
.sci-qty button {
  background: #f9f9f9;
  border: none;
  padding: 5px 10px;
  cursor: pointer;
}
.sci-qty input {
  width: 40px;
  text-align: center;
  border: none;
  background: transparent;
  pointer-events: none;
  -moz-appearance: textfield;
}
.remove-item {
  background: none;
  border: none;
  color: #ff3333;
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.9rem;
}

/* Підвал */
.side-cart-footer {
  padding: 20px;
  border-top: 1px solid #eeeeee;
  background: #fafafa;
}
.sci-subtotal {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  margin-bottom: 15px;
}
.sci-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sci-buttons .button {
  display: block;
  text-align: center;
  padding: 12px;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
}
.sci-buttons .view-cart {
  background: #eeeeee;
  color: #333;
}
.sci-buttons .checkout {
  background: #007cba;
  color: #fff;
}

/* --- Стилі для іконки в шапці --- */
.header-cart-wrapper {
  position: relative;
  /* display: inline-block; */

}

.open-side-cart {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #333;
  position: relative;
}

/* Стилізація бейджа лічильника */
.cart-count-badge {
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    "Open Sans",
    "Helvetica Neue",
    sans-serif;
  position: absolute;
  top: -8px;
  right: -10px;
  background-color: rgba(var(--clr-accent), 1);
  color: rgba(var(--clr-black), 1);
  font-size: 10px;
  font-weight: bold;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  transition: all 0.2s ease;
}

/* Якщо кошик порожній — приховуємо бейдж */
.cart-count-badge.empty {
  display: none;
  opacity: 0;
}

/* Колонка 2: Деталі (контейнер) */
.sci-details {
  display: flex;
  flex-grow: 1;
  justify-content: space-between;
}

/* Ліва підколонка (Назва, Кількість, Ціна за шт) */
.sci-col-left {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 4px;
}
.sci-col-left h4 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}
.sci-col-left h4 a {
  text-decoration: none;
  color: rgba(var(--clr-black), 1);
  font-weight: 600;
}
.sci-qty-text {
  font-size: 0.9rem;
  color: rgba(var(--clr-dark-lighter), 1);
}
.sci-unit-price {
  font-size: 0.85rem;
  color: rgba(var(--clr-dark-lighter), 1);
}

/* Права підколонка (Іконка, Бейдж, Загальна ціна) */
.sci-col-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between; /* Розносить іконку вгору, ціну вниз */
  min-width: 85px; /* Щоб бейдж не ламав верстку */
}
.remove-item {
  background: none;
  border: none;
  color: rgba(var(--clr-dark-lighter), 1);
  cursor: pointer;
  padding: 0;
  transition: color 0.2s ease;
}
.remove-item:hover {
  color: rgba(var(--clr-accent-darker), 1);
}
.sci-badge-save {
  background-color: rgba(var(--clr-secondary), 1);
  color: rgba(var(--clr-black), 1);
  font-size: 0.75rem;
  font-weight: bold;
  padding: 3px 6px;
  border-radius: 3px;
  margin: 5px 0;
  text-align: center;
  white-space: nowrap;
}
.sci-line-total {
  font-weight: bold;
  font-size: 1rem;
  color: rgba(var(--clr-black), 1);
}

/* Підвал кошика */
.side-cart-footer {
  padding: 20px;
  background-color: rgba(var(--clr-white), 1);
  border-top: 1px solid rgba(var(--clr-dark-lighter), 0.1);
}
.sci-total-savings {
  background-color: rgba(var(--clr-secondary), 0.2);
  color: rgba(var(--clr-black), 1);
  padding: 10px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: bold;
  text-align: center;
  margin-bottom: 15px;
}
.sci-subtotal {
  display: flex;
  justify-content: space-between;
  font-size: 1.2rem;
  font-weight: bold;
  color: rgba(var(--clr-black), 1);
  margin-bottom: 10px;
}
.sci-tax-notice {
  font-size: 0.8rem;
  color: rgba(var(--clr-dark-lighter), 1);
  margin-bottom: 20px;
  text-align: center;
}

/* Кнопки */
.sci-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sci-buttons .button {
  display: block;
  text-align: center;
  padding: 14px;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  font-family: var(--ff-main, sans-serif);
  transition:
    background-color 0.2s ease,
    transform 0.1s ease;
}
.sci-buttons .view-cart {
  background-color: rgba(var(--clr-light), 1);
  color: rgba(var(--clr-dark), 1);
  border: 1px solid rgba(var(--clr-dark-lighter), 0.2);
}
.sci-buttons .view-cart:hover {
  background-color: rgba(var(--clr-white), 1);
}
.sci-buttons .checkout {
  background-color: rgba(var(--clr-accent), 1);
  color: rgba(var(--clr-black), 1);
  border: none;
}
.sci-buttons .checkout:hover {
  background-color: rgba(var(--clr-accent-darker), 1);
  color: rgba(var(--clr-white), 1);
}
.empty-cart-message p{
	 color: rgba(var(--clr-black), 1);
}