/* ==========================================================================
   features.css — wishlist, compare, quick view, mini-cart, countdown,
   toast, top call bar, motion. Loaded on every page when a feature is on.
   ========================================================================== */

/* ---------- Tool buttons ---------- */
.tt-tools--card {
	position: absolute; top: 10px; inset-inline-end: 10px; z-index: 3;
	display: flex; flex-direction: column; gap: 6px;
}
.tt-tools--card .tt-tool {
	width: 36px; height: 36px; display: grid; place-items: center; padding: 0;
	border: 1px solid var(--tt-line); border-radius: 50%; background: var(--tt-surface); color: var(--tt-muted);
	box-shadow: var(--tt-shadow-sm); transition: color .15s, border-color .15s, transform .16s var(--tt-ease);
}
.tt-tools--card .tt-tool:hover { color: var(--tt-primary); border-color: var(--tt-primary); }
@media (hover: hover) and (min-width: 901px) {
	.tt-tools--card { opacity: 0; transform: translateX(-6px); transition: opacity .18s var(--tt-ease), transform .18s var(--tt-ease); }
	li.tt-card:hover .tt-tools--card, li.tt-card:focus-within .tt-tools--card { opacity: 1; transform: none; }
}
.tt-tool[aria-pressed="true"] { color: var(--tt-danger); border-color: var(--tt-danger); }
.tt-tool[data-tt-toggle="compare"][aria-pressed="true"] { color: var(--tt-primary); border-color: var(--tt-primary); }
.tt-tool[aria-pressed="true"] .tt-icon, .tt-tool[data-tt-toggle="wishlist"][aria-pressed="true"] svg { fill: currentColor; }
.tt-tool[data-tt-toggle="compare"][aria-pressed="true"] svg { fill: none; }

