/* ============================================================
   CART PAGE — cart.css
   ============================================================ */

/* Reuse breadcrumb */
.cat-breadcrumb { background: #f0f1f7; border-bottom: 1px solid #e4e5ee; padding: .6rem 0; }
.breadcrumb { display: flex; align-items: center; gap: .4rem; font-size: .8rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-muted); transition: color var(--transition); }
.breadcrumb a:hover { color: #4169e1; }
.breadcrumb__sep { color: #bbb; }
.breadcrumb__current { color: var(--text); font-weight: 600; }

.cart-page { background: #f7f8fc; min-height: 100vh; padding-bottom: 4rem; }

/* ============================================================
   LAYOUT
   ============================================================ */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.75rem;
  align-items: start;
  padding-top: 1.75rem;
  padding-bottom: 2rem;
}

/* ============================================================
   CART MAIN (left)
   ============================================================ */
.cart-main { display: flex; flex-direction: column; gap: 1rem; }

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.cart-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.cart-title__count {
  font-size: .85rem;
  font-weight: 600;
  background: #eef0fa;
  color: #4169e1;
  padding: .2rem .65rem;
  border-radius: 9999px;
}
.cart-clear-btn {
  background: none;
  border: none;
  font-size: .8rem;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font);
  font-weight: 600;
  transition: color var(--transition);
  padding: .3rem .5rem;
}
.cart-clear-btn:hover { color: #e63946; }

/* ---- Step indicator ---- */
.cart-steps {
  display: flex;
  align-items: center;
  gap: 0;
  background: #fff;
  border: 1px solid #e4e5ee;
  border-radius: 12px;
  padding: 1rem 1.5rem;
}
.cart-step {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
}
.cart-step__dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e4e5ee;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.cart-step.active .cart-step__dot {
  background: #4169e1;
  color: #fff;
}
.cart-step.active { color: #4169e1; }
.cart-step.done .cart-step__dot { background: #2ecc71; color: #fff; }
.cart-step__line {
  flex: 1;
  height: 2px;
  background: #e4e5ee;
  min-width: 32px;
  margin: 0 .5rem;
}

/* ---- Cart item card ---- */
.cart-items { display: flex; flex-direction: column; gap: .75rem; }

.cart-item {
  display: flex;
  gap: 1rem;
  background: #fff;
  border: 1px solid #e4e5ee;
  border-radius: 12px;
  padding: 1rem;
  transition: box-shadow var(--transition);
}
.cart-item:hover { box-shadow: 0 4px 20px rgba(0,0,0,.06); }

.cart-item__img-wrap {
  width: 80px;
  height: 110px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e4e5ee;
  display: block;
}
.cart-item__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.cart-item__img-wrap:hover img { transform: scale(1.04); }

.cart-item__body { flex: 1; display: flex; flex-direction: column; gap: .6rem; min-width: 0; }

.cart-item__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem;
}
.cart-item__title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: block;
  margin-bottom: .2rem;
  transition: color var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item__title:hover { color: #4169e1; }
.cart-item__author { font-size: .78rem; color: var(--text-muted); margin-bottom: .35rem; }
.cart-item__format { display: flex; gap: .35rem; flex-wrap: wrap; }
.cart-item__format-tag {
  font-size: .68rem;
  font-weight: 600;
  background: #f0f1f7;
  color: var(--text-muted);
  padding: .15rem .5rem;
  border-radius: 9999px;
  border: 1px solid #e4e5ee;
}

.cart-item__remove {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #e4e5ee;
  background: #f7f8fc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
  color: var(--text-muted);
}
.cart-item__remove svg { width: 14px; height: 14px; stroke: currentColor; }
.cart-item__remove:hover { background: #ffeaea; border-color: #ffb3b3; color: #e63946; }

.cart-item__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}

/* Qty control */
.cart-item__qty {
  display: flex;
  align-items: center;
  border: 1.5px solid #e4e5ee;
  border-radius: 8px;
  overflow: hidden;
}
.cart-item__qty-btn {
  width: 32px;
  height: 32px;
  background: #f5f6fa;
  border: none;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
  transition: background var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.cart-item__qty-btn:hover { background: #eef0fa; color: #4169e1; }
.cart-item__qty-val {
  min-width: 36px;
  text-align: center;
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
  border-left: 1.5px solid #e4e5ee;
  border-right: 1.5px solid #e4e5ee;
  line-height: 32px;
}

.cart-item__price-wrap { display: flex; flex-direction: column; align-items: flex-end; }
.cart-item__price { font-size: 1.05rem; font-weight: 800; color: var(--primary); }
.cart-item__old-price { font-size: .75rem; color: var(--text-muted); text-decoration: line-through; }
.cart-item__unit-price { font-size: .7rem; color: var(--text-muted); }

/* ---- Empty state ---- */
.cart-empty {
  background: #fff;
  border: 1px solid #e4e5ee;
  border-radius: 16px;
  padding: 3.5rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
}
.cart-empty__icon { font-size: 3.5rem; }
.cart-empty h2 { font-size: 1.25rem; font-weight: 700; }
.cart-empty p { font-size: .9rem; color: var(--text-muted); }

/* ---- Promo ---- */
.cart-promo {
  background: #fff;
  border: 1px solid #e4e5ee;
  border-radius: 12px;
  padding: .9rem 1rem;
}
.cart-promo__inner { display: flex; align-items: center; gap: .5rem; }
.cart-promo__inner svg { width: 18px; height: 18px; stroke: #4169e1; flex-shrink: 0; }
.cart-promo__input {
  flex: 1;
  border: none;
  outline: none;
  font-size: .88rem;
  font-family: var(--font);
  color: var(--text);
  background: transparent;
  min-width: 0;
}
.cart-promo__input::placeholder { color: #aaa; }
.cart-promo__btn {
  padding: .4rem .9rem;
  background: #4169e1;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}
.cart-promo__btn:hover { background: #2a3f8f; }
.cart-promo__msg { font-size: .78rem; margin-top: .5rem; padding-left: 1.5rem; }
.cart-promo__msg.success { color: #27ae60; }
.cart-promo__msg.error   { color: #e63946; }

/* ============================================================
   CART SUMMARY (right, sticky)
   ============================================================ */
.cart-summary {
  background: #fff;
  border: 1px solid #e4e5ee;
  border-radius: 16px;
  padding: 1.5rem;
  position: sticky;
  top: calc(var(--header-h, 120px) + 12px);
  display: flex;
  flex-direction: column;
  gap: .9rem;
}
.cart-summary__title { font-size: 1.05rem; font-weight: 800; margin: 0 0 .25rem; }

.cart-summary__rows { display: flex; flex-direction: column; gap: .55rem; }
.cart-summary__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .85rem;
  color: var(--text-muted);
}
.cart-summary__row span:last-child { font-weight: 600; color: var(--text); }
.cart-summary__discount { color: #27ae60 !important; }
.cart-summary__free { color: #27ae60 !important; }

.cart-summary__divider { height: 1px; background: #f0f1f7; }

.cart-summary__total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
}
.cart-summary__total { font-size: 1.5rem; font-weight: 800; color: var(--primary); }

.cart-summary__savings {
  background: #f0faf4;
  border: 1px solid #b7e4c7;
  color: #27ae60;
  font-size: .8rem;
  font-weight: 600;
  padding: .5rem .75rem;
  border-radius: 8px;
  text-align: center;
}

.cart-checkout-btn {
  font-size: .95rem;
  padding: .85rem;
}

.cart-summary__secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  font-size: .72rem;
  color: var(--text-muted);
}
.cart-summary__secure svg { width: 14px; height: 14px; stroke: #27ae60; }

.cart-summary__payment-icons {
  display: flex;
  justify-content: center;
  gap: .5rem;
}
.pay-icon {
  background: #f0f1f7;
  border: 1px solid #e4e5ee;
  border-radius: 6px;
  padding: .25rem .55rem;
  font-size: .7rem;
  font-weight: 700;
  color: var(--text);
}

/* Shipping progress */
.cart-shipping-progress {
  background: #eef0fa;
  border-radius: 10px;
  padding: .75rem;
}
.cart-shipping-progress__text { font-size: .78rem; color: var(--text-muted); margin-bottom: .45rem; }
.cart-shipping-progress__text strong { color: #4169e1; }
.cart-shipping-progress__bar {
  height: 6px;
  background: #d0d5f0;
  border-radius: 9999px;
  overflow: hidden;
}
.cart-shipping-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, #4169e1, #6c8fff);
  border-radius: 9999px;
  transition: width .5s ease;
}

/* ============================================================
   RECOMMENDED SECTION
   ============================================================ */
.cart-recommended {
  background: #fff;
  border-top: 1px solid #e4e5ee;
  padding: 2rem 0;
}
.cart-rec-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .cart-layout { grid-template-columns: 1fr 300px; }
  .cart-rec-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
  .cart-layout { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
  .cart-steps { padding: .75rem 1rem; gap: 0; }
  .cart-step span { display: none; }
  .cart-rec-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .cart-item__img-wrap { width: 64px; height: 90px; }
  .cart-item__title { font-size: .88rem; }
}
