/* TopDeals mini-cart (partials/cart.blade.php) and cart page (views/ecommerce/cart.blade.php). */
.td-mc, .td-cartpage { --p-navy: #0b1638; --p-yellow: #ffc812; --p-yellow-2: #ffb800; --p-red: #ee2e3a; --p-green: #1f9d55; --p-line: #e7e9ef; --p-soft: #f5f6fa; --p-muted: #6b7385; --p-text: #3a4155; --p-blue: #1a5fd0; font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--p-navy); }
.td-mc a, .td-cartpage a { text-decoration: none; }

/* ---------- Mini-cart ---------- */
.td-header .ps-cart--mini .td-mc { width: 380px; min-height: 0 !important; max-height: none !important; padding: 0 !important; border: 1px solid var(--p-line) !important; border-radius: 12px; background: #fff; box-shadow: 0 18px 40px rgba(11, 22, 56, .18); overflow: hidden; }
.td-header .ps-cart--mini .td-mc::before { display: none; }
.td-mc__head { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--p-line); }
.td-mc__head b { font-size: 16px; font-weight: 800; }
.td-mc__head span { font-size: 13px; color: var(--p-muted); }
.td-mc__items { max-height: 340px; overflow-y: auto; padding: 4px 16px !important; scrollbar-width: thin; }
.td-mc__item { position: relative; display: flex !important; gap: 12px; padding: 12px 22px 12px 0 !important; margin: 0 !important; border-bottom: 1px solid var(--p-line); }
.td-mc__item:last-child { border-bottom: 0; }
.td-mc__img { flex: 0 0 60px; width: 60px; height: 60px; border-radius: 8px; border: 1px solid var(--p-line); background: #fff; display: grid; place-items: center; overflow: hidden; }
.td-mc__img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.td-mc__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.td-mc__name { font-size: 13px; font-weight: 500; line-height: 1.35; color: var(--p-navy) !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.td-mc__name:hover { color: var(--p-blue) !important; }
.td-mc__attrs { font-size: 12px; color: var(--p-muted); }
.td-mc__stock { font-size: 12px; color: var(--p-red); }
.td-mc__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; font-size: 13px; }
.td-mc__qty { color: var(--p-muted); }
.td-mc__price b { font-weight: 800; color: var(--p-navy); }
.td-mc__price b.is-sale { color: var(--p-red); }
.td-mc__price del { font-size: 11.5px; color: #8a90a0; }
.td-mc__remove { position: absolute !important; top: 12px; right: 0; left: auto !important; width: 22px; height: 22px; border-radius: 50%; display: grid !important; place-items: center; color: #8a90a0 !important; font-size: 11px; background: var(--p-soft); }
.td-mc__remove:hover { background: #fde7e8; color: var(--p-red) !important; }
.td-mc__foot { padding: 12px 16px 16px !important; border-top: 1px solid var(--p-line); background: #fafbfc; }
.td-mc__row { display: flex; justify-content: space-between; margin: 0 0 4px; font-size: 13px; color: var(--p-text); }
.td-mc__total { display: flex !important; justify-content: space-between; align-items: baseline; margin: 2px 0 2px !important; font-size: 15px !important; font-weight: 700 !important; color: var(--p-navy) !important; font-family: inherit !important; }
.td-mc__total strong { font-size: 20px; font-weight: 800; color: var(--p-navy) !important; float: none !important; }
.td-mc__note { margin: 0 0 12px; font-size: 12px; color: var(--p-muted); }
.td-mc__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.td-mc__btn { display: flex; align-items: center; justify-content: center; height: 42px; border-radius: 9px; background: var(--p-yellow); color: var(--p-navy) !important; font-size: 14px; font-weight: 700; transition: background .15s; }
.td-mc__btn:hover { background: var(--p-yellow-2); }
.td-mc__btn--ghost { background: #fff; border: 1.5px solid var(--p-navy); }
.td-mc__btn--ghost:hover { background: var(--p-soft); }
.td-mc__free { margin-bottom: 12px; font-size: 12.5px; color: var(--p-text); }
.td-mc__free b { color: var(--p-navy); }
.td-mc__free .is-done { display: inline-flex; align-items: center; gap: 6px; color: var(--p-green); font-weight: 600; }
.td-mc__bar { display: block; height: 6px; margin-top: 6px; border-radius: 3px; background: #e6e9f0; overflow: hidden; }
.td-mc__bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--p-yellow), var(--p-green)); }
.td-mc__empty { display: flex !important; flex-direction: column; align-items: center; gap: 6px; padding: 28px 20px !important; text-align: center; }
.td-mc__empty > i { width: 64px; height: 64px; border-radius: 50%; background: var(--p-soft); display: grid; place-items: center; font-size: 28px; color: var(--p-navy); margin-bottom: 6px; }
.td-mc__empty b { font-size: 16px; font-weight: 800; }
.td-mc__empty span { font-size: 13px; color: var(--p-muted); margin-bottom: 8px; }
.td-mc__empty .td-mc__btn { width: 100%; }
/* Phone cart panel */
#cart-mobile .td-mc { width: auto; min-height: 0 !important; border: 0; box-shadow: none; }
#cart-mobile .td-mc__items { max-height: none; }

/* ---------- Cart page ---------- */
.td-cartpage { padding: 6px 0 20px; }
.td-cartpage__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.td-cartpage__head h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -.6px; color: var(--p-navy); font-family: inherit; }
.td-cartpage__head span { font-size: 15px; color: var(--p-muted); }
.td-cartpage__grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.td-cartpage__items { margin: 0; }
.td-cartpage__items .ps-table--shopping-cart { border: 1px solid var(--p-line); border-radius: 12px; background: #fff; overflow: hidden; }
.td-ci { display: grid; grid-template-columns: 96px minmax(0, 1fr) 110px auto 110px; align-items: center; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--p-line); }
.td-ci:last-child { border-bottom: 0; }
.td-ci__img { width: 96px; height: 96px; border-radius: 10px; border: 1px solid var(--p-line); background: #fff; display: grid; place-items: center; overflow: hidden; }
.td-ci__img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.td-ci__info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.td-ci__name { font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--p-navy) !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.td-ci__name:hover { color: var(--p-blue) !important; }
.td-ci__attrs, .td-ci__seller { font-size: 12.5px; color: var(--p-muted); }
.td-ci__seller a { color: var(--p-blue) !important; }
.td-ci__stock { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--p-green); }
.td-ci__stock.is-out { color: var(--p-red); }
.td-ci__actions { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 4px; }
.td-ci__actions a { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--p-text) !important; }
.td-ci__remove:hover { color: var(--p-red) !important; }
.td-ci__wish:hover, .td-ci__wish.active { color: var(--p-red) !important; }
.td-ci__price { display: flex; flex-direction: column; align-items: flex-end; }
.td-ci__price b { font-size: 16px; font-weight: 800; color: var(--p-navy); }
.td-ci__price b.is-sale { color: var(--p-red); }
.td-ci__price del { font-size: 12.5px; color: #8a90a0; }
.td-ci__total { text-align: right; font-size: 17px; font-weight: 800; color: var(--p-navy); }
.td-cartpage .td-qty { display: inline-flex !important; align-items: center; height: 40px; border: 1px solid var(--p-line); border-radius: 9px; overflow: hidden; background: #fff; position: static !important; width: auto !important; max-width: none !important; margin: 0 !important; }
.td-cartpage .td-qty button { position: static !important; width: 36px; height: 100%; border: 0; background: none; color: var(--p-navy); display: grid; place-items: center; transform: none !important; font-size: 13px; cursor: pointer; }
.td-cartpage .td-qty button:hover { background: var(--p-soft); }
.td-cartpage .td-qty input { width: 46px !important; height: 100% !important; padding: 0 !important; border: 0 !important; border-left: 1px solid var(--p-line) !important; border-right: 1px solid var(--p-line) !important; border-radius: 0 !important; text-align: center; font-size: 15px; font-weight: 600; color: var(--p-navy); -moz-appearance: textfield; }
.td-cartpage .td-qty input::-webkit-outer-spin-button, .td-cartpage .td-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.td-cartpage__back { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 14px; font-weight: 600; color: var(--p-blue) !important; }
.td-cartpage .content-loading { opacity: .55; pointer-events: none; }

.td-sum { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--p-line); border-radius: 12px; background: #fff; box-shadow: 0 2px 10px rgba(11, 22, 56, .04); }
.td-sum h2 { margin: 0 0 6px; font-size: 18px; font-weight: 800; letter-spacing: -.3px; color: var(--p-navy); font-family: inherit; }
.td-sum__row { display: flex; justify-content: space-between; gap: 10px; margin: 0; font-size: 14px; color: var(--p-text); }
.td-sum__row.is-saving span:last-child { color: var(--p-green); font-weight: 600; }
.td-sum__row a { margin-left: 6px; font-size: 12.5px; color: var(--p-red) !important; }
.td-sum__muted { color: var(--p-muted); font-size: 13px; }
.td-sum__total { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0 4px; padding-top: 12px; border-top: 1px solid var(--p-line); font-size: 16px; font-weight: 700; color: var(--p-navy); }
.td-sum__total b { font-size: 26px; font-weight: 800; letter-spacing: -.6px; }
.td-sum__coupon { display: flex; gap: 8px; margin: 4px 0; }
.td-sum__coupon input { flex: 1; min-width: 0; height: 42px !important; border: 1px solid var(--p-line) !important; border-radius: 9px !important; padding: 0 12px !important; font-size: 14px; }
.td-sum__coupon button { height: 42px; padding: 0 16px; border: 1.5px solid var(--p-navy); border-radius: 9px; background: #fff; font: inherit; font-size: 14px; font-weight: 700; color: var(--p-navy); cursor: pointer; }
.td-sum__coupon button:hover { background: var(--p-soft); }
.td-sum__checkout { display: flex !important; align-items: center; justify-content: center; gap: 10px; height: 50px; border-radius: 10px; background: var(--p-yellow); color: var(--p-navy) !important; font-size: 16.5px; font-weight: 700; transition: background .15s; }
.td-sum__checkout:hover { background: var(--p-yellow-2); }
.td-cartpage .td-pd-secure { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 4px 0 0; font-size: 13px; color: var(--p-muted); }
.td-cartpage .td-pd-pay { justify-content: center; }
.td-cartpage .td-pd-pay li span { border: 1px solid var(--p-line); }

.td-cartpage__empty { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 420px; margin: 20px auto 10px; padding: 40px 24px; border: 1px solid var(--p-line); border-radius: 16px; text-align: center; }
.td-cartpage__empty > i { width: 84px; height: 84px; border-radius: 50%; background: var(--p-soft); display: grid; place-items: center; font-size: 36px; color: var(--p-navy); }
.td-cartpage__empty h2 { margin: 6px 0 0; font-size: 22px; font-weight: 800; font-family: inherit; }
.td-cartpage__empty p { margin: 0 0 10px; color: var(--p-muted); }
.td-cartpage__empty .td-sum__checkout { width: 100%; }
.td-cartpage .td-pd-related { margin-top: 30px; }
.td-cartpage .td-pd-also__head { margin-bottom: 12px; }
.td-cartpage .td-pd-also__head h2 { margin: 0; font-size: 18px; font-weight: 800; }
.td-cartpage .td-card__vendor { display: none; }

@media (max-width: 1100px) {
    .td-cartpage__grid { grid-template-columns: minmax(0, 1fr); }
    .td-sum { position: static; }
}
@media (max-width: 767px) {
    .td-cartpage__head h1 { font-size: 22px; }
    .td-ci { grid-template-columns: 76px minmax(0, 1fr) auto; grid-template-areas: 'img info info' 'img price qty' 'img total total'; gap: 8px 12px; padding: 14px; }
    .td-ci__img { grid-area: img; width: 76px; height: 76px; align-self: start; }
    .td-ci__info { grid-area: info; }
    .td-ci__price { grid-area: price; align-items: flex-start; }
    .td-ci .td-qty { grid-area: qty; }
    .td-ci__total { grid-area: total; text-align: left; font-size: 15px; }
    .td-header .ps-cart--mini .td-mc { width: 320px; }
}