.tt-tools--single { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.tt-tools--single .tt-tool, .tt-qv__actions .tt-tool {
	display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px;
	border: 1px solid var(--tt-line); border-radius: 999px; background: var(--tt-surface); color: var(--tt-text);
	font-size: var(--tt-fs-sm); font-weight: 600;
}
.tt-tools--single .tt-tool:hover, .tt-qv__actions .tt-tool:hover { border-color: var(--tt-primary); color: var(--tt-primary); }

/* Empty price */
.tt-ask-price { color: var(--tt-success); font-weight: 700; font-size: var(--tt-fs-sm); }

/* ---------- Countdown ---------- */
.tt-countdown {
	display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 999px;
	background: var(--tt-danger-soft); color: var(--tt-danger); font-size: var(--tt-fs-xs); font-weight: 700;
	font-variant-numeric: tabular-nums;
}
.tt-countdown__time { direction: rtl; unicode-bidi: isolate; white-space: nowrap; }
.tt-countdown__time bdi { font-variant-numeric: tabular-nums; }
.tt-countdown--card { margin-top: 6px; align-self: flex-start; max-width: 100%; white-space: nowrap; }
@container tt-card (max-width: 210px) { .tt-countdown--card .tt-countdown__label { display: none; } .tt-countdown--card { font-size: 11px; } }
.tt-countdown--single { margin: -4px 0 14px; font-size: var(--tt-fs-sm); padding: 6px 14px; }

/* ---------- Badges / counts ---------- */
.tt-badge {
	position: absolute; top: -6px; inset-inline-start: -8px; min-width: 18px; height: 18px; padding: 0 4px;
	display: grid; place-items: center; border-radius: 9px;
	background: var(--tt-primary); color: #fff; font-size: 10px; font-weight: 700; line-height: 1;
}

/* ---------- Toast ---------- */
.tt-toast {
	position: fixed; z-index: 120; inset-inline: 16px; bottom: calc(var(--tt-mobilenav-h) + 24px + env(safe-area-inset-bottom));
	max-width: 420px; margin-inline: auto; padding: 12px 16px; border-radius: var(--tt-r);
	background: #1c1c1c; color: #fff; font-size: var(--tt-fs-sm); font-weight: 600; text-align: center;
	opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s, transform .2s;
}
.tt-toast.is-on { opacity: 1; transform: none; }
@media (min-width: 901px) { .tt-toast { bottom: 24px; } }

/* ---------- Sheets (side) + modals (center) ---------- */
.tt-sheet, .tt-modal {
	padding: 0; border: 0; background: var(--tt-surface); color: var(--tt-text);
	display: none; flex-direction: column; overscroll-behavior: contain;
}
.tt-sheet[open], .tt-modal[open] { display: flex; }
.tt-sheet::backdrop, .tt-modal::backdrop { background: var(--tt-scrim); }
.tt-sheet {
	position: fixed; inset-block: 0; inset-inline-end: 0; inset-inline-start: auto; margin: 0;
	width: min(420px, 92vw); height: 100dvh; max-height: none; max-width: none;
	box-shadow: 12px 0 32px rgba(0, 0, 0, .18);
}
.tt-sheet[open] { animation: tt-sheet-in .22s var(--tt-ease); }
@keyframes tt-sheet-in { from { transform: translateX(-100%); } to { transform: none; } }
[dir="ltr"] .tt-sheet[open] { animation-name: tt-sheet-in-ltr; }
@keyframes tt-sheet-in-ltr { from { transform: translateX(100%); } to { transform: none; } }
.tt-modal {
	margin: auto; width: min(880px, 94vw); max-height: min(88vh, 760px);
	border-radius: var(--tt-r-lg); box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
}
.tt-modal--wide { width: min(1100px, 96vw); }
.tt-modal[open] { animation: tt-pop .2s var(--tt-ease); }
@keyframes tt-pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.tt-sheet__head {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 12px 16px; border-bottom: 1px solid var(--tt-line); min-height: 64px; flex-shrink: 0;
}
.tt-sheet__head strong { display: inline-flex; align-items: center; gap: 8px; font-size: var(--tt-fs-md); }
.tt-sheet__body { flex: 1; overflow: auto; padding: 16px; min-height: 0; }
.tt-empty-state { padding: 40px 12px; text-align: center; color: var(--tt-muted); }

/* Mini-cart (WooCommerce widget markup) */
#tt-minicart .woocommerce-mini-cart { list-style: none; margin: 0; padding: 0; }
#tt-minicart .woocommerce-mini-cart-item {
	position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: 12px; align-items: center;
	padding: 12px 0 12px 32px; border-bottom: 1px solid var(--tt-line); font-size: var(--tt-fs-sm);
}
#tt-minicart .woocommerce-mini-cart-item a:not(.remove) { display: contents; font-weight: 700; }
#tt-minicart .woocommerce-mini-cart-item img { grid-row: span 2; width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: var(--tt-r-sm); margin: 0; float: none; }
#tt-minicart .woocommerce-mini-cart-item .quantity { color: var(--tt-muted); font-size: var(--tt-fs-xs); grid-column: 2; }
#tt-minicart .woocommerce-mini-cart-item .remove {
	position: absolute; inset-inline-end: 0; top: 50%; transform: translateY(-50%);
	width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%;
	color: var(--tt-danger) !important; background: var(--tt-danger-soft); font-size: 18px; line-height: 1; text-decoration: none;
}
#tt-minicart .woocommerce-mini-cart__total { display: flex; justify-content: space-between; padding: 16px 0; font-size: var(--tt-fs-md); margin: 0; }
#tt-minicart .woocommerce-mini-cart__buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
#tt-minicart .woocommerce-mini-cart__buttons .button {
	display: flex; align-items: center; justify-content: center; min-height: 46px; margin: 0;
	border-radius: var(--tt-r-sm); border: 1px solid var(--tt-line); background: var(--tt-surface); color: var(--tt-text); font-weight: 700;
}
#tt-minicart .woocommerce-mini-cart__buttons .button.checkout { background: var(--tt-primary); border-color: var(--tt-primary); color: var(--tt-on-primary); }
#tt-minicart .woocommerce-mini-cart__empty-message { padding: 40px 0; text-align: center; color: var(--tt-muted); }

