/**
 * CAS Digital Products — storefront and dashboard styles.
 *
 * Scoped under .cas-dp-* so nothing here can reach the theme or Tutor.
 * Colours are declared as custom properties on the wrappers, so the palette
 * can be retuned from one place (or overridden by the theme) without touching
 * any rule below.
 */

.cas-dp-store,
.cas-dp-single,
.cas-dp-grid,
.cas-dp-downloads {
	--cas-dp-brand: #e5252a;
	--cas-dp-brand-dark: #b91d21;
	--cas-dp-ink: #1a1a1a;
	--cas-dp-muted: #6b7280;
	--cas-dp-line: #e5e7eb;
	--cas-dp-surface: #ffffff;
	--cas-dp-surface-alt: #f7f7f8;
	--cas-dp-radius: 10px;
}

/* ---------- Layout ---------- */

.cas-dp-store,
.cas-dp-single {
	max-width: 1180px;
	margin: 0 auto;
	padding: 48px 20px 72px;
	box-sizing: border-box;
}

.cas-dp-store__head {
	margin-bottom: 28px;
}

.cas-dp-store__title {
	margin: 0 0 8px;
	font-size: clamp(28px, 4vw, 40px);
	line-height: 1.15;
	color: var(--cas-dp-ink);
}

.cas-dp-store__intro {
	margin: 0;
	max-width: 62ch;
	color: var(--cas-dp-muted);
}

.cas-dp-store__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 28px;
}

.cas-dp-chip {
	display: inline-block;
	padding: 7px 14px;
	border: 1px solid var(--cas-dp-line);
	border-radius: 999px;
	font-size: 14px;
	line-height: 1.2;
	text-decoration: none;
	color: var(--cas-dp-ink);
	background: var(--cas-dp-surface);
	transition: border-color .15s ease, color .15s ease;
}

.cas-dp-chip:hover,
.cas-dp-chip.is-active {
	border-color: var(--cas-dp-brand);
	color: var(--cas-dp-brand);
}

.cas-dp-store__empty {
	color: var(--cas-dp-muted);
}

.cas-dp-store__pagination {
	margin-top: 36px;
}

/* ---------- Grid + cards ---------- */

.cas-dp-grid {
	display: grid;
	gap: 24px;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.cas-dp-grid--cols-1 { grid-template-columns: minmax(0, 420px); }
.cas-dp-grid--cols-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.cas-dp-grid--cols-4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

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

.cas-dp-card:hover {
	box-shadow: 0 10px 28px rgba(0, 0, 0, .08);
	transform: translateY(-2px);
}

.cas-dp-card__media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	background: var(--cas-dp-surface-alt);
}

.cas-dp-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cas-dp-card__placeholder,
.cas-dp-single__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: repeating-linear-gradient(45deg, #f1f1f2, #f1f1f2 12px, #e9e9eb 12px, #e9e9eb 24px);
}

.cas-dp-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: #fff;
	background: var(--cas-dp-brand);
}

.cas-dp-card__body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
	padding: 18px;
}

.cas-dp-card__title {
	margin: 0;
	font-size: 18px;
	line-height: 1.3;
}

.cas-dp-card__title a {
	color: var(--cas-dp-ink);
	text-decoration: none;
}

.cas-dp-card__title a:hover { color: var(--cas-dp-brand); }

.cas-dp-card__desc {
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	color: var(--cas-dp-muted);
}

.cas-dp-card__note {
	margin: 0;
	font-size: 12px;
	letter-spacing: .02em;
	text-transform: uppercase;
	color: var(--cas-dp-muted);
}

.cas-dp-card__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: auto;
	padding-top: 12px;
}

/* ---------- Price ---------- */

.cas-dp-price {
	font-size: 18px;
	font-weight: 700;
	color: var(--cas-dp-ink);
}

.cas-dp-price del {
	margin-right: 6px;
	font-weight: 400;
	font-size: 15px;
	color: var(--cas-dp-muted);
}

.cas-dp-price ins {
	text-decoration: none;
	color: var(--cas-dp-brand);
}

.cas-dp-price--free { color: var(--cas-dp-brand); }

/* ---------- Buttons ---------- */

