/* ===========================================
   Livo — Cart Page
=========================================== */

/* Page background */
.woocommerce-cart .livo-wc-wrap {
  max-width: none;
  padding: 0;
  background: #F5F5F7;
}
.woocommerce-cart .livo-wc-inner {
  background: none;
  border-radius: 0;
  padding: 0;
}

/* Main card */
.livo-cart {
  max-width: var(--livo-max-w, 1440px);
  margin: 0 auto;
  padding: 32px var(--livo-px, 24px) 56px;
}
.livo-cart-title {
  font-size: 28px;
  font-weight: 700;
  color: #111;
  margin: 0 0 24px;
  letter-spacing: -0.3px;
}
.livo-cart-layout {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  background: #FFFFFF;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* ── Items list ── */
.livo-cart-main {
  flex: 1;
  min-width: 0;
}
.livo-cart-list { display: flex; flex-direction: column; }

.livo-cart-item {
  position: relative;
  display: grid;
  grid-template-columns: 80px 1fr auto;
  grid-template-rows: auto auto;
  gap: 0 20px;
  align-items: center;
  padding: 24px 40px 24px 0;
  border-bottom: 1px solid #F0F0F0;
}
.livo-cart-item:last-child { border-bottom: none; }

/* Remove X — top-right corner */
.livo-cart-remove {
  position: absolute;
  top: 24px;
  right: 0;
}
.livo-cart-remove .remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: #888 !important;
  text-decoration: none;
  border-radius: 50%;
  transition: background .15s, color .15s;
  font-size: 0; /* hide &times; text, use SVG */
}
.livo-cart-remove .remove:hover {
  background: #f5f5f7;
  color: #111 !important;
}

/* Thumbnail */
.livo-cart-thumb {
  grid-row: 1 / 3;
  grid-column: 1;
}
.livo-cart-thumb img {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  object-fit: contain;
  background: #f9f9fb;
  border: 1px solid #f0f0f0;
  padding: 6px;
}
.livo-cart-thumb a { display: block; }

