/* ==========================================================================
   CART-SIDEBAR.CSS - Виїжджаюча корзина (стиль как offcanvas)
   ========================================================================== */

/* 
  Теперь #shoppingCart - это offcanvas. 
  Основное позиционирование и анимация управляются offcanvas.css.
  Здесь мы только стилизуем внутреннее содержимое.
*/

#shoppingCart {
  max-width: 450px;
  /* Стандартная ширина корзины */
}

@media (max-width: 575px) {
  #shoppingCart {
    max-width: 100%;
    width: 100%;
  }

  /* На айфонах/мобилках не поджимать футер корзины */
  .tf-mini-cart-bottom {
    margin-bottom: 0;
  }
}

/* Контент корзини */
#shoppingCart .cart-content {
  width: 100%;
  height: 100vh;
  /* fallback */
  height: 100dvh;
  /* корректная высота на мобильных (без URL-бара Safari) */
  border: none;
  border-radius: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.15);
}

/* Header корзини (минималистичный стиль) */
#shoppingCart .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 24px 20px 24px;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
}

#shoppingCart .header .title {
  font-size: 18px;
  font-weight: 500;
  color: #000;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* Кнопка закриття (простой крестик) */
.icon-close,
.icon-close-popup {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  background: transparent;
  border: none;
}

.icon-close::before,
.icon-close-popup::before {
  content: '×';
  font-size: 40px;
  line-height: 1;
  font-weight: 300;
  color: #999;
}

.icon-close:hover::before,
.icon-close-popup:hover::before {
  color: #000;
}

.icon-close:hover,
.icon-close-popup:hover {
  background: #f5f5f5;
  color: #666;
}

/* Промо підказки (жовтий блок) */
.cart-promo-hint {
  padding: 16px 24px;
  background: #fef3cd;
  color: #000;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
  order: 2;
}

.cart-promo-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 12px 20px;
  background: #000;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.cart-promo-btn:hover {
  background: #333;
}

.d-flex {
  display: flex;
}

.flex-column {
  flex-direction: column;
}

.flex-grow-1 {
  flex-grow: 1;
}

.h-100 {
  height: 100%;
}

/* Область скролу товарів */
/* Удаляем ненужную обертку */
.tf-mini-cart-wrap {
  display: none;
}

/* Заставляем основной блок с товарами растягиваться */
.tf-mini-cart-main {
  flex: 1 1 auto;
  /* Grow and shrink to fill space */
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  /* Прокрутка будет здесь */
  min-height: 0;
  /* Flexbox fix */
}

/* Внутреннему блоку прокрутка больше не нужна */
.tf-mini-cart-sroll {
  /* flex: 1; */
  /* убрано */
  /* overflow-y: auto; */
  /* убрано */
  overflow-x: hidden;
  padding: 0;
}

.tf-mini-cart-items {
  padding: 0;
}

/* Товар в корзині (минималистичный стиль) */
.tf-mini-cart-item {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.2s ease;
  position: relative;
}

.tf-mini-cart-item:hover {
  background: #fafafa;
}

.tf-mini-cart-image {
  grid-column: 1;
  grid-row: 1 / span 4;
  width: 100px;
  height: 133px;
  overflow: hidden;
  background: #f5f5f5;
  border-radius: 0;
}

