/**
 * Carrie Olsen Store — front-end styles.
 * Scoped under .cos-store / .cos-single so it won't fight the theme.
 * Brand: DM Serif Display + DM Sans; cream / gold / purple.
 */

.cos-store,
.cos-single {
	--cos-cream: #fdfcfa;
	--cos-cream-2: #f6f3ee;
	--cos-ink: #3a3a3a;
	--cos-ink-soft: #777;
	--cos-border: #e6e2db;
	--cos-gold: #d4952b;
	--cos-gold-dark: #b87d1e;
	--cos-gold-soft: #f5e6cc;
	--cos-purple: #6b3fa0;
	--cos-mauve: #b87b94;
	--cos-radius: 14px;
	--cos-shadow: 0 1px 2px rgba(40, 34, 24, .06), 0 8px 24px rgba(40, 34, 24, .06);
	font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	color: var(--cos-ink);
	line-height: 1.5;
}

.cos-store *,
.cos-single .cos-single * {
	box-sizing: border-box;
}

/* Progressive enhancement: interactive chrome hidden until JS wakes up. */
.cos-store .cos-toolbar,
.cos-store .cos-filters,
.cos-store .cos-count { display: none; }
.cos-store.cos-js .cos-toolbar { display: flex; }
.cos-store.cos-js .cos-filters { display: flex; }
.cos-store.cos-js .cos-count { display: block; }

/* Toolbar */
.cos-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
}
.cos-search { flex: 1 1 240px; }
.cos-search input {
	width: 100%;
	padding: 11px 14px;
	border: 1px solid var(--cos-border);
	border-radius: 999px;
	background: #fff;
	font-size: 15px;
	color: var(--cos-ink);
}
.cos-search input:focus { outline: 2px solid var(--cos-gold); outline-offset: 1px; }
.cos-controls { display: flex; gap: 8px; align-items: center; }
.cos-sort select {
	padding: 9px 12px;
	border: 1px solid var(--cos-border);
	border-radius: 999px;
	background: #fff;
	font-size: 14px;
	color: var(--cos-ink);
}
.cos-saved-toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 14px;
	border: 1px solid var(--cos-border);
	border-radius: 999px;
	background: #fff;
	cursor: pointer;
	font-size: 14px;
	color: var(--cos-ink);
}
.cos-saved-toggle[aria-pressed="true"] {
	background: var(--cos-gold-soft);
	border-color: var(--cos-gold);
}
.cos-saved-toggle .cos-heart { color: var(--cos-mauve); }

/* Filters */
.cos-filters {
	flex-wrap: wrap;
	gap: 10px 16px;
	align-items: center;
	margin-bottom: 16px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--cos-border);
}
.cos-filter-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cos-filter-label { font-size: 13px; color: var(--cos-ink-soft); margin-right: 2px; }
.cos-chip {
	padding: 6px 12px;
	border: 1px solid var(--cos-border);
	border-radius: 999px;
	background: #fff;
	cursor: pointer;
	font-size: 13px;
	color: var(--cos-ink);
	transition: background .15s, border-color .15s;
}
.cos-chip:hover { border-color: var(--cos-gold); }
.cos-chip[aria-pressed="true"] {
	background: var(--cos-purple);
	border-color: var(--cos-purple);
	color: #fff;
}
.cos-clear {
	margin-left: auto;
	padding: 6px 12px;
	border: none;
	background: none;
	color: var(--cos-purple);
	cursor: pointer;
	font-size: 13px;
	text-decoration: underline;
}
.cos-count { font-size: 13px; color: var(--cos-ink-soft); margin: 0 0 14px; }

/* Grid */
.cos-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
	gap: 22px;
}
.cos-card.is-hidden { display: none; }

.cos-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--cos-border);
	border-radius: var(--cos-radius);
	overflow: hidden;
	transition: transform .18s ease, box-shadow .18s ease;
}
.cos-card:hover { transform: translateY(-3px); box-shadow: var(--cos-shadow); }
.cos-card.is-featured { border-color: var(--cos-gold); box-shadow: 0 0 0 1px var(--cos-gold) inset; }

