/* ==========================================================================
   TattooClub — Shared Loading / Skeleton States
   Reusable across Boutique, Search, Quiz, PDP, Cart and Checkout.
   Neutral/light-grey skeletons; electric green reserved for active/progress
   states (spinners, progress fills) per the TattooClub design system.
   ========================================================================== */

:root{
	--tc-skel-base: #EAE6DC;
	--tc-skel-highlight: #F6F3EC;
	--tc-skel-dark: #111111;
	--tc-skel-green: #B7E41C;
	--tc-skel-overlay-bg: rgba(249, 245, 239, 0.72);
	--tc-skel-radius: 14px;
}

@keyframes tc-shimmer{
	0%{ background-position: -200% 0; }
	100%{ background-position: 200% 0; }
}
@keyframes tc-spin{
	to{ transform: rotate(360deg); }
}
@keyframes tc-pulse{
	0%, 100%{ opacity: 1; }
	50%{ opacity: .55; }
}

.tc-skel{
	position: relative;
	display: block;
	background-color: var(--tc-skel-base);
	background-image: linear-gradient(90deg, var(--tc-skel-base) 25%, var(--tc-skel-highlight) 50%, var(--tc-skel-base) 75%);
	background-size: 200% 100%;
	animation: tc-shimmer 1.6s ease-in-out infinite;
	border-radius: 10px;
	overflow: hidden;
}
@media (prefers-reduced-motion: reduce){
	.tc-skel{ animation: tc-pulse 1.8s ease-in-out infinite; background-image: none; }
}

.tc-skel-text{ height: .85em; margin: .35em 0; width: 100%; border-radius: 6px; }
.tc-skel-text.tc-w-60{ width: 60%; }
.tc-skel-text.tc-w-40{ width: 40%; }
.tc-skel-text.tc-w-80{ width: 80%; }
.tc-skel-block{ width: 100%; height: 100%; }
.tc-skel-circle{ border-radius: 50%; }
.tc-skel-img{ width: 100%; aspect-ratio: 1 / 1; border-radius: var(--tc-skel-radius); }
.tc-skel-btn{ width: 100%; max-width: 220px; height: 44px; border-radius: 999px; }

li.product.tc-skel-card{
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.tc-skel-card .tc-skel-img{ margin-bottom: 4px; }
.tc-skel-card .tc-skel-title{ height: 1em; width: 70%; }
.tc-skel-card .tc-skel-price{ height: .9em; width: 35%; }
.tc-skel-card .tc-skel-cta{ height: 39px; width: 65%; border-radius: 999px; margin-top: 6px; }

.tc-skel-hlist{
	display: flex;
	gap: 16px;
	overflow: hidden;
	padding: 2px;
}
.tc-skel-hlist .tc-skel-card{
	flex: 0 0 auto;
	width: 160px;
}
@media (max-width: 767px){
	.tc-skel-hlist .tc-skel-card{ width: 130px; }
}

.tc-skel-filter{ height: 44px; width: 180px; max-width: 100%; border-radius: 10px; }

.tc-img-loading{ position: relative; }
.tc-img-loading > img{ opacity: 0; transition: opacity .25s ease; }
.tc-img-loading::before{
	content: '';
	position: absolute; inset: 0;
	background-color: var(--tc-skel-base);
	background-image: linear-gradient(90deg, var(--tc-skel-base) 25%, var(--tc-skel-highlight) 50%, var(--tc-skel-base) 75%);
	background-size: 200% 100%;
	animation: tc-shimmer 1.6s ease-in-out infinite;
	border-radius: inherit;
}
.tc-img-loaded > img{ opacity: 1; }
.tc-img-loaded::before{ display: none; }
@media (prefers-reduced-motion: reduce){
	.tc-img-loading::before{ animation: tc-pulse 1.8s ease-in-out infinite; background-image: none; }
}

.tc-btn-loading{
	position: relative;
	pointer-events: none;
	cursor: default;
	color: transparent !important;
	opacity: .85;
}
.tc-btn-loading > *{ visibility: hidden; }
.tc-btn-loading::after{
	content: '';
	position: absolute;
	top: 50%; left: 50%;
	width: 18px; height: 18px;
	margin: -9px 0 0 -9px;
	border-radius: 50%;
	border: 2px solid rgba(17, 17, 17, .18);
	border-top-color: var(--tc-skel-dark);
	animation: tc-spin .7s linear infinite;
}
.tc-btn-loading.tc-btn-loading--on-dark::after{
	border-color: rgba(255, 255, 255, .25);
	border-top-color: var(--tc-skel-green);
}

.tc-loading-overlay{
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--tc-skel-overlay-bg);
	z-index: 40;
	opacity: 0;
	pointer-events: none;
	transition: opacity .18s ease;
}
.tc-loading-overlay.is-active{ opacity: 1; pointer-events: auto; }
.tc-loading-overlay .tc-spinner{
	width: 34px; height: 34px;
	border-radius: 50%;
	border: 3px solid rgba(17, 17, 17, .15);
	border-top-color: var(--tc-skel-green);
	animation: tc-spin .8s linear infinite;
}
.tc-loading-host{ position: relative; }