.cas-dp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 18px;
	border: 1px solid var(--cas-dp-brand);
	border-radius: 6px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	color: #fff;
	background: var(--cas-dp-brand);
	transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.cas-dp-btn:hover,
.cas-dp-btn:focus {
	color: #fff;
	background: var(--cas-dp-brand-dark);
	border-color: var(--cas-dp-brand-dark);
}

.cas-dp-btn--ghost {
	color: var(--cas-dp-brand);
	background: transparent;
}

.cas-dp-btn--ghost:hover,
.cas-dp-btn--ghost:focus {
	color: #fff;
	background: var(--cas-dp-brand);
}

.cas-dp-btn--lg {
	padding: 14px 26px;
	font-size: 16px;
}

.cas-dp-btn[disabled] {
	opacity: .55;
	cursor: default;
	pointer-events: none;
}

/* ---------- Product page ---------- */

.cas-dp-product {
	--cas-dp-brand: #e5252a;
	--cas-dp-brand-dark: #b91d21;
	--cas-dp-ink: #1a1a1a;
	--cas-dp-muted: #6b7280;
	--cas-dp-faint: #9aa1ac;
	--cas-dp-line: #e5e7eb;
	--cas-dp-surface: #ffffff;
	--cas-dp-surface-alt: #f6f7f9;
	--cas-dp-radius: 10px;
	--cas-dp-max: 1180px;
}

.cas-dp-product > *,
.cas-dp-band__inner {
	max-width: var(--cas-dp-max);
	margin-left: auto;
	margin-right: auto;
	padding-left: 20px;
	padding-right: 20px;
	box-sizing: border-box;
}

/* breadcrumb */
.cas-dp-crumbs {
	padding-top: 28px;
	font-size: 13px;
	color: var(--cas-dp-faint);
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.cas-dp-crumbs a { color: var(--cas-dp-muted); text-decoration: none; }
.cas-dp-crumbs a:hover { color: var(--cas-dp-brand); }
.cas-dp-crumbs__here { color: var(--cas-dp-ink); }

/* hero */
.cas-dp-hero {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
	gap: 44px;
	align-items: start;
	padding-top: 22px;
	padding-bottom: 8px;
}

.cas-dp-hero__media {
	border: 1px solid var(--cas-dp-line);
	border-radius: var(--cas-dp-radius);
	overflow: hidden;
	background: var(--cas-dp-surface-alt);
	aspect-ratio: 16 / 10;
}

.cas-dp-hero__media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cas-dp-hero__placeholder {
	display: block; width: 100%; height: 100%;
	background: repeating-linear-gradient(45deg, #f1f1f2, #f1f1f2 12px, #e9e9eb 12px, #e9e9eb 24px);
}

/* buy box */
.cas-dp-buybox { position: sticky; top: 24px; }

.cas-dp-buybox__eyebrow {
	margin: 0 0 10px;
	font-size: 12px;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: var(--cas-dp-brand);
	font-weight: 600;
}

.cas-dp-buybox__title {
	margin: 0 0 14px;
	font-size: clamp(27px, 3.2vw, 38px);
	line-height: 1.12;
	letter-spacing: -0.01em;
	color: var(--cas-dp-ink);
}

.cas-dp-buybox__lead {
	margin: 0 0 22px;
	font-size: 17px;
	line-height: 1.6;
	color: var(--cas-dp-muted);
	max-width: 46ch;
}

.cas-dp-buybox__price { margin-bottom: 4px; }
.cas-dp-buybox__price .cas-dp-price { font-size: 32px; }
.cas-dp-buybox__price .cas-dp-price del { font-size: 20px; }

.cas-dp-buybox__note {
	margin: 0 0 22px;
	font-size: 13px;
	letter-spacing: .01em;
	color: var(--cas-dp-faint);
}

.cas-dp-buybox__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 20px;
}

.cas-dp-buybox__owned,
.cas-dp-single__feedback {
	flex-basis: 100%;
	margin: 0;
	font-size: 14px;
	color: var(--cas-dp-muted);
}

.cas-dp-single__feedback:empty { display: none; }
.cas-dp-single__feedback.is-error { color: var(--cas-dp-brand-dark); }

.cas-dp-assure {
	margin: 0;
	padding: 18px 0 0;
	border-top: 1px solid var(--cas-dp-line);
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 9px;
}

.cas-dp-assure li {
	position: relative;
	padding-left: 24px;
	font-size: 14px;
	color: var(--cas-dp-muted);
}

.cas-dp-assure li::before {
	content: "";
	position: absolute;
	left: 2px;
	top: 6px;
	width: 10px;
	height: 6px;
	border-left: 2px solid var(--cas-dp-brand);
	border-bottom: 2px solid var(--cas-dp-brand);
	transform: rotate(-45deg);
}

/* look inside */
.cas-dp-band {
	margin-top: 52px;
	padding: 52px 0 56px;
	background: var(--cas-dp-surface-alt);
	border-top: 1px solid var(--cas-dp-line);
	border-bottom: 1px solid var(--cas-dp-line);
	max-width: none;
	padding-left: 0;
	padding-right: 0;
}

.cas-dp-h2 {
	margin: 0 0 6px;
	font-size: clamp(22px, 2.4vw, 28px);
	line-height: 1.2;
	color: var(--cas-dp-ink);
}

.cas-dp-band__sub {
	margin: 0 0 30px;
	color: var(--cas-dp-muted);
	font-size: 15px;
}

.cas-dp-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 22px;
}

