/* Twaura Product Cards — equal-height cards, nothing overflows, button flush to the bottom edge. */

.tw-grid {
	--tw-gap: 12px;
	display: grid !important;
	grid-template-columns: repeat(var(--tw-cols-sm, 2), minmax(0, 1fr));
	gap: var(--tw-gap);
	margin: 0 0 24px !important;
	padding: 0 !important;
	list-style: none !important;
	width: 100%;
}
.tw-grid::before,
.tw-grid::after { display: none !important; } /* theme clearfix pseudo-elements would take a grid cell */

@media (min-width: 768px) {
	.tw-grid { --tw-gap: 18px; grid-template-columns: repeat(var(--tw-cols-md, 3), minmax(0, 1fr)); }
}
@media (min-width: 1025px) {
	.tw-grid { --tw-gap: 24px; grid-template-columns: repeat(var(--tw-cols, 4), minmax(0, 1fr)); }
}

.tw-grid .tw-li {
	display: flex !important;
	min-width: 0;
	width: auto !important;
	margin: 0 !important;
	padding: 0 !important;
	float: none !important;
	list-style: none !important;
}
.tw-grid .tw-li::before { display: none !important; }

/* Card */
.tw-grid,
.tw-grid *,
.tw-grid *::before,
.tw-grid *::after { box-sizing: border-box; }

.tw-card {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	min-width: 0;
	background: #fff;
	border: 1px solid #ebe8ef;
	border-radius: 12px;
	overflow: hidden;
	transition: box-shadow .25s ease, transform .25s ease;
}
@media (hover: hover) {
	.tw-card:hover { box-shadow: 0 10px 28px rgba(40, 18, 60, .10); transform: translateY(-2px); }
	.tw-card:hover .tw-card__img { transform: scale(1.04); }
}

/* Image: square, centred, same size on every card */
.tw-card .tw-card__media {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	background: #f7f5f9;
	overflow: hidden;
}
.tw-card .tw-card__media img,
.tw-card .tw-card__img {
	position: absolute !important;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 8%;
	object-fit: contain;
	border-radius: 0 !important;
	transition: transform .35s ease;
}

.tw-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 2;
	max-width: calc(100% - 20px);
	padding: 5px 8px;
	border-radius: 4px;
	background: #e53935;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: .3px;
	text-transform: uppercase;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.tw-card__wish {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 3;
}
.tw-card__wish .yith-wcwl-add-to-wishlist { margin: 0 !important; }
.tw-card__wish span,
.tw-card__wish .feedback { display: none !important; } /* icon only */

/* Body */
.tw-card .tw-card__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
	padding: 12px 12px 14px;
}

