/**
 * ThemeWar Products — front-end styles.
 *
 * Structural + default visual styling for the products grid, single-product
 * gallery, purchase box and content. Colours/spacing here mirror the Elementor
 * control defaults so the markup looks correct everywhere (including the
 * bundled single-product template, which does not pass through Elementor).
 * Avoid !important so Elementor inline styles can always override.
 *
 * @package ThemeWar_Products
 */

.tw-products,
.tw-products * ,
.tw-buy,
.tw-buy * ,
.tw-content,
.tw-content * ,
.tw-gallery-slider,
.tw-gallery-slider * {
	box-sizing: border-box;
}

:root {
	--tw-accent: #cdf546;
	--tw-dark: #111111;
	--tw-ink: #0d0d0d;
	--tw-muted: #6b7280;
	--tw-line: #ececec;
	--tw-blue: #4d57f4;
	--tw-yellow: #f4e926;
	--tw-card-radius: 16px;
}

/* ===================================================================== *
 * Products grid + tabs
 * ===================================================================== */

.tw-products {
	width: 100%;
}

.tw-products__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 28px;
}

.tw-tab {
	appearance: none;
	border: 0;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	line-height: 1;
	padding: 12px 22px;
	border-radius: 40px;
	background-color: #f2f3f5;
	color: #111111;
	transition: background-color .2s ease, color .2s ease, transform .2s ease;
}

.tw-tab:hover {
	transform: translateY(-1px);
}

.tw-tab.is-active {
	background-color: var(--tw-accent);
	color: #111111;
}

.tw-tab:focus-visible {
	outline: 2px solid var(--tw-dark);
	outline-offset: 2px;
}

.tw-products__panels {
	position: relative;
}

.tw-panel[hidden],
.tw-panel:not(.is-active) {
	display: none;
}

.tw-panel.is-active {
	display: block;
	animation: tw-fade-in .35s ease;
}

@keyframes tw-fade-in {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

.tw-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 24px;
}

/* ===================================================================== *
 * Product card
 * ===================================================================== */

.tw-card {
	display: block;
}

.tw-card__link {
	display: block;
	color: inherit;
	text-decoration: none;
	transition: transform .25s ease;
}

.tw-card__link:hover {
	transform: translateY(-6px);
}

.tw-card__link:focus-visible {
	outline: 2px solid var(--tw-dark);
	outline-offset: 4px;
	border-radius: var(--tw-card-radius);
}

.tw-card__media {
	position: relative;
	overflow: hidden;
	border-radius: 12px;
	background: #fbeeee;
	aspect-ratio: 16 / 11;
}

.tw-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .5s ease;
}

.tw-card__img--placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #f1f1f1 0%, #e2e2e2 100%);
}

/* Optional zoom-on-hover (wrapper adds .tw-zoom-yes). */
.tw-zoom-yes .tw-card__link:hover .tw-card__img {
	transform: scale(1.06);
}

.tw-card__badge {
	position: absolute;
	left: 16px;
	bottom: 16px;
	background-color: var(--tw-accent);
	color: #111111;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	padding: 8px 14px;
	border-radius: 8px;
	z-index: 2;
}

.tw-card__body {
	padding-top: 16px;
}

.tw-card__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.tw-card__title {
	margin: 0;
	font-size: 22px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--tw-ink);
}

.tw-card__price {
	flex: none;
	background-color: var(--tw-accent);
	color: #111111;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	padding: 7px 12px;
	border-radius: 8px;
}

.tw-card__subtitle {
	margin: 8px 0 0;
	font-size: 15px;
	line-height: 1.5;
	color: var(--tw-muted);
}

/* ===================================================================== *
 * Load more
 * ===================================================================== */

.tw-products__more {
	display: flex;
	justify-content: center;
	margin-top: 36px;
}

.tw-loadmore {
	appearance: none;
	border: 0;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 15px 30px;
	border-radius: 40px;
	background-color: var(--tw-accent);
	color: #111111;
	transition: background-color .2s ease, color .2s ease;
}