/* Wishlist list */
.tt-wl { list-style: none; margin: 0; padding: 0; }
.tt-wl__item { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px 12px; padding: 12px 0; border-bottom: 1px solid var(--tt-line); }
.tt-wl__media img { width: 72px; height: 72px; object-fit: contain; background: #fff; border-radius: var(--tt-r-sm); }
.tt-wl__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tt-wl__name { font-weight: 700; font-size: var(--tt-fs-sm); line-height: 1.7; }
.tt-wl__price { font-weight: 800; font-size: var(--tt-fs-sm); }
.tt-wl__price del { color: var(--tt-muted); font-weight: 400; margin-inline-end: 6px; }
.tt-wl__price ins { text-decoration: none; }
.tt-wl__stock { font-size: var(--tt-fs-xs); font-weight: 700; }
.tt-wl__stock.is-in { color: var(--tt-success); }
.tt-wl__stock.is-out { color: var(--tt-danger); }
.tt-wl__actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.tt-wl__actions .tt-btn { flex: 1; min-height: 40px; }

/* Compare table */
.tt-cmp { overflow-x: auto; }
.tt-cmp__table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 560px; font-size: var(--tt-fs-sm); }
.tt-cmp__table th, .tt-cmp__table td { padding: 10px 12px; border-bottom: 1px solid var(--tt-line); text-align: center; vertical-align: top; min-width: 170px; }
.tt-cmp__label { position: sticky; inset-inline-start: 0; z-index: 1; background: var(--tt-bg); text-align: start !important; min-width: 110px !important; width: 110px; font-weight: 700; }
.tt-cmp__prod { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; line-height: 1.7; }
.tt-cmp__prod img { width: 110px; height: 110px; object-fit: contain; background: #fff; border-radius: var(--tt-r-sm); }
.tt-cmp__price { font-weight: 800; margin: 6px 0 8px; }
.tt-cmp__price ins { text-decoration: none; }
.tt-cmp__table td { position: relative; }
.tt-cmp__remove { position: absolute; top: 6px; inset-inline-end: 6px; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--tt-danger-soft); color: var(--tt-danger); }
.tt-cmp .tt-btn { min-height: 38px; font-size: var(--tt-fs-xs); }