.cos-card-media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	background: linear-gradient(135deg, var(--cos-gold-soft), var(--cos-cream-2));
	overflow: hidden;
}
.cos-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cos-initial {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: "DM Serif Display", Georgia, serif;
	font-size: 64px;
	color: var(--cos-gold-dark);
	opacity: .55;
}
.cos-badge, .cos-sale-badge {
	position: absolute;
	top: 10px;
	z-index: 2;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .02em;
}
.cos-badge { left: 10px; background: var(--cos-purple); color: #fff; }
.cos-sale-badge { right: 10px; background: var(--cos-mauve); color: #fff; }
.cos-play {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 54px;
	height: 54px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, .92);
	color: var(--cos-gold-dark);
	border-radius: 50%;
	font-size: 20px;
	padding-left: 4px;
	box-shadow: var(--cos-shadow);
}

.cos-card-body { display: flex; flex-direction: column; gap: 8px; padding: 16px 16px 18px; flex: 1; }
.cos-card-terms { display: flex; flex-wrap: wrap; gap: 6px; }
.cos-term {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--cos-gold-dark);
	background: var(--cos-gold-soft);
	padding: 3px 8px;
	border-radius: 4px;
}
.cos-card-title {
	font-family: "DM Serif Display", Georgia, serif;
	font-size: 20px;
	line-height: 1.2;
	margin: 2px 0 0;
}
.cos-card-title a { color: var(--cos-ink); text-decoration: none; }
.cos-card-title a:hover { color: var(--cos-purple); }
.cos-card-desc { font-size: 14px; color: var(--cos-ink-soft); margin: 0; }
.cos-card-facts { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12.5px; color: var(--cos-ink-soft); margin-top: 2px; }
.cos-fact { position: relative; }
.cos-fact + .cos-fact::before { content: "·"; margin-right: 8px; color: var(--cos-border); }