@media (prefers-reduced-motion: reduce){
	.tc-btn-loading::after,
	.tc-loading-overlay .tc-spinner{ animation-duration: 1.4s; }
}

.tc-skel-cart-row{
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 0;
}
.tc-skel-cart-row .tc-skel-img{ width: 72px; height: 72px; aspect-ratio: auto; flex: 0 0 auto; }
.tc-skel-cart-row .tc-skel-lines{ flex: 1 1 auto; display: flex; flex-direction: column; gap: 8px; }
.tc-skel-cart-row .tc-skel-text{ margin: 0; }

.tc-skel-totals-line{
	display: flex;
	justify-content: space-between;
	gap: 20px;
	margin: 10px 0;
}
.tc-skel-totals-line .tc-skel-text{ margin: 0; width: 90px; }
.tc-skel-totals-line .tc-skel-text:first-child{ width: 120px; }

.tc-skel-quiz-options{
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 14px;
}
@media (max-width: 767px){
	.tc-skel-quiz-options{ grid-template-columns: repeat(2, 1fr); }
}
.tc-skel-quiz-option{ aspect-ratio: 1 / 1; border-radius: var(--tc-skel-radius); }

.tc-skel-pdp-gallery{ width: 100%; aspect-ratio: 1 / 1; border-radius: var(--tc-skel-radius); }
.tc-skel-pdp-variants{ display: flex; gap: 10px; flex-wrap: wrap; }
.tc-skel-pdp-variants .tc-skel{ width: 56px; height: 40px; border-radius: 10px; }

.wc-block-components-skeleton__el,
.wc-block-components-skeleton__image{
	background-color: var(--tc-skel-base) !important;
	background-image: linear-gradient(90deg, var(--tc-skel-base) 25%, var(--tc-skel-highlight) 50%, var(--tc-skel-base) 75%) !important;
	background-size: 200% 100% !important;
	animation: tc-shimmer 1.6s ease-in-out infinite !important;
}
.wc-block-components-loading-mask__mask{
	background-color: var(--tc-skel-base) !important;
}
.wc-block-components-spinner{
	border-color: rgba(17, 17, 17, .15) !important;
	border-top-color: var(--tc-skel-green) !important;
}
.wc-block-checkout__loading-overlay .wc-block-checkout__loading-overlay-overlay{
	background: var(--tc-skel-overlay-bg) !important;
}
/* ---------------------------------------------------------------------
   WooCommerce's own jQuery blockUI overlay — used natively for variation
   loading (PDP) and, on some setups, cart/checkout recalculation. Restyle
   only — the blocking behaviour itself is WooCommerce core, untouched.
   --------------------------------------------------------------------- */
.blockUI.blockOverlay{
	background: var(--tc-skel-overlay-bg) !important;
}
.blockUI.blockOverlay::after{
	content: '';
	position: absolute;
	top: 50%; left: 50%;
	width: 30px; height: 30px;
	margin: -15px 0 0 -15px;
	border-radius: 50%;
	border: 3px solid rgba(17, 17, 17, .15);
	border-top-color: var(--tc-skel-green);
	animation: tc-spin .8s linear infinite;
}