/* Info */
.livo-cart-info {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}
.livo-cart-name {
  font-size: 16px;
  font-weight: 500;
  color: #111111;
  line-height: 1.4;
  margin-bottom: 6px;
}
.livo-cart-name a {
  color: #111;
  text-decoration: none;
}
.livo-cart-name a:hover { color: var(--livo-accent, #FF4A00); }
.livo-cart-name dl.variation {
  margin: 4px 0 0;
  font-size: 12px;
  color: #888;
}

.livo-cart-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 16px;
}
.livo-cart-price { font-weight: 600; color: #111; }
.livo-cart-sub   { font-weight: 600; color: #111; }
.livo-cart-sub .woocommerce-Price-amount { font-weight: 600; }

/* Quantity — compact +/- circles */
.livo-cart-qty {
  grid-column: 2;
  grid-row: 2;
  justify-self: start;
  margin-top: 10px;
}
.livo-cart-qty .quantity,
.livo-cart-qty .livo-qty-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0;
}
.livo-cart-qty .livo-qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #F5F5F7;
  color: #555;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.livo-cart-qty .livo-qty-btn:hover { background: #EBEBEB; color: #111; }
.livo-cart-qty input.qty {
  width: 36px;
  border: none;
  background: transparent;
  text-align: center;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #111;
  padding: 0;
  -moz-appearance: textfield;
}
.livo-cart-qty input.qty::-webkit-outer-spin-button,
.livo-cart-qty input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Hide default update button */
.livo-cart-actions { display: none; }

/* ── Sidebar totals (sticky) ── */
.livo-cart-sidebar {
  flex: 0 0 min(400px, 30%);
  width: min(400px, 30%);
  position: sticky;
  top: 88px;
}
.livo-cart-totals {
  background: #F5F5F7;
  padding: 24px;
  border-radius: 16px;
}

/* ── Totals update overlay ── */
.livo-totals-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 10;
  pointer-events: none;
}
.livo-cart-totals.is-updating .livo-totals-overlay {
  opacity: 1;
  visibility: visible;
}
.livo-totals-spinner {
  width: 22px;
  height: 22px;
  border: 2px solid #EBEBEB;
  border-top-color: #111;
  border-radius: 50%;
  animation: livo-cart-spin 0.65s linear infinite;
}
@keyframes livo-cart-spin {
  to { transform: rotate(360deg); }
}
.livo-totals-h {
  font-size: 18px;
  font-weight: 700;
  color: #111;
  margin: 0 0 20px;
}
.livo-totals-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #EBEBEB;
}
.livo-totals-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
.livo-totals-k { color: #555; font-weight: 400; }
.livo-totals-v { color: #111; font-weight: 600; text-align: right; }

/* Items row — label with qty */
.livo-totals-row--items {
  align-items: center;
}
.livo-totals-items-k {
  font-size: 14px;
  color: #555555;
  line-height: 1.4;
}
.livo-totals-items-v {
  font-size: 14px;
  line-height: 1.4;
  flex-shrink: 0;
}
.livo-totals-ship { font-weight: 400 !important; color: #555 !important; font-size: 13px; }

.livo-totals-grand {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.livo-totals-grand-k {
  font-size: 14px;
  font-weight: 600;
  color: #111;
}
.livo-totals-grand-v {
  font-size: 24px;
  font-weight: 700;
  color: #111;
  line-height: 1;
  transition: color 0.3s ease, opacity 0.3s ease;
}
.livo-totals-grand-v.livo-total-flash {
  animation: livo-total-flash 0.65s ease;
}
@keyframes livo-total-flash {
  0%   { color: #111; opacity: 0.45; }
  45%  { color: #FF4A00; opacity: 1; }
  100% { color: #111; opacity: 1; }
}
.livo-totals-grand-v .woocommerce-Price-amount { font-weight: 700; }

/* Checkout button — orange, full width */
.livo-cart-totals .wc-proceed-to-checkout { padding: 0; }
.livo-cart-totals .checkout-button,
.livo-cart-totals a.checkout-button {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 56px;
  background: #FF4A00 !important;
  color: #FFFFFF !important;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s;
  box-shadow: none;
  filter: none;
  padding: 0;
}
.livo-cart-totals .checkout-button:hover,
.livo-cart-totals a.checkout-button:hover {
  background: #E04100 !important;
  color: #fff !important;
  filter: none;
}

/* Hide default WC tables if any leak through */
.livo-cart .shop_table { display: none; }

/* Suppress inline WC notices on cart (toast replaces them) */
.woocommerce-cart .woocommerce-notices-wrapper,
.woocommerce-cart > .woocommerce-message,
.woocommerce-cart .woocommerce-message {
  display: none !important;
}

/* ── Toast notification ── */
.livo-cart-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 99999;
  background: #111111;
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.1px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
  transform: translateX(calc(100% + 40px));
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
  pointer-events: none;
}
.livo-cart-toast.show {
  transform: translateX(0);
  opacity: 1;
}

/* Empty cart */
.livo-cart-empty-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 280px;
  grid-template-columns: 1fr;
}
.livo-cart-empty-wrap .cart-empty {
  margin: 0 0 20px;
  font-size: 16px;
  color: #555;
}
.livo-cart-empty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 28px;
  background: #111;
  color: #fff;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s;
}
.livo-cart-empty-btn:hover { background: #333; color: #fff; }

/* ════════════════ Responsive ════════════════ */
@media (max-width: 1024px) {
  .livo-cart-layout {
    flex-direction: column;
    padding: 28px;
    gap: 28px;
  }
  .livo-cart-sidebar {
    position: relative;
    top: auto;
    flex: none;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .livo-cart { padding: 16px; }
  .livo-cart-layout { padding: 20px 16px; border-radius: 16px; }
  .livo-cart-item {
    grid-template-columns: 64px 1fr;
    padding: 20px 36px 20px 0;
    gap: 0 14px;
  }
  .livo-cart-thumb img { width: 64px; height: 64px; }
  .livo-cart-name { font-size: 14px; }
  .livo-cart-meta { font-size: 14px; flex-wrap: wrap; gap: 8px; }
  .livo-totals-grand-v { font-size: 20px; }
}