.tw-loadmore:hover {
	background-color: var(--tw-dark);
	color: #ffffff;
}

.tw-loadmore[hidden] {
	display: none;
}

.tw-loadmore:focus-visible {
	outline: 2px solid var(--tw-dark);
	outline-offset: 2px;
}

.tw-loadmore__spinner {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 2px solid currentColor;
	border-right-color: transparent;
	display: none;
	animation: tw-spin .7s linear infinite;
}

.tw-loadmore.is-loading {
	pointer-events: none;
	opacity: .85;
}

.tw-loadmore.is-loading .tw-loadmore__spinner {
	display: inline-block;
}

@keyframes tw-spin {
	to { transform: rotate(360deg); }
}

/* ===================================================================== *
 * Inline icons
 * ===================================================================== */

.tw-ico {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
}

.tw-ico svg {
	width: 1.25em;
	height: 1.25em;
	display: block;
}

/* ===================================================================== *
 * Single product — gallery slider
 * ===================================================================== */

.tw-gallery-slider {
	position: relative;
	width: 100%;
	height: 540px;
	border-radius: 16px;
	overflow: hidden;
	background: #0b1020;
}

.tw-gallery-track {
	position: absolute;
	inset: 0;
}

.tw-gallery-slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity .45s ease;
}

.tw-gallery-slide.is-active {
	opacity: 1;
	visibility: visible;
}

.tw-gallery-slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.tw-gallery-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .9);
	color: #111111;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
	transition: background .2s ease, transform .2s ease;
	z-index: 3;
}

.tw-gallery-arrow:hover {
	background: #ffffff;
	transform: translateY(-50%) scale(1.05);
}

.tw-gallery-arrow--prev { left: 14px; }
.tw-gallery-arrow--next { right: 14px; }

.tw-gallery-dots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 16px;
	display: flex;
	justify-content: center;
	gap: 8px;
	z-index: 3;
}

.tw-gallery-dot {
	width: 22px;
	height: 6px;
	border: 0;
	padding: 0;
	border-radius: 6px;
	background: rgba(255, 255, 255, .5);
	cursor: pointer;
	transition: background .2s ease, width .2s ease;
}

.tw-gallery-dot.is-active {
	background: #ffffff;
	width: 30px;
}

/* ===================================================================== *
 * Single product — purchase box
 * ===================================================================== */

.tw-buy {
	display: flex;
	flex-direction: column;
	gap: 14px;
	background: #ffffff;
	border: 1px solid var(--tw-line);
	border-radius: 18px;
	padding: 24px;
}

.tw-buy__discount {
	display: flex;
	align-items: center;
	gap: 10px;
	background: #eafbef;
	color: #1f7a45;
	border-radius: 10px;
	padding: 12px 14px;
	font-size: 15px;
}

.tw-buy__discount p { margin: 0; }

.tw-buy__code {
	color: #e8552d;
	font-weight: 700;
}

.tw-buy__checklist {
	list-style: none;
	margin: 6px 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.tw-buy__check {
	display: flex;
	align-items: center;
	gap: 10px;
	color: #222222;
	font-size: 16px;
}

.tw-buy__check .tw-ico {
	color: #111111;
}

.tw-buy__group {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.tw-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	text-align: center;
	text-decoration: none;
	font-weight: 600;
	line-height: 1.2;
	padding: 16px 20px;
	border-radius: 12px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: transform .15s ease, opacity .15s ease, background-color .2s ease;
}

.tw-btn:hover {
	transform: translateY(-1px);
	opacity: .95;
}

.tw-btn:focus-visible {
	outline: 2px solid var(--tw-dark);
	outline-offset: 2px;
}

.tw-btn--outline {
	background: #ffffff;
	color: #111111;
	border-color: #e3e3e3;
}

.tw-btn--dark {
	background: #111111;
	color: #ffffff;
}

.tw-btn--blue {
	background: var(--tw-blue);
	color: #ffffff;
}

.tw-btn--accent {
	background: var(--tw-yellow);
	color: #111111;
}

.tw-buy__divider {
	display: flex;
	align-items: center;
	text-align: center;
	gap: 12px;
	color: var(--tw-muted);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .04em;
	margin: 2px 0;
}

.tw-buy__divider::before,
.tw-buy__divider::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--tw-line);
}