.tf-mini-cart-image img,
.tf-mini-cart-image video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tf-mini-cart-info {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Назва товару */
.tf-mini-cart-info .text-title {
  font-size: 14px;
  font-weight: 400;
  color: #000;
  line-height: 1.4;
  margin-bottom: 4px;
}

.tf-mini-cart-info .text-title a,
.tf-mini-cart-info .link {
  color: #000;
  text-decoration: none;
  transition: color 0.2s ease;
}

.tf-mini-cart-info .text-title a:hover,
.tf-mini-cart-info .link:hover {
  color: #666;
  text-decoration: underline;
}

.text-line-clamp-1 {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
}

/* Варіант (розмір/колір) */
.tf-mini-cart-info .text-secondary-2 {
  font-size: 12px;
  color: #999;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Ціна */
.tf-mini-cart-info .text-button {
  font-size: 15px;
  font-weight: 600;
  color: #000;
  margin-top: 4px;
}

.old_price {
  font-size: 14px;
  color: #999;
  text-decoration: line-through;
  margin-right: 8px;
}

/* Кнопка видалення (минималистичный стиль) */
.tf-btn-remove,
.remove a {
  font-size: 12px;
  color: #bbb;
  text-decoration: underline;
  transition: color 0.2s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tf-btn-remove:hover,
.remove a:hover {
  color: #999;
  text-decoration: none;
}

.remove {
  position: absolute;
  top: 24px;
  right: 24px;
}

/* Footer корзини (підсумок - минималистичный стиль) */
.tf-mini-cart-bottom {
  padding: 24px;
  background: #fff;
  border-top: 1px solid #f0f0f0;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
}

.tf-mini-cart-bottom-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Разом: ціна */
.tf-cart-totals-discounts {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: #000;
  margin-bottom: 12px;
}

.tf-cart-totals-discounts span:first-child {
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tf-totals-total-value {
  font-size: 20px;
  font-weight: 600;
  color: #000;
}

/* Кнопки (минималистичный стиль) */
.tf-mini-cart-view-checkout {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tf-btn {
  display: block;
  width: 100%;
  padding: 14px 24px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  border: 1px solid transparent;
}

/* Біла кнопка "ПРОДОВЖИТИ ПОКУПКИ" */
.tf-btn.btn-white {
  background: #fff;
  color: #000;
  border: 1px solid #e0e0e0;
}

.tf-btn.btn-white:hover {
  background: #f5f5f5;
  border-color: #000;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Темна кнопка "ОФОРМИТИ ЗАМОВЛЕННЯ" */
.tf-btn.btn-fill {
  background: #000;
  color: #fff;
  border: 1px solid #000;
}

.tf-btn.btn-fill:hover {
  background: #333;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Стилі для тексту всередині кнопки */
.tf-btn .text {
  display: block;
}

/* Порожня корзина */
.tf-mini-cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}

.tf-mini-cart-empty svg {
  width: 80px;
  height: 80px;
  color: #ccc;
  margin-bottom: 24px;
}

.tf-mini-cart-empty .title {
  font-size: 18px;
  font-weight: 600;
  color: #000;
  margin-bottom: 8px;
}

.tf-mini-cart-empty .text {
  font-size: 14px;
  color: #666;
  margin-bottom: 24px;
}

/* Utility classes */
.mb_12 {
  margin-bottom: 12px;
}

.gap-12 {
  gap: 12px;
}

.align-items-center {
  align-items: center;
}

.justify-content-between {
  justify-content: space-between;
}

.flex-wrap {
  flex-wrap: wrap;
}

.w-100 {
  width: 100%;
}

.text-center {
  text-align: center;
}

/* Адаптив */
@media (max-width: 575px) {
  #shoppingCart .header {
    padding: 20px 16px;
  }

  .tf-mini-cart-item {
    padding: 16px;
    grid-template-columns: 100px 1fr;
  }

  .tf-mini-cart-image {
    width: 100px;
    height: 130px;
  }

  .tf-mini-cart-bottom {
    padding: 20px 16px;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
    margin-bottom: 0;
  }
}

/* Scrollbar для корзини */
.tf-mini-cart-sroll::-webkit-scrollbar {
  width: 6px;
}

.tf-mini-cart-sroll::-webkit-scrollbar-track {
  background: #f5f5f5;
}

.tf-mini-cart-sroll::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

.tf-mini-cart-sroll::-webkit-scrollbar-thumb:hover {
  background: #999;
}

#shoppingCart .cart-container .header {
  position: relative;
}

.tf-btn.progress-btn {
  background-color: #000000 !important;
  background-image: linear-gradient(rgb(255 255 255 / 24%), rgb(255 255 255 / 25%)) !important;
  background-repeat: no-repeat !important;
  background-size: 0% 100%;
  animation: fillProgress 3s infinite ease-in-out;
}

@keyframes fillProgress {
  0% {
    background-size: 0% 100%;
  }

  50% {
    background-size: 100% 100%;
  }

  100% {
    /* Если хотите, чтобы она возвращалась в 0, оставьте 0. 
       Если хотите, чтобы сбрасывалась резко — уберите 50% и настройте иначе. */
    background-size: 0% 100%;
  }
}

/* --- Per-item Removal Confirmation (Refined) --- */
.tf-mini-cart-item {
  position: relative;
}

.purchase_remove_confirm {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 116px;
  /* 100px (image) + 16px (gap) */
  background: #fff;
  z-index: 50;
  display: flex;
  align-items: center;
  padding: 10px;
  animation: fadeIn 0.2s ease;
}

.purchase_remove_confirm .confirm-content {
  width: 100%;
}

.purchase_remove_confirm .confirm-text {
  font-size: 14px;
  color: #333;
  line-height: 1.5;
  margin-bottom: 20px;
  font-weight: 400;
  text-align: center;
}

.purchase_remove_confirm .confirm-btns {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.purchase_remove_confirm .confirm-btn {
  flex: 1;
  max-width: 110px;
  padding: 12px 10px;
  font-size: 13px;
  font-weight: 400;
  border: 1px solid #1a1a1a;
  background: #fff;
  color: #1a1a1a;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background 0.2s;
  text-align: center;
}

.purchase_remove_confirm .confirm-btn:hover {
  background: #f5f5f5;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (max-width: 480px) {
  .purchase_remove_confirm .confirm-text {
    font-size: 13px;
    margin-bottom: 15px;
  }

  .purchase_remove_confirm .confirm-btn {
    padding: 10px 5px;
    font-size: 12px;
  }
}