/* =========================
   CART — FAVORITES STYLE (FINAL)
========================= */

.cart {
  display: flex;
  flex-direction: column;
  max-height: calc(var(--vh) * 100);
  font-family: var(--main-font-family);
  color: var(--main-font-color);
  background: #fff;
}

/* ================= HEADER ================= */
.cart__head {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;

  min-height: var(--header-height);
  padding: 1.2vw 2.8vw;
  border-bottom: 1px solid rgba(0,0,0,.08);
  background: #fff;

  position: sticky;  /* фіксована шапка */
  top: 0;
  z-index: 2;
   border-bottom: #686868bd solid 1px;
}

.cart__title {
  font-size: .9vw;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: .4vw;
}

.cart__title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 2vw;
  height: 1px;
  background: rgba(0,0,0,.25);
}

/* ================= BODY (SCROLLABLE) ================= */
.cart__body {
  flex: 1;                  /* займає весь доступний простір */
  overflow-y: auto;
  padding: 1.4vw 2.8vw 2vw;
}

/* scrollbar */
.cart__body::-webkit-scrollbar {
  width: 6px;
}
.cart__body::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.2);
  border-radius: 10px;
}


/* ================= FOOTER ================= */
.cart__foot {
  flex-shrink: 0;             /* не зменшується */
  padding: 1.4vw 2.8vw;
  border-top: 1px solid rgba(0,0,0,.08);
  background: #fff;

  display: grid;
  gap: 1vw;
}

.cart__total {
  display: flex;
  justify-content: space-between;
  align-items: center;

  font-size: .95vw;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.cart__total b {
  font-weight: 700;
}

.cart__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;

  height: 3.2vw;
  border-radius: 999px;
  border: none;

  background: #111;
  color: #fff;

  font-size: .95vw;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;

  transition: transform .25s ease, opacity .25s ease;
}

.cart__btn:hover {
  transform: translateY(-1px);
  opacity: .95;
}

/* ================= CART CARD ================= */
.cartRow {
  display: grid;
  grid-template-columns: 4.8vw 1fr auto;
  gap: 1vw;

  align-items: flex-start;
  padding: .9vw;
  margin-bottom: .7vw;

  background: #fff;
  border-radius: .6vw;
  cursor: default;

  transition: transform .25s ease, box-shadow .25s ease;
}

.cartRow:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(0,0,0,.1);
}

.cartRow__img {
  width: 4.8vw;
  aspect-ratio: 2 / 3;

  background: #f5f5f5;
  border-radius: .45vw;

  display: flex;
  align-items: center;
  justify-content: center;
}

.cartRow__img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10%;
  display: block;
}

.cartRow__main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.cartRow__title {
  font-size: .95vw;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: .04em;
  text-transform: uppercase;

  position: relative;
  padding-bottom: .45vw;

  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;

  color: inherit;
  text-decoration: none;
}

.cartRow__title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 1.6vw;
  height: 1px;
  background: rgba(0,0,0,.2);
}

.cartRow__meta {
  margin-top: .45vw;
  font-size: .8vw;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .6;

  display: flex;
  gap: .6vw;
  flex-wrap: wrap;
}

.cartRow__price {
  margin-top: .6vw;
  display: flex;
  align-items: baseline;
  gap: .5vw;
}

.cartRow__price b {
  font-size: .95vw;
  font-weight: 700;
}

.cartRow__price del {
  font-size: .85vw;
  font-weight: 500;
  color: #999;
  text-decoration: line-through;
}

.cartRow__warn {
  margin-top: .45vw;
  font-size: .75vw;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #dc2626;
}

.cartRow__controls {
  display: flex;
  align-items: center;
  gap: .8vw;
}

.qty {
  display: inline-flex;
  align-items: center;
  gap: .4vw;

  padding: .25vw .4vw;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.12);
}