/* Keep the rows full. Three across for odd counts, two across for four or
   six, so a preview never sits alone on the last row. */
.cas-dp-gallery--1 { grid-template-columns: minmax(0, 760px); justify-content: center; }
.cas-dp-gallery--2,
.cas-dp-gallery--4,
.cas-dp-gallery--6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cas-dp-gallery--3,
.cas-dp-gallery--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.cas-dp-gallery__item {
	margin: 0;
	border: 1px solid var(--cas-dp-line);
	border-radius: var(--cas-dp-radius);
	overflow: hidden;
	background: var(--cas-dp-surface);
}

.cas-dp-gallery__item img { display: block; width: 100%; height: auto; }

/* detail */
.cas-dp-detail {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
	gap: 56px;
	padding-top: 56px;
	padding-bottom: 8px;
	align-items: start;
}

.cas-dp-detail__body {
	font-size: 17px;
	line-height: 1.68;
	color: #2f343b;
	max-width: 66ch;
}

.cas-dp-detail__body > *:first-child { margin-top: 0; }
.cas-dp-detail__body p { margin: 0 0 1.15em; }

.cas-dp-detail__body h3 {
	margin: 1.9em 0 .55em;
	font-size: 22px;
	line-height: 1.25;
	color: var(--cas-dp-ink);
}

.cas-dp-detail__body strong { color: var(--cas-dp-ink); }

.cas-dp-detail__body ul,
.cas-dp-detail__body ol { margin: 0 0 1.15em; padding-left: 1.3em; }
.cas-dp-detail__body li { margin-bottom: .45em; }