/* Quick view */
.tt-qv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.tt-qv__main { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: var(--tt-r); border: 1px solid var(--tt-line); }
.tt-qv__thumbs { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; }
.tt-qv__thumb { flex: 0 0 64px; padding: 0; border: 1px solid var(--tt-line); border-radius: var(--tt-r-sm); background: #fff; overflow: hidden; }
.tt-qv__thumb img { display: block; width: 64px; height: 64px; object-fit: contain; }
.tt-qv__info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tt-qv__title { font-size: var(--tt-fs-lg); margin: 0; }
.tt-qv__price { font-size: 1.25rem; font-weight: 900; }
.tt-qv__price del { color: var(--tt-muted); font-size: var(--tt-fs); font-weight: 400; margin-inline-end: 8px; }
.tt-qv__price ins { text-decoration: none; color: var(--tt-danger); }
.tt-qv__short { color: var(--tt-muted); font-size: var(--tt-fs-sm); }
.tt-qv__attrs { display: grid; gap: 4px; margin: 0; font-size: var(--tt-fs-sm); }
.tt-qv__attrs div { display: flex; gap: 8px; }
.tt-qv__attrs dt { color: var(--tt-muted); min-width: 90px; }
.tt-qv__attrs dd { margin: 0; font-weight: 600; }
.tt-qv__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.tt-qv__actions > .tt-btn { flex: 1 1 180px; min-height: 48px; }
.tt-qv__more { color: var(--tt-primary); font-weight: 700; font-size: var(--tt-fs-sm); }

/* ---------- Top call bar: desktop floating pill (after the header scrolls away) ---------- */
@media (min-width: 901px) {
	.tt-phonebar.tt-phonebar--top {
		display: inline-flex; align-items: center; gap: 10px; position: fixed; z-index: 72;
		top: 12px; left: 50%; padding: 10px 22px; border-radius: 999px;
		background: var(--tt-primary); color: #fff; font-weight: 800; box-shadow: 0 10px 24px rgba(36, 100, 236, .3);
		transform: translate(-50%, -160%); transition: transform .25s var(--tt-ease);
	}
	.tt-phonebar.tt-phonebar--top:hover { color: #fff; background: var(--tt-primary-600, #1c54cf); }
	.tt-phonebar.tt-phonebar--top.is-visible { transform: translate(-50%, 0); }
	.admin-bar .tt-phonebar--top { top: 44px; }
	/* Product pages have the buy bar + phone in the buy box; the pill would cover the sticky tab bar. */
	body.single-product .tt-phonebar.tt-phonebar--top { display: none; }
}
/* ---------- Top call bar (mobile) ---------- */
@media (max-width: 900px) {
	.tt-phonebar.tt-phonebar--top {
		bottom: auto; top: 8px; inset-inline: 10px; z-index: 72; height: 52px; border-radius: var(--tt-r-lg);
		font-size: var(--tt-fs); box-shadow: 0 10px 24px rgba(36, 100, 236, .3);
		transform: translateY(-140%); transition: transform .25s var(--tt-ease);
	}
	.tt-phonebar.tt-phonebar--top.is-visible { transform: none; }
	body.tt-evo.tt-has-topcall { padding-bottom: calc(var(--tt-mobilenav-h) + 8px + env(safe-area-inset-bottom)); }
	.admin-bar .tt-phonebar--top { top: 54px; }

	.tt-qv { grid-template-columns: 1fr; gap: 14px; }
	.tt-modal { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: var(--tt-r-lg) var(--tt-r-lg) 0 0; }
	.tt-modal[open] { animation: tt-up .22s var(--tt-ease); }
	@keyframes tt-up { from { transform: translateY(100%); } to { transform: none; } }
}

/* ---------- Motion (html.tt-anim = allowed on this device; set in <head>) ---------- */
.tt-anim .tt-reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s var(--tt-ease), transform .6s var(--tt-ease); }
.tt-anim .tt-reveal.is-in { opacity: 1; transform: none; }
/* Cards inside a revealed section come in one after another. */
.tt-anim .tt-reveal ul.tt-products__grid > li { opacity: 0; transform: translateY(16px); transition: opacity .45s var(--tt-ease), transform .45s var(--tt-ease); }
.tt-anim .tt-reveal.is-in ul.tt-products__grid > li { opacity: 1; transform: none; }
.tt-anim .tt-reveal.is-in ul.tt-products__grid > li:nth-child(2) { transition-delay: .06s; }
.tt-anim .tt-reveal.is-in ul.tt-products__grid > li:nth-child(3) { transition-delay: .12s; }
.tt-anim .tt-reveal.is-in ul.tt-products__grid > li:nth-child(4) { transition-delay: .18s; }
.tt-anim .tt-reveal.is-in ul.tt-products__grid > li:nth-child(5) { transition-delay: .24s; }
.tt-anim .tt-reveal.is-in ul.tt-products__grid > li:nth-child(n+6) { transition-delay: .3s; }

/* Hover: lift + light sweep over banners, promo tiles, guide cards, categories. */
.tt-anim .tt-promo, .tt-anim .tt-guide__card, .tt-anim .tt-cat, .tt-anim .tt-trust__item, .tt-anim .tt-brand, .tt-anim .tt-catbanner__link { transition: transform .3s var(--tt-ease), box-shadow .3s, border-color .15s; }
@media (hover: hover) and (pointer: fine) { .tt-anim a.tt-promo:hover, .tt-anim a.tt-guide__card:hover, .tt-anim .tt-cat:hover, .tt-anim .tt-brand:hover, .tt-anim .tt-trust__item:hover { transform: translateY(-5px); box-shadow: 0 14px 28px rgba(16, 34, 64, .12); } }
.tt-anim .tt-promo, .tt-anim .tt-catbanner__link, .tt-anim .tt-guide__banner, .tt-anim .tt-guide__card--img { position: relative; overflow: hidden; isolation: isolate; }
.tt-anim .tt-promo::after, .tt-anim .tt-catbanner__link::after, .tt-anim .tt-guide__banner::after, .tt-anim .tt-guide__card--img::after {
	content: ""; position: absolute; inset-block: 0; inset-inline-start: -60%; width: 40%; z-index: 2; pointer-events: none;
	background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent); transform: skewX(-18deg);
	transition: inset-inline-start .7s var(--tt-ease);
}
@media (hover: hover) and (pointer: fine) { .tt-anim .tt-promo:hover::after, .tt-anim .tt-catbanner__link:hover::after, .tt-anim .tt-guide__banner:hover::after, .tt-anim .tt-guide__card--img:hover::after { inset-inline-start: 130%; } }
.tt-anim .tt-promo img, .tt-anim .tt-catbanner__img, .tt-anim .tt-guide__banner img, .tt-anim .tt-guide__media img { transition: transform .6s var(--tt-ease); }
@media (hover: hover) and (pointer: fine) { .tt-anim .tt-promo:hover img, .tt-anim .tt-catbanner__link:hover .tt-catbanner__img, .tt-anim .tt-guide__banner:hover img, .tt-anim .tt-guide__card--img:hover .tt-guide__media img { transform: scale(1.04); } }
/* Buttons: soft press + arrow nudge. */
.tt-anim .tt-btn { transition: transform .16s var(--tt-ease), background-color .15s, border-color .15s, color .15s, box-shadow .2s; }
.tt-anim .tt-btn:active { transform: scale(var(--tt-press, .97)); }
.tt-anim .tt-section__more .tt-icon { transition: transform .2s var(--tt-ease); }
@media (hover: hover) and (pointer: fine) { 
	.tt-anim .tt-section__more:hover .tt-icon { transform: translateX(-4px); }
	[dir="ltr"] .tt-anim .tt-section__more:hover .tt-icon { transform: translateX(4px); }
}
/* Hero: gentle zoom on the active slide. */
@keyframes tt-kenburns { from { transform: scale(1); } to { transform: scale(1.05); } }
.tt-anim .tt-slider__slide.is-active img { animation: tt-kenburns 7s ease-out both; }