.tw-card .tw-card__title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	min-height: calc(1.3em * 2); /* always reserve two lines so cards line up */
	margin: 0 !important;
	padding: 0 !important;
	color: #120f17;
	font-size: 15px !important;
	font-weight: 800 !important;
	line-height: 1.3 !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	overflow-wrap: anywhere; /* long words like "Hyperpigmentation" wrap instead of being cut */
	-webkit-hyphens: auto;
	hyphens: auto;
}
/* The theme styles "h3 a" directly, so the link must inherit the title's size and weight explicitly. */
.tw-card .tw-card__title a {
	color: inherit !important;
	font-size: inherit !important;
	font-weight: inherit !important;
	line-height: inherit !important;
	letter-spacing: inherit !important;
	text-transform: inherit !important;
	text-decoration: none !important;
}
.tw-card .tw-card__title a:hover { color: var(--tw-accent, #3a1250) !important; }

.tw-card .tw-card__rating,
.tw-card .tw-card__size {
	min-height: 18px; /* reserved even when empty */
	overflow: hidden;
	color: #5f5b66;
	font-size: 12.5px;
	line-height: 18px;
	white-space: nowrap;
	text-overflow: ellipsis;
}
.tw-card .tw-card__rating { display: flex; align-items: center; gap: 5px; }
.tw-card .tw-card__size { color: #3d3945; font-size: 13.5px; font-weight: 600; }
.tw-card .tw-card__rating b { color: #1d1b22; font-weight: 600; }
.tw-star { color: #f5a623; font-size: 14px; line-height: 1; }
.tw-sep { color: #d4d0da; }

.tw-card .tw-card__price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px 8px;
	margin-top: auto; /* pins price to the bottom of the body */
	padding-top: 2px;
	color: #120f17;
	font-size: 20px;
	font-weight: 800;
	line-height: 1.25;
}
.tw-card .tw-card__price .price,
.tw-card .tw-card__price .amount { color: inherit !important; font-size: inherit !important; font-weight: inherit; }
.tw-card .tw-card__price del,
.tw-card .tw-card__price del .amount { color: #9a96a3 !important; font-size: 14px !important; font-weight: 400 !important; opacity: 1; }
.tw-card .tw-card__price ins { background: none; text-decoration: none; }
.tw-off { color: #1a8a3a; font-size: 13px; font-weight: 700; }

/* Add to cart: full width, square corners, flush with the card's bottom edge */
.tw-card .tw-card__cta { margin: 0; padding: 0; }
.tw-card .tw-card__cta .tw-card__btn {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 100% !important;
	min-height: 46px;
	margin: 0 !important;
	padding: 10px 12px !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	background: var(--tw-accent, #3a1250) !important;
	color: #fff !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	text-align: center;
	text-decoration: none !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	transition: filter .2s ease;
}
.tw-card .tw-card__cta .tw-card__btn:hover { filter: brightness(1.15); }
.tw-card .tw-card__cta .tw-card__btn.loading { opacity: .75; pointer-events: none; }
.tw-card .tw-card__cta .tw-card__btn::before,
.tw-card .tw-card__cta .tw-card__btn::after { display: none !important; } /* theme icons */
.tw-card .tw-card__cta .added_to_cart { display: none !important; } /* "View cart" link; the side cart opens instead */

/* Pagination */
.tw-pagination ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0 0 24px; padding: 0; list-style: none; }
.tw-pagination li { margin: 0; list-style: none; }
.tw-pagination a,
.tw-pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 10px; border: 1px solid #ebe8ef; border-radius: 8px; color: #1d1b22; text-decoration: none; }
.tw-pagination .current { background: var(--tw-accent, #3a1250); border-color: transparent; color: #fff; }

/* Small phones */
@media (max-width: 480px) {
	.tw-card .tw-card__body { gap: 5px; padding: 10px 10px 12px; }
	.tw-card .tw-card__title { font-size: 14px !important; }
	.tw-card .tw-card__rating { font-size: 12px; }
	.tw-card .tw-card__size { font-size: 12.5px; }
	.tw-card .tw-card__price { font-size: 18px; }
	.tw-card .tw-card__price del,
	.tw-card .tw-card__price del .amount { font-size: 13px !important; }
	.tw-card .tw-card__cta .tw-card__btn { min-height: 42px; font-size: 14px !important; }
	.tw-badge { top: 8px; left: 8px; font-size: 10px; padding: 4px 6px; }
}

/* Carousel layout: [twaura_products layout="carousel"] */
.tw-carousel { position: relative; }
.tw-grid.tw-grid--carousel {
	grid-auto-flow: column;
	grid-template-columns: none;
	grid-auto-columns: calc((100% - (var(--tw-cols-sm, 2) - 1) * var(--tw-gap)) / var(--tw-cols-sm, 2));
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	padding: 4px 0 6px !important; /* room for the hover lift and shadow */
}
.tw-grid.tw-grid--carousel::-webkit-scrollbar { display: none; }
@media (min-width: 768px) {
	.tw-grid.tw-grid--carousel { grid-template-columns: none; grid-auto-columns: calc((100% - (var(--tw-cols-md, 3) - 1) * var(--tw-gap)) / var(--tw-cols-md, 3)); }
}
@media (min-width: 1025px) {
	.tw-grid.tw-grid--carousel { grid-template-columns: none; grid-auto-columns: calc((100% - (var(--tw-cols, 4) - 1) * var(--tw-gap)) / var(--tw-cols, 4)); }
}
.tw-grid--carousel .tw-li { scroll-snap-align: start; }

.tw-carousel .tw-carousel__btn {
	position: absolute;
	top: 32%;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	margin: 0;
	padding: 0 0 3px;
	border: 1px solid #ebe8ef;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 6px 18px rgba(40, 18, 60, .14);
	color: #1d1b22;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	transition: opacity .2s ease, transform .2s ease;
}
.tw-carousel .tw-carousel__btn:hover { transform: scale(1.06); }
.tw-carousel .tw-carousel__btn--prev { left: -10px; }
.tw-carousel .tw-carousel__btn--next { right: -10px; }
.tw-carousel .tw-carousel__btn[disabled] { opacity: 0; pointer-events: none; }
@media (hover: none) {
	.tw-carousel .tw-carousel__btn { display: none; } /* phones: swipe */
}