.cas-dp-detail__aside {
	position: sticky;
	top: 24px;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.cas-dp-panel {
	border: 1px solid var(--cas-dp-line);
	border-radius: var(--cas-dp-radius);
	padding: 22px;
	background: var(--cas-dp-surface);
}

.cas-dp-panel__title {
	margin: 0 0 14px;
	font-size: 15px;
	letter-spacing: .01em;
	color: var(--cas-dp-ink);
}

.cas-dp-panel__list { margin: 0; padding: 0; list-style: none; }

.cas-dp-panel__list li {
	position: relative;
	padding-left: 18px;
	margin-bottom: 10px;
	font-size: 14.5px;
	line-height: 1.5;
	color: var(--cas-dp-muted);
}

.cas-dp-panel__list li::before {
	content: "";
	position: absolute;
	left: 0;
	top: .62em;
	width: 7px;
	height: 2px;
	background: var(--cas-dp-brand);
}

.cas-dp-spec { margin: 0; font-size: 14.5px; }
.cas-dp-spec dt {
	font-weight: 600;
	color: var(--cas-dp-ink);
	margin-top: 12px;
}
.cas-dp-spec dt:first-child { margin-top: 0; }
.cas-dp-spec dd {
	margin: 3px 0 0;
	color: var(--cas-dp-muted);
	line-height: 1.5;
}

.cas-dp-panel--cta { background: #14161a; border-color: #14161a; text-align: center; }
.cas-dp-panel--cta .cas-dp-panel__price { margin: 2px 0 14px; }
.cas-dp-panel--cta .cas-dp-price { color: #fff; font-size: 27px; }
.cas-dp-panel--cta .cas-dp-price del { color: #8c93a0; }
.cas-dp-panel--cta .cas-dp-price ins { color: #ff6b6e; }

.cas-dp-btn--block { display: flex; width: 100%; }

/* related */
.cas-dp-related { padding-top: 58px; padding-bottom: 64px; }

.cas-dp-related__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 24px;
}

.cas-dp-related__all {
	font-size: 14px;
	color: var(--cas-dp-brand);
	text-decoration: none;
	white-space: nowrap;
}

.cas-dp-related__all:hover { text-decoration: underline; }

/* ---------- Homepage / landing-page store block ---------- */

.cas-dp-block {
	--cas-dp-brand: #e5252a;
	--cas-dp-brand-dark: #b91d21;
	--cas-dp-ink: #1a1a1a;
	--cas-dp-muted: #6b7280;
	--cas-dp-line: #e5e7eb;
	--cas-dp-surface: #ffffff;
	--cas-dp-surface-alt: #f6f7f9;
	--cas-dp-radius: 10px;

	max-width: 1180px;
	margin: 0 auto;
	padding: 8px 20px 4px;
	box-sizing: border-box;
	text-align: left;
}

.cas-dp-block__head { max-width: 62ch; margin-bottom: 30px; }

.cas-dp-block__eyebrow {
	margin: 0 0 10px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--cas-dp-brand);
}

.cas-dp-block__title {
	margin: 0 0 12px;
	font-size: clamp(26px, 3.2vw, 36px);
	line-height: 1.16;
	letter-spacing: -0.01em;
	color: var(--cas-dp-ink);
}

.cas-dp-block__sub {
	margin: 0;
	font-size: 17px;
	line-height: 1.6;
	color: var(--cas-dp-muted);
}

.cas-dp-block__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px 22px;
	margin-top: 32px;
	padding-top: 26px;
	border-top: 1px solid var(--cas-dp-line);
}

.cas-dp-block__meta {
	margin: 0;
	font-size: 14.5px;
	color: var(--cas-dp-muted);
}

@media (max-width: 600px) {
	.cas-dp-block { padding: 4px 16px; }
	.cas-dp-block__foot { flex-direction: column; align-items: stretch; text-align: left; }
	.cas-dp-block__foot .cas-dp-btn { width: 100%; }
}

/* ---------- Dashboard: My Downloads ---------- */

.cas-dp-downloads__head { margin-bottom: 24px; }

.cas-dp-downloads__title {
	margin: 0 0 6px;
	font-size: 24px;
	color: var(--cas-dp-ink);
}

.cas-dp-downloads__sub {
	margin: 0;
	color: var(--cas-dp-muted);
}

.cas-dp-downloads__list {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.cas-dp-download-card {
	display: flex;
	gap: 18px;
	padding: 18px;
	border: 1px solid var(--cas-dp-line);
	border-radius: var(--cas-dp-radius);
	background: var(--cas-dp-surface);
}

.cas-dp-download-card__media {
	flex: 0 0 140px;
	aspect-ratio: 16 / 10;
	border-radius: 8px;
	overflow: hidden;
	background: var(--cas-dp-surface-alt);
}

.cas-dp-download-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cas-dp-download-card__body { flex: 1; min-width: 0; }

.cas-dp-download-card__title {
	margin: 0 0 4px;
	font-size: 18px;
	color: var(--cas-dp-ink);
}

.cas-dp-download-card__meta {
	margin: 0 0 14px;
	font-size: 13px;
	color: var(--cas-dp-muted);
}

.cas-dp-download-card__pending {
	margin: 0;
	font-size: 14px;
	color: var(--cas-dp-muted);
}

.cas-dp-file-list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.cas-dp-file {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 10px 12px;
	border: 1px solid var(--cas-dp-line);
	border-radius: 8px;
	background: var(--cas-dp-surface-alt);
}

.cas-dp-file__name {
	min-width: 0;
	font-size: 15px;
	color: var(--cas-dp-ink);
	overflow-wrap: anywhere;
}

.cas-dp-file__size {
	margin-left: 8px;
	font-size: 13px;
	color: var(--cas-dp-muted);
}

.cas-dp-file__btn { flex: 0 0 auto; }

.cas-dp-empty {
	padding: 32px;
	border: 1px dashed var(--cas-dp-line);
	border-radius: var(--cas-dp-radius);
	text-align: center;
	color: var(--cas-dp-muted);
}

.cas-dp-empty p { margin: 0 0 16px; }

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
	.cas-dp-hero { grid-template-columns: minmax(0, 1fr); gap: 28px; }
	.cas-dp-detail { grid-template-columns: minmax(0, 1fr); gap: 34px; padding-top: 40px; }
	.cas-dp-buybox,
	.cas-dp-detail__aside { position: static; }
	.cas-dp-detail__body { max-width: none; font-size: 16.5px; }
}

@media (max-width: 600px) {
	.cas-dp-store { padding: 32px 16px 56px; }
	.cas-dp-product > *,
	.cas-dp-band__inner { padding-left: 16px; padding-right: 16px; }
	.cas-dp-band { margin-top: 36px; padding: 36px 0 40px; }
	.cas-dp-gallery,
	.cas-dp-gallery--1,
	.cas-dp-gallery--2,
	.cas-dp-gallery--3,
	.cas-dp-gallery--4,
	.cas-dp-gallery--5,
	.cas-dp-gallery--6 { grid-template-columns: minmax(0, 1fr); gap: 16px; }
	.cas-dp-related { padding-top: 40px; padding-bottom: 44px; }
	.cas-dp-buybox__actions .cas-dp-btn { flex: 1 1 100%; }

	.cas-dp-download-card { flex-direction: column; }
	.cas-dp-download-card__media { flex-basis: auto; width: 100%; }
	.cas-dp-file { flex-direction: column; align-items: flex-start; }
	.cas-dp-file__btn { width: 100%; }
}

/* ---------- Beating the theme's global link colour ----------
   The Elementor kit on this site emits `.elementor-kit-11 a { color:#3C3C3C }`
   and `a:hover { color:#E30202 }`. Those are specificity (0,1,1) and (0,2,1),
   so they outrank any single-class rule of ours and every button rendered as
   an <a> inherited dark grey text on the red fill - about 2.6:1 contrast,
   which fails WCAG AA. Restating the colours prefixed with `body` lifts us to
   (0,2,1)+ so we win on specificity rather than on load order, which means no
   dependency on stylesheet ordering. Scoped to our own classes only. */

body a.cas-dp-btn,
body a.cas-dp-btn:link,
body a.cas-dp-btn:visited,
body a.cas-dp-btn:hover,
body a.cas-dp-btn:focus,
body a.cas-dp-btn:active { color: #fff; }

body a.cas-dp-btn--ghost,
body a.cas-dp-btn--ghost:link,
body a.cas-dp-btn--ghost:visited { color: var(--cas-dp-brand, #e5252a); }

body a.cas-dp-btn--ghost:hover,
body a.cas-dp-btn--ghost:focus,
body a.cas-dp-btn--ghost:active { color: #fff; }

body .cas-dp-card__title a,
body .cas-dp-card__title a:link,
body .cas-dp-card__title a:visited { color: var(--cas-dp-ink, #1a1a1a); }

body .cas-dp-card__title a:hover,
body .cas-dp-card__title a:focus { color: var(--cas-dp-brand, #e5252a); }

body a.cas-dp-chip,
body a.cas-dp-chip:link,
body a.cas-dp-chip:visited { color: var(--cas-dp-ink, #1a1a1a); }

body a.cas-dp-chip:hover,
body a.cas-dp-chip:focus,
body a.cas-dp-chip.is-active { color: var(--cas-dp-brand, #e5252a); }

body .cas-dp-crumbs a,
body .cas-dp-crumbs a:link,
body .cas-dp-crumbs a:visited { color: var(--cas-dp-muted, #6b7280); }

body .cas-dp-crumbs a:hover,
body .cas-dp-crumbs a:focus { color: var(--cas-dp-brand, #e5252a); }

body a.cas-dp-related__all,
body a.cas-dp-related__all:link,
body a.cas-dp-related__all:visited,
body a.cas-dp-related__all:hover,
body a.cas-dp-related__all:focus { color: var(--cas-dp-brand, #e5252a); }