/* YITH heart inside theme tools (card overlay + rail) */
.tt-tool--yith { position: relative; }
.tt-tool--yith .yith-wcwl-add-to-wishlist { margin: 0 !important; }
.tt-tool--yith a, .tt-tool--yith .yith-wcwl-wishlistaddedbrowse a, .tt-tool--yith .yith-wcwl-wishlistexistsbrowse a {
	display: grid !important; place-items: center; width: 100%; height: 100%; color: inherit; font-size: 0 !important; line-height: 0;
}
.tt-tool--yith a svg, .tt-tool--yith a img, .tt-tool--yith a i { width: 20px !important; height: 20px !important; margin: 0 !important; font-size: 20px; color: inherit; }
.tt-tool--yith .yith-wcwl-wishlistaddedbrowse a svg, .tt-tool--yith .yith-wcwl-wishlistexistsbrowse a svg { color: var(--tt-danger); fill: currentColor; }
.tt-tool--yith .feedback, .tt-tool--yith .separator, .tt-tool--yith .ajax-loading { display: none !important; }
.tt-tool--yith a span, .tt-tool--yith .yith-wcwl-add-button span { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tt-tool--yith .yith-wcwl-add-to-wishlist, .tt-tool--yith .yith-wcwl-add-button { width: 100%; height: 100%; }


/* ---------- Mini-cart remove (×): bigger + 44px hit area (0.9.21) ---------- */
#tt-minicart .woocommerce-mini-cart-item { padding-inline-end: 44px; }
#tt-minicart .woocommerce-mini-cart-item .remove {
	width: 34px; height: 34px; font-size: 20px; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
	transition: transform .16s var(--tt-ease), background-color .15s, color .15s;
}
#tt-minicart .woocommerce-mini-cart-item .remove::after { content: ""; position: absolute; inset: -5px; }
#tt-minicart .woocommerce-mini-cart-item .remove:active { transform: translateY(-50%) scale(calc(var(--tt-press, .95) - .05)); }