/* ===================================================================== *
 * Single product — all-access promo
 * ===================================================================== */

.tw-access {
	background: #0c1320;
	border-radius: 14px;
	padding: 26px 22px;
	text-align: center;
}

.tw-access__title {
	margin: 0 0 8px;
	color: #ffffff;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.25;
}

.tw-access__sub {
	margin: 0 0 18px;
	color: #b9c0cc;
	font-size: 15px;
	line-height: 1.5;
}

.tw-access__btn {
	display: block;
	width: 100%;
	text-decoration: none;
	background: var(--tw-yellow);
	color: #111111;
	font-weight: 700;
	padding: 15px 18px;
	border-radius: 10px;
	transition: transform .15s ease;
}

.tw-access__btn:hover {
	transform: translateY(-1px);
}

/* ===================================================================== *
 * Single product — content
 * ===================================================================== */

.tw-content {
	display: flex;
	flex-direction: column;
	gap: 40px;
}

.tw-content__title {
	margin: 0 0 16px;
	color: var(--tw-ink);
	font-size: 28px;
	font-weight: 700;
	line-height: 1.2;
}

.tw-content__overview {
	color: #3f444d;
	font-size: 17px;
	line-height: 1.7;
}

.tw-content__overview p { margin: 0 0 1em; }
.tw-content__overview p:last-child { margin-bottom: 0; }

.tw-content__features ul {
	margin: 0;
	padding-left: 1.2em;
	list-style: disc;
}

.tw-content__features li,
.tw-content__pages li {
	color: var(--tw-ink);
	font-size: 17px;
	line-height: 1.5;
	margin-bottom: 10px;
}

.tw-content__features li:last-child,
.tw-content__pages li:last-child {
	margin-bottom: 0;
}

.tw-content__pages ol {
	margin: 0;
	padding-left: 1.4em;
	list-style-type: decimal;
}

/* ===================================================================== *
 * Editor placeholder notice
 * ===================================================================== */

.tw-editor-notice {
	border: 1px dashed #c3c4c7;
	background: #f6f7f7;
	color: #50575e;
	border-radius: 8px;
	padding: 16px 18px;
	font-size: 14px;
}

/* ===================================================================== *
 * Bundled single-product template layout
 * ===================================================================== */

.tw-single {
	max-width: 1200px;
	margin: 0 auto;
	padding: 48px 20px 72px;
}

.tw-single__title {
	margin: 0 0 24px;
	font-size: 38px;
	font-weight: 700;
	line-height: 1.15;
	color: var(--tw-ink);
}

.tw-single__top {
	display: grid;
	grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
	gap: 32px;
	align-items: start;
	margin-bottom: 48px;
}

.tw-single__body {
	max-width: 820px;
}

/* ===================================================================== *
 * Responsive
 * ===================================================================== */

@media (max-width: 1024px) {
	.tw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.tw-single__top { grid-template-columns: 1fr; }
	.tw-gallery-slider { height: 420px; }
}

@media (max-width: 600px) {
	.tw-grid { grid-template-columns: 1fr; }
	.tw-card__title { font-size: 20px; }
	.tw-gallery-slider { height: 320px; }
	.tw-single__title { font-size: 28px; }
	.tw-content__title { font-size: 24px; }
}

/* Accessibility: respect reduced motion. */
@media (prefers-reduced-motion: reduce) {
	.tw-card__link,
	.tw-card__img,
	.tw-tab,
	.tw-btn,
	.tw-loadmore,
	.tw-gallery-slide,
	.tw-gallery-arrow,
	.tw-access__btn {
		transition: none;
	}
	.tw-panel.is-active { animation: none; }
	.tw-loadmore__spinner { animation-duration: 1.4s; }
}
