/* Ebook WhatsApp Store — storefront styles. Scoped under .ews-* to avoid theme clashes. */

.ews-grid,
.ews-product {
	--ews-ink: #1a2238;
	--ews-muted: #5b6472;
	--ews-line: #e7e9f0;
	--ews-paper: #ffffff;
	--ews-bg: #f6f7fb;
	--ews-sale: #e5484d;
	--ews-accent: #25d366;
	--ews-radius: 14px;
	box-sizing: border-box;
}

.ews-grid *,
.ews-product * {
	box-sizing: border-box;
}

/* ---------- Grid ---------- */
.ews-grid {
	display: grid;
	gap: 26px;
	margin: 28px 0;
}

.ews-cols-1 { grid-template-columns: 1fr; }
.ews-cols-2 { grid-template-columns: repeat(2, 1fr); }
.ews-cols-3 { grid-template-columns: repeat(3, 1fr); }
.ews-cols-4 { grid-template-columns: repeat(4, 1fr); }
.ews-cols-5 { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 960px) {
	.ews-cols-3, .ews-cols-4, .ews-cols-5 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
	.ews-cols-2, .ews-cols-3, .ews-cols-4, .ews-cols-5 { grid-template-columns: 1fr; }
}

.ews-card {
	background: var(--ews-paper);
	border: 1px solid var(--ews-line);
	border-radius: var(--ews-radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform .18s ease, box-shadow .18s ease;
}

.ews-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 14px 34px rgba(26, 34, 56, .12);
}

.ews-card-thumb {
	display: block;
	aspect-ratio: 3 / 4;
	background: linear-gradient(135deg, #eef1f8, #e2e6f2);
	overflow: hidden;
}

.ews-card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ews-card-noimg {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	font-size: 54px !important;
	color: #b9c0d4;
}

.ews-card-body {
	padding: 16px 18px 20px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
}

.ews-card-title {
	margin: 0;
	font-size: 1.05rem;
	line-height: 1.3;
	color: var(--ews-ink);
}

.ews-card-title a {
	color: inherit;
	text-decoration: none;
}

.ews-card-title a:hover { text-decoration: underline; }

.ews-card-price {
	color: var(--ews-ink);
	font-weight: 700;
}

.ews-card-price del {
	color: var(--ews-muted);
	font-weight: 500;
	margin-right: 6px;
}

.ews-card-price .ews-from {
	font-weight: 500;
	color: var(--ews-muted);
	font-size: .85em;
}

.ews-card-link {
	margin-top: auto;
	color: var(--ews-accent);
	text-decoration: none;
	font-weight: 600;
	font-size: .92rem;
	filter: brightness(.78);
}

.ews-empty {
	color: var(--ews-muted);
	font-style: italic;
}

/* ---------- Single product ---------- */
.ews-product {
	margin: 32px 0;
}

.ews-product-title {
	color: var(--ews-ink);
	margin: 0 0 18px;
}

.ews-product-inner {
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr);
	gap: 34px;
	align-items: start;
}

@media (max-width: 820px) {
	.ews-product-inner {
		grid-template-columns: 1fr;
		gap: 24px;
	}
}

/* Preview column */
.ews-preview {
	background: var(--ews-bg);
	border: 1px solid var(--ews-line);
	border-radius: var(--ews-radius);
	padding: 18px;
}

.ews-pdf-pages,
.ews-preview-gallery {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.ews-pdf-page,
.ews-preview-page {
	margin: 0;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(26, 34, 56, .12);
	overflow: hidden;
}

.ews-pdf-page canvas,
.ews-preview-page img {
	display: block;
	width: 100%;
	height: auto;
}

.ews-pdf-page figcaption {
	text-align: center;
	font-size: .72rem;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--ews-muted);
	padding: 8px;
	background: #fafbfe;
	border-top: 1px solid var(--ews-line);
}

.ews-pdf-loading,
.ews-no-preview {
	text-align: center;
	color: var(--ews-muted);
	padding: 40px 12px;
	font-style: italic;
}

/* Buy box */
.ews-buybox {
	position: sticky;
	top: 24px;
	background: var(--ews-paper);
	border: 1px solid var(--ews-line);
	border-radius: var(--ews-radius);
	padding: 22px 22px 24px;
	box-shadow: 0 10px 30px rgba(26, 34, 56, .06);
}

.ews-price-block {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 18px;
	min-height: 34px;
}

.ews-price-block .ews-amount {
	font-size: 1.9rem;
	font-weight: 800;
	color: var(--ews-ink);
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

.ews-price-block .ews-original {
	color: var(--ews-muted);
	font-weight: 500;
	font-size: 1.05rem;
}

.ews-badge {
	background: var(--ews-sale);
	color: #fff;
	font-weight: 700;
	font-size: .78rem;
	padding: 3px 9px;
	border-radius: 999px;
	line-height: 1.4;
}

.ews-variation-select {
	margin-bottom: 18px;
}

.ews-variation-select label {
	display: block;
	font-weight: 600;
	color: var(--ews-ink);
	margin-bottom: 6px;
	font-size: .92rem;
}

.ews-variation-select select {
	width: 100%;
	padding: 11px 12px;
	border: 1px solid var(--ews-line);
	border-radius: 10px;
	background: #fff;
	color: var(--ews-ink);
	font-size: 1rem;
}

.ews-buy-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 15px 18px;
	background: var(--ews-accent);
	color: #fff !important;
	text-decoration: none;
	font-weight: 700;
	font-size: 1.05rem;
	border-radius: 12px;
	box-shadow: 0 8px 20px rgba(37, 211, 102, .32);
	transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.ews-buy-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 26px rgba(37, 211, 102, .4);
	color: #fff;
}

.ews-buy-btn .ews-wa-icon {
	width: 22px;
	height: 22px;
	flex: 0 0 auto;
}

.ews-buy-btn.is-disabled {
	background: #c7ccd6;
	box-shadow: none;
	cursor: not-allowed;
	pointer-events: auto;
}

.ews-buy-note {
	margin: 10px 0 0;
	color: var(--ews-sale);
	font-size: .85rem;
	text-align: center;
}

.ews-buy-note:empty {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.ews-card,
	.ews-buy-btn {
		transition: none;
	}
}