/* Stars */
.cos-rating { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.cos-stars { letter-spacing: 1px; }
.cos-star { color: #ddd6ca; }
.cos-star.is-full { color: var(--cos-gold); }
.cos-star.is-half { position: relative; color: #ddd6ca; }
.cos-star.is-half::before {
	content: "★";
	position: absolute;
	left: 0;
	top: 0;
	width: 50%;
	overflow: hidden;
	color: var(--cos-gold);
}
.cos-rating-num { font-weight: 700; }
.cos-rating-count { color: var(--cos-ink-soft); }

.cos-countdown {
	font-size: 12.5px;
	font-weight: 600;
	color: var(--cos-mauve);
	margin: 0;
}

.cos-card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 8px; }
.cos-price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.cos-price-now { font-size: 19px; font-weight: 700; color: var(--cos-ink); }
.cos-price-was { text-decoration: line-through; color: var(--cos-ink-soft); font-size: 14px; }
.cos-price-tba { font-size: 13px; color: var(--cos-ink-soft); font-style: italic; }

.cos-actions { display: flex; align-items: center; gap: 8px; }
.cos-wish {
	width: 34px;
	height: 34px;
	border: 1px solid var(--cos-border);
	border-radius: 50%;
	background: #fff;
	color: var(--cos-mauve);
	font-size: 16px;
	cursor: pointer;
	line-height: 1;
}
.cos-wish.is-saved { background: var(--cos-mauve); color: #fff; border-color: var(--cos-mauve); }
.cos-preview-btn, .cos-details {
	padding: 8px 12px;
	border: 1px solid var(--cos-border);
	border-radius: 999px;
	background: #fff;
	color: var(--cos-ink);
	font-size: 13px;
	cursor: pointer;
	text-decoration: none;
}
.cos-preview-btn:hover, .cos-details:hover { border-color: var(--cos-gold); }
.cos-buy, .cos-buy-lg {
	display: inline-block;
	padding: 9px 16px;
	border-radius: 999px;
	background: var(--cos-gold);
	color: #fff;
	font-weight: 700;
	font-size: 14px;
	text-decoration: none;
	transition: background .15s;
}
.cos-buy:hover, .cos-buy-lg:hover { background: var(--cos-gold-dark); color: #fff; }
.cos-closed { font-size: 13px; color: var(--cos-mauve); font-weight: 600; }

.cos-empty, .cos-empty-initial { font-size: 15px; color: var(--cos-ink-soft); padding: 24px 0; }

/* Recently viewed */
.cos-recent { margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--cos-border); }
.cos-recent-title { font-family: "DM Serif Display", Georgia, serif; font-size: 18px; margin: 0 0 12px; }
.cos-recent-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.cos-recent-card {
	flex: 0 0 200px;
	border: 1px solid var(--cos-border);
	border-radius: 10px;
	overflow: hidden;
	text-decoration: none;
	color: var(--cos-ink);
	background: #fff;
}
.cos-recent-card img { width: 100%; height: 96px; object-fit: cover; display: block; background: var(--cos-cream-2); }
.cos-recent-card .cos-recent-meta { padding: 8px 10px; }
.cos-recent-card .cos-recent-name { font-size: 13px; font-weight: 600; display: block; }
.cos-recent-card .cos-recent-price { font-size: 12.5px; color: var(--cos-gold-dark); }

/* Preview modal */
.cos-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(28, 24, 18, .8);
	padding: 20px;
}
.cos-modal[hidden] { display: none; }
.cos-modal-inner { position: relative; width: min(900px, 100%); aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; }
.cos-modal-inner iframe, .cos-modal-inner video { width: 100%; height: 100%; border: 0; display: block; }
.cos-modal-close {
	position: absolute;
	top: -14px;
	right: -14px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: none;
	background: #fff;
	color: var(--cos-ink);
	font-size: 20px;
	cursor: pointer;
	box-shadow: var(--cos-shadow);
}

/* Single course detail additions */
.cos-single { margin-top: 26px; display: flex; flex-direction: column; gap: 22px; }
.cos-buy-panel {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	padding: 20px 22px;
	background: var(--cos-cream-2);
	border: 1px solid var(--cos-border);
	border-radius: var(--cos-radius);
}
.cos-buy-panel-price { display: flex; align-items: baseline; gap: 8px; }
.cos-buy-panel .cos-price-now { font-size: 26px; }
.cos-buy-lg { padding: 12px 24px; font-size: 16px; margin-left: auto; }
.cos-sale-inline { position: static; }
.cos-closed-lg { font-size: 15px; margin-left: auto; }
.cos-testimonial {
	margin: 0;
	padding: 20px 24px;
	border-left: 4px solid var(--cos-gold);
	background: #fff;
	border-radius: 0 var(--cos-radius) var(--cos-radius) 0;
}
.cos-testimonial blockquote { margin: 0; font-family: "DM Serif Display", Georgia, serif; font-size: 20px; line-height: 1.4; color: var(--cos-ink); }
.cos-testimonial figcaption { margin-top: 10px; font-size: 14px; color: var(--cos-ink-soft); }
.cos-faq-title { font-family: "DM Serif Display", Georgia, serif; font-size: 22px; margin: 0 0 10px; }
.cos-faq-item {
	border: 1px solid var(--cos-border);
	border-radius: 10px;
	margin-bottom: 10px;
	background: #fff;
}
.cos-faq-item summary { cursor: pointer; padding: 14px 16px; font-weight: 600; list-style: none; }
.cos-faq-item summary::-webkit-details-marker { display: none; }
.cos-faq-item[open] summary { border-bottom: 1px solid var(--cos-border); }
.cos-faq-a { padding: 12px 16px; color: var(--cos-ink-soft); }

@media (max-width: 600px) {
	.cos-toolbar { flex-direction: column; align-items: stretch; }
	.cos-controls { justify-content: space-between; }
	.cos-buy-lg, .cos-closed-lg { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.cos-store *, .cos-single * { transition: none !important; }
}