.qty__btn {
  width: 2.2vw;
  height: 2.2vw;

  border: none;
  background: none;
  border-radius: 999px;

  font-size: 1.2vw;
  font-weight: 600;

  transition: transform .2s ease, opacity .2s ease;
}

.qty__btn:hover {
  transform: scale(1.1);
  opacity: .8;
}

.qty__inp {
  width: 3vw;
  border: none;
  background: none;
  outline: none;

  text-align: center;
  font-size: .95vw;
  font-weight: 600;
}

.cartRow__remove {
  background: none;
  border: none;

  display: flex;
  align-items: center;
  justify-content: center;

  opacity: .35;
  transition: opacity .2s ease, transform .2s ease;
}

.cartRow:hover .cartRow__remove {
  opacity: 1;
}

.cartRow__remove:hover {
  transform: scale(1.15);
  color: #e11d48;
}

.cartRow__remove svg {
  width: 1.8vw;
  height: 1.8vw;
}

/* ================= RESPONSIVE ================= */

/* <= 1024px */
@media (max-width: 1024px) {
  .cart__head, .cart__body, .cart__foot { padding: 2vw; }
  .cart__title { font-size: 1.6vw; }

  .cartRow {
    grid-template-columns: 8vw 1fr auto;
    padding: 1.4vw;
    border-radius: 1vw;
  }

  .cartRow__img { width: 8vw; }
  .cartRow__title, .cartRow__meta, .cartRow__price b, .cartRow__price del { font-size: 1.6vw; }
  .cartRow__warn { font-size: 1.4vw; }

  .qty__btn { width: 3vw; height: 3vw; font-size: 1.8vw; }
  .qty__inp { font-size: 1.6vw; }
  .cartRow__remove svg { width: 3.6vw; height: 3.6vw; }

  .cart__total { font-size: 1.6vw; }
  .cart__btn { font-size: 1.6vw; height: 4.5vw; }
}

/* <= 768px */
@media (max-width: 768px) {
  .cart__title { font-size: 2.4vw; }

  .cartRow {
    grid-template-columns: 11vw 1fr auto;
    gap: 2vw;
    padding: 2vw;
    border-radius: 1.6vw;
  }

  .cartRow__img { width: 11vw; }
  .cartRow__title, .cartRow__meta, .cartRow__price b, .cartRow__price del, .qty__inp { font-size: 2.2vw; }
  .cartRow__warn { font-size: 1.9vw; }
  .qty__btn { width: 4vw; height: 4vw; font-size: 2.4vw; }
  .cartRow__remove svg { width: 5vw; height: 5vw; }

  .cart__total { font-size: 2.2vw; }
  .cart__btn { font-size: 2.4vw; height: 6vw; }
}

/* <= 480px */
@media (max-width: 480px) {
  .cartRow {
    grid-template-columns: 15vw 1fr auto;
    padding: 3vw;
    border-radius: 2.4vw;
  }

  .cartRow__img { width: 15vw; }
  .cartRow__title, .cartRow__meta, .cartRow__price b, .cartRow__price del, .qty__inp { font-size: 3.2vw; }
  .cartRow__warn { font-size: 2.6vw; }
  .qty__btn { width: 6vw; height: 6vw; font-size: 4vw; }
  .cartRow__remove svg { width: 7vw; height: 7vw; }

  .cart__total { font-size: 3vw; }
  .cart__btn { font-size: 3vw; height: 8vw; }
}





/* ================= EMPTY ================= */
.cart__empty {
  font-size: .95vw;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .9;

  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  text-align: center;
  padding: 2vw;
}

/* ========== RESPONSIVE EMPTY ========== */
@media (max-width: 1024px) {
  .cart__empty { font-size: 1.6vw; }
}

@media (max-width: 768px) {
  .cart__empty { font-size: 2.4vw; padding: 3vw; }
}

@media (max-width: 480px) {
  .cart__empty { font-size: 3.2vw; padding: 4vw; }
}
