/*
Theme Name: ExamPro Thailand
Theme URI: https://example.com
Author: QMCA
Description: Custom WordPress theme สำหรับเว็บข้อสอบออนไลน์ ออกแบบมาเพื่อระบบ Quiz + WooCommerce โดยเฉพาะ
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: exampro
Tags: woocommerce, education, quiz, exam, thai
*/

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
	--primary:        #1e3a6e;
	--primary-mid:    #2d5298;
	--primary-light:  #2271b1;
	--primary-pale:   #e8f0fc;
	--primary-border: #c3d5f0;
	--accent:         #f8b400;
	--success:        #28a745;
	--success-pale:   #e8f5ec;
	--danger:         #dc3545;
	--warning:        #ffc107;
	--text:           #1a202c;
	--text-mid:       #4a5568;
	--text-light:     #718096;
	--bg:             #f8fafc;
	--bg-card:        #ffffff;
	--border:         #e2e8f0;
	--border-dark:    #cbd5e0;
	--white:          #ffffff;
	--shadow-sm:      0 1px 4px rgba(30,58,110,.07);
	--shadow:         0 4px 16px rgba(30,58,110,.10);
	--shadow-lg:      0 8px 32px rgba(30,58,110,.14);
	--radius-sm:      6px;
	--radius:         12px;
	--radius-lg:      20px;
	--transition:     all .25s ease;
	--header-h:       80px;
	--container:      1180px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
	font-family: 'Sarabun', sans-serif;
	font-size: 1rem;
	line-height: 1.65;
	color: var(--text);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-light); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary); }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }

h1,h2,h3,h4,h5,h6 {
	font-weight: 700;
	line-height: 1.3;
	color: var(--primary);
}

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
	max-width: var(--container);
	margin: 0 auto;
	padding: 0 24px;
}

.site-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
.site-main    { flex: 1; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
	position: sticky;
	top: 0;
	z-index: 1000;
	background: var(--white);
	box-shadow: 0 2px 12px rgba(30,58,110,.08);
	height: var(--header-h);
}

.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 100%;
	gap: 24px;
	padding-top: 8px;
}

/* Logo */
.site-logo {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
	text-decoration: none;
}

.logo-icon {
	width: 42px;
	height: 42px;
	background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
	border-radius: var(--radius-sm);
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-size: 20px;
	font-weight: 900;
}

.logo-text { line-height: 1.1; }
.logo-text .name { font-size: 1.1rem; font-weight: 800; color: var(--primary); }
.logo-text .tagline { font-size: .7rem; color: var(--text-light); }

/* Main Nav */
.main-nav ul { display: flex; align-items: center; gap: 4px; }
.main-nav a {
	padding: 8px 14px;
	border-radius: var(--radius-sm);
	font-size: .95rem;
	font-weight: 600;
	color: var(--text-mid);
	white-space: nowrap;
}
.main-nav a:hover,
.main-nav .current-menu-item a { color: var(--primary-light); background: var(--primary-pale); }

/* Header Actions */
.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.btn-cart {
	position: relative;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border-radius: var(--radius-sm);
	background: var(--primary-pale);
	color: var(--primary);
	font-weight: 600;
	font-size: .9rem;
}
.btn-cart:hover { background: var(--primary-border); color: var(--primary); }
.cart-count {
	position: absolute;
	top: -6px; right: -6px;
	background: var(--danger);
	color: white;
	font-size: .65rem;
	font-weight: 700;
	width: 18px; height: 18px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.btn-login, .btn-register {
	padding: 9px 20px;
	border-radius: var(--radius-sm);
	font-size: .9rem;
	font-weight: 700;
}
.btn-login   { color: var(--primary-light); border: 2px solid var(--primary-border); }
.btn-login:hover { background: var(--primary-pale); color: var(--primary); }
.btn-register {
	background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
	color: white;
}
.btn-register:hover { opacity: .9; color: white; }

/* Mobile Toggle */
.mobile-menu-toggle {
	display: none;
	background: none;
	border: none;
	padding: 6px;
	flex-direction: column;
	gap: 5px;
}
.mobile-menu-toggle span {
	display: block;
	width: 24px;
	height: 2px;
	background: var(--primary);
	border-radius: 2px;
	transition: var(--transition);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
	background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 60%, #3a6fd8 100%);
	color: white;
	padding: 80px 0 90px;
	position: relative;
	overflow: hidden;
}

.hero::before {
	content: '';
	position: absolute;
	top: -50%; right: -10%;
	width: 600px; height: 600px;
	background: rgba(255,255,255,.04);
	border-radius: 50%;
}

.hero::after {
	content: '';
	position: absolute;
	bottom: -30%; left: -5%;
	width: 400px; height: 400px;
	background: rgba(255,255,255,.03);
	border-radius: 50%;
}

.hero-inner {
	position: relative;
	z-index: 1;
	text-align: center;
	max-width: 700px;
	margin: 0 auto;
}

.hero-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: rgba(255,255,255,.15);
	border: 1px solid rgba(255,255,255,.25);
	border-radius: 50px;
	padding: 6px 16px;
	font-size: .85rem;
	font-weight: 600;
	margin-bottom: 20px;
}

.hero h1 {
	font-size: clamp(2rem, 5vw, 3rem);
	font-weight: 900;
	color: white;
	line-height: 1.2;
	margin-bottom: 16px;
}

.hero h1 span { color: var(--accent); }

.hero p {
	font-size: 1.15rem;
	color: rgba(255,255,255,.85);
	margin-bottom: 36px;
	line-height: 1.7;
}

.hero-search {
	display: flex;
	gap: 0;
	max-width: 560px;
	margin: 0 auto 32px;
	background: white;
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: 0 8px 32px rgba(0,0,0,.2);
}

.hero-search input {
	flex: 1;
	border: none;
	padding: 16px 20px;
	font-size: 1rem;
	font-family: inherit;
	color: var(--text);
	outline: none;
}

.hero-search button {
	background: var(--accent);
	color: var(--primary);
	border: none;
	padding: 16px 28px;
	font-size: 1rem;
	font-weight: 700;
	font-family: inherit;
	white-space: nowrap;
	transition: var(--transition);
}
.hero-search button:hover { background: #e0a500; }

.hero-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
}

.hero-tags span { font-size: .8rem; color: rgba(255,255,255,.7); }

.hero-tag {
	background: rgba(255,255,255,.12);
	border: 1px solid rgba(255,255,255,.2);
	color: rgba(255,255,255,.9);
	border-radius: 50px;
	padding: 4px 12px;
	font-size: .82rem;
	cursor: pointer;
	transition: var(--transition);
}
.hero-tag:hover { background: rgba(255,255,255,.22); color: white; }

/* ============================================================
   STATS BAR
   ============================================================ */
.stats-bar {
	background: white;
	box-shadow: var(--shadow);
	padding: 28px 0;
}

.stats-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 0;
}

.stat-item {
	text-align: center;
	padding: 8px 20px;
	border-right: 1px solid var(--border);
}
.stat-item:last-child { border-right: none; }

.stat-number {
	font-size: 2rem;
	font-weight: 900;
	color: var(--primary);
	line-height: 1;
	margin-bottom: 4px;
}

.stat-label {
	font-size: .85rem;
	color: var(--text-light);
	font-weight: 500;
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: 64px 0; }
.section-alt { background: white; }

.section-header {
	text-align: center;
	margin-bottom: 44px;
}

.section-label {
	display: inline-block;
	background: var(--primary-pale);
	color: var(--primary-light);
	padding: 4px 14px;
	border-radius: 50px;
	font-size: .8rem;
	font-weight: 700;
	letter-spacing: .05em;
	text-transform: uppercase;
	margin-bottom: 12px;
}

.section-header h2 {
	font-size: clamp(1.5rem, 3vw, 2.2rem);
	color: var(--primary);
	margin-bottom: 10px;
}

.section-header p {
	color: var(--text-mid);
	font-size: 1.05rem;
	max-width: 560px;
	margin: 0 auto;
}

/* ============================================================
   CATEGORY CARDS
   ============================================================ */
.category-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 16px;
}

.category-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	padding: 24px 16px;
	background: white;
	border: 2px solid var(--border);
	border-radius: var(--radius);
	text-align: center;
	text-decoration: none;
	transition: var(--transition);
}

.category-card:hover {
	border-color: var(--primary-light);
	box-shadow: var(--shadow);
	transform: translateY(-3px);
}

.category-icon {
	width: 52px;
	height: 52px;
	background: var(--primary-pale);
	border-radius: var(--radius-sm);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.6rem;
}

.category-card .cat-name {
	font-size: .9rem;
	font-weight: 700;
	color: var(--primary);
}

.category-card .cat-count {
	font-size: .78rem;
	color: var(--text-light);
}

/* ============================================================
   PRODUCT GRID — WooCommerce ul.products + custom .products-grid
   ============================================================ */
ul.products,
.products-grid {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
	gap: 20px !important;
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

ul.products li.product,
.products-grid > * {
	margin: 0 !important;
	float: none !important;
	width: auto !important;
}

/* WooCommerce adds clearfix ::before/::after to ul.products for float layout.
   In CSS Grid, pseudo-elements ARE grid items — the ::before takes column 1,
   pushing actual products to column 2. Remove them from grid flow. */
ul.products::before,
ul.products::after {
	display: none !important;
}

/* ============================================================
   EXAM CARD — 1:1 image ratio design
   ============================================================ */
.exam-card {
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
	display: flex;
	flex-direction: column;
	position: relative;
}

.exam-card:hover {
	box-shadow: 0 10px 40px rgba(30,58,110,.14);
	transform: translateY(-5px);
	border-color: var(--primary-border);
}

/* inner link wraps everything — fills the card height */
.exam-card-inner {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	color: inherit;
}

.exam-card-inner:hover { color: inherit; }

/* ── Thumbnail: strict 1:1 ratio ───────────────────── */
.exam-card-thumb {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;         /* 1:1 square */
	overflow: hidden;
	flex-shrink: 0;
	background: linear-gradient(140deg, var(--primary) 0%, var(--primary-mid) 55%, #3a6fd8 100%);
}

/* real image: fill the square, crop center */
.exam-card-thumb img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .4s ease;
}
.exam-card:hover .exam-card-thumb img { transform: scale(1.05); }

/* subtle dark gradient over image for readability */
.exam-card-thumb::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(to bottom, rgba(0,0,0,.0) 40%, rgba(0,0,0,.35) 100%);
	pointer-events: none;
}

/* placeholder when no image */
.exam-card-thumb-placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-size: 3.5rem;
	color: rgba(255,255,255,.4);
}

.exam-card-thumb-placeholder .placeholder-label {
	font-size: .75rem;
	font-weight: 700;
	color: rgba(255,255,255,.5);
	letter-spacing: .08em;
	text-transform: uppercase;
}

/* ── Badges (overlaid on thumbnail) ───────────────── */
.exam-card-badges {
	position: absolute;
	top: 10px;
	left: 10px;
	right: 10px;
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	z-index: 2;
	pointer-events: none;
}

.exam-card-badge {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	font-size: .7rem;
	font-weight: 800;
	padding: 4px 10px;
	border-radius: 50px;
	letter-spacing: .02em;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.badge-free    { background: rgba(40,167,69,.92); color: white; }
.badge-popular { background: rgba(248,180,0,.95); color: var(--primary); }
.badge-new     { background: rgba(34,113,177,.9); color: white; }
.badge-video   { background: rgba(255,255,255,.18); color: white; border: 1px solid rgba(255,255,255,.35); }

/* sets count — bottom-right corner of thumb */
.exam-card-sets-badge {
	position: absolute;
	bottom: 10px;
	right: 10px;
	z-index: 2;
	background: rgba(0,0,0,.55);
	color: rgba(255,255,255,.9);
	font-size: .72rem;
	font-weight: 700;
	padding: 3px 9px;
	border-radius: 50px;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	pointer-events: none;
}

/* ── Card body (below image) ───────────────────────── */
.exam-card-body {
	padding: 14px 16px 0;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.exam-card-category {
	font-size: .7rem;
	font-weight: 800;
	color: var(--primary-light);
	text-transform: uppercase;
	letter-spacing: .07em;
	margin-bottom: 5px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.exam-card-title {
	font-size: .95rem;
	font-weight: 700;
	color: var(--primary);
	line-height: 1.45;
	margin-bottom: 10px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	flex: 1;
}

.exam-card-meta {
	display: flex;
	gap: 0;
	flex-wrap: wrap;
	margin-bottom: 12px;
	row-gap: 4px;
}

.exam-meta-item {
	display: flex;
	align-items: center;
	gap: 3px;
	font-size: .76rem;
	color: var(--text-light);
	padding-right: 10px;
	margin-right: 10px;
	border-right: 1px solid var(--border);
}
.exam-meta-item:last-child { border-right: none; padding-right: 0; margin-right: 0; }
.exam-meta-icon { font-size: .85rem; }

/* ── Card footer ────────────────────────────────────── */
.exam-card-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 16px;
	border-top: 1px solid var(--border);
	background: var(--bg);
	margin-top: auto;
	gap: 8px;
}

.exam-price-wrap { min-width: 0; }

.exam-price {
	font-size: 1.15rem;
	font-weight: 900;
	color: var(--primary);
	line-height: 1;
}

.exam-price.free { color: var(--success); font-size: 1rem; }

.exam-price-sub {
	font-size: .7rem;
	color: var(--text-light);
	margin-top: 2px;
	white-space: nowrap;
}

.btn-buy {
	flex-shrink: 0;
	background: var(--primary);
	color: white;
	border: none;
	padding: 8px 16px;
	border-radius: var(--radius-sm);
	font-size: .82rem;
	font-weight: 700;
	font-family: inherit;
	transition: var(--transition);
	white-space: nowrap;
}
.btn-buy:hover { background: var(--primary-light); color: white; }

.btn-buy.btn-outline {
	background: transparent;
	border: 2px solid var(--primary);
	color: var(--primary);
}
.btn-buy.btn-outline:hover { background: var(--primary); color: white; }

/* ── Hover overlay "preview" effect ────────────────── */
.exam-card-hover-info {
	position: absolute;
	inset: 0;
	background: rgba(30,58,110,.88);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	opacity: 0;
	transition: opacity .25s ease;
	pointer-events: none;
	border-radius: var(--radius);
	padding: 20px;
	text-align: center;
}

.exam-card:hover .exam-card-hover-info { opacity: 1; }

.exam-card-hover-info .hover-title {
	font-size: 1rem;
	font-weight: 700;
	color: white;
	line-height: 1.4;
}

.exam-card-hover-info .hover-btn {
	background: white;
	color: var(--primary);
	padding: 9px 24px;
	border-radius: var(--radius-sm);
	font-size: .9rem;
	font-weight: 700;
}

/* ── Archive category card on product loop ──────────── */
.woocommerce-loop-category__title { font-size: 1rem !important; }

/* ============================================================
   HOW IT WORKS
   ============================================================ */
.steps-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 32px;
	position: relative;
}

.steps-grid::before {
	content: '';
	position: absolute;
	top: 36px;
	left: calc(16.66% + 20px);
	right: calc(16.66% + 20px);
	height: 2px;
	background-image: repeating-linear-gradient(90deg, var(--primary-border) 0, var(--primary-border) 8px, transparent 8px, transparent 16px);
}

/* ============================================================
   HOW IT WORKS
   ============================================================ */
.steps-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 32px;
	position: relative;
}

.steps-grid::before {
	content: '';
	position: absolute;
	top: 36px;
	left: calc(16.66% + 20px);
	right: calc(16.66% + 20px);
	height: 2px;
	background: linear-gradient(90deg, var(--primary-border) 0%, var(--primary-border) 100%);
	background-image: repeating-linear-gradient(90deg, var(--primary-border) 0, var(--primary-border) 8px, transparent 8px, transparent 16px);
}

.step-item { text-align: center; position: relative; }

.step-number {
	width: 72px;
	height: 72px;
	background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 20px;
	font-size: 1.6rem;
	box-shadow: 0 4px 16px rgba(30,58,110,.25);
	position: relative;
	z-index: 1;
}

.step-item h3 { font-size: 1.05rem; color: var(--primary); margin-bottom: 8px; }
.step-item p  { font-size: .9rem; color: var(--text-mid); line-height: 1.6; }

/* ============================================================
   CTA BANNER
   ============================================================ */
.cta-banner {
	background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 100%);
	color: white;
	padding: 60px 0;
	text-align: center;
}

.cta-banner h2 {
	font-size: clamp(1.4rem, 3vw, 2rem);
	color: white;
	margin-bottom: 12px;
}

.cta-banner p { color: rgba(255,255,255,.8); font-size: 1.05rem; margin-bottom: 28px; }

.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn-white {
	background: white;
	color: var(--primary);
	padding: 14px 32px;
	border-radius: var(--radius-sm);
	font-weight: 700;
	font-size: 1rem;
	transition: var(--transition);
}
.btn-white:hover { background: var(--accent); color: var(--primary); }

.btn-ghost {
	background: transparent;
	color: white;
	border: 2px solid rgba(255,255,255,.4);
	padding: 14px 32px;
	border-radius: var(--radius-sm);
	font-weight: 700;
	font-size: 1rem;
	transition: var(--transition);
}
.btn-ghost:hover { background: rgba(255,255,255,.1); color: white; border-color: white; }

/* ============================================================
   ARCHIVE / CATEGORY / TAG  — page header
   ============================================================ */

/* breadcrumb — white bar between sticky header and gradient banner */
.archive-breadcrumb {
	background: white;
	border-bottom: 1px solid var(--border);
	padding: 9px 0;
	font-size: .82rem;
	color: var(--text-light);
}

.archive-breadcrumb a {
	color: var(--primary-light);
	text-decoration: none;
}

.archive-breadcrumb a:hover { color: var(--primary); }
.archive-breadcrumb span   { margin: 0 6px; color: var(--border-dark); }

/* gradient banner */
.archive-page-header {
	background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 60%, #3a6fd8 100%);
	color: white;
	padding: 32px 0 36px;
	margin-bottom: 0;
}

.archive-page-header .archive-header-body {
	display: flex;
	align-items: flex-start;
	gap: 20px;
}

.archive-cat-icon {
	width: 68px;
	height: 68px;
	min-width: 68px;
	background: rgba(255,255,255,.15);
	border-radius: var(--radius);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 2.2rem;
	flex-shrink: 0;
}

.archive-header-text { flex: 1; min-width: 0; }

.archive-page-header h1 {
	font-size: clamp(1.3rem, 3vw, 2rem);
	color: white;
	margin: 0 0 6px;
	line-height: 1.25;
}

.archive-cat-desc {
	color: rgba(255,255,255,.8);
	font-size: .92rem;
	margin: 0 0 14px;
	line-height: 1.55;
}

.archive-cat-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.archive-cat-stats span {
	background: rgba(255,255,255,.15);
	border: 1px solid rgba(255,255,255,.25);
	color: white;
	font-size: .8rem;
	font-weight: 600;
	padding: 4px 12px;
	border-radius: 20px;
}

/* ============================================================
   SHOP / ARCHIVE PAGE — two-column layout
   ============================================================ */
.shop-layout {
	display: grid;
	grid-template-columns: 240px 1fr;
	gap: 28px;
	padding: 32px 0 56px;
}

/* ── Sidebar ──────────────────────────────────────── */
.shop-sidebar { display: flex; flex-direction: column; gap: 16px; }

.sidebar-widget {
	background: white;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 18px;
}

.sidebar-widget h3 {
	font-size: .88rem;
	font-weight: 800;
	color: var(--primary);
	margin-bottom: 14px;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--primary-pale);
	text-transform: uppercase;
	letter-spacing: .06em;
}

/* Category list in sidebar — works with or without wrapper */
.sidebar-cat-list { display: flex; flex-direction: column; gap: 2px; }

/* direct <a> links inside sidebar-widget (no list wrapper) */
.sidebar-widget a.sidebar-cat-item { display: flex; }
.sidebar-widget a.sidebar-cat-item + a.sidebar-cat-item { margin-top: 2px; }

.sidebar-cat-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 10px;
	border-radius: var(--radius-sm);
	color: var(--text-mid);
	font-size: .88rem;
	font-weight: 500;
	text-decoration: none;
	transition: var(--transition);
}

.sidebar-cat-item:hover,
.sidebar-cat-item.is-active {
	background: var(--primary-pale);
	color: var(--primary);
}

.sidebar-cat-item.is-active { font-weight: 700; }

.sidebar-cat-count {
	background: var(--border);
	color: var(--text-light);
	font-size: .7rem;
	font-weight: 700;
	padding: 2px 7px;
	border-radius: 50px;
	flex-shrink: 0;
}

.sidebar-cat-item:hover .sidebar-cat-count,
.sidebar-cat-item.is-active .sidebar-cat-count {
	background: var(--primary-border);
	color: var(--primary);
}

/* WooCommerce sidebar widget overrides */
.sidebar-widget .widget_product_categories ul { display: flex; flex-direction: column; gap: 2px; }
.sidebar-widget .widget_product_categories li a {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 10px;
	border-radius: var(--radius-sm);
	color: var(--text-mid);
	font-size: .88rem;
	text-decoration: none;
}
.sidebar-widget .widget_product_categories li a:hover { background: var(--primary-pale); color: var(--primary); }
.sidebar-widget .widget_product_categories .count {
	background: var(--border);
	color: var(--text-light);
	padding: 1px 7px;
	border-radius: 50px;
	font-size: .72rem;
}

/* Price filter widget */
.sidebar-widget .price_slider_wrapper { padding-top: 8px; }
.sidebar-widget .price_slider_amount button {
	background: var(--primary);
	color: white;
	border: none;
	padding: 7px 16px;
	border-radius: var(--radius-sm);
	font-size: .85rem;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
}

/* ── Shop Main ────────────────────────────────────── */
.shop-main { min-width: 0; }

.shop-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	padding: 12px 16px;
	background: white;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	flex-wrap: wrap;
	gap: 10px;
}

.woocommerce-result-count,
.shop-result-count {
	font-size: .85rem;
	color: var(--text-light);
	margin: 0;
}

.woocommerce-result-count strong,
.shop-result-count strong { color: var(--text); font-weight: 700; }

.woocommerce-ordering { margin: 0; }

.woocommerce-ordering select {
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 7px 32px 7px 12px;
	font-size: .85rem;
	font-family: inherit;
	color: var(--text-mid);
	background: var(--bg);
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23718096' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	background-size: 10px;
	cursor: pointer;
}

/* Active category chip (shown above grid) */
.active-filter-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 16px;
}

.filter-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: var(--primary-pale);
	color: var(--primary);
	border: 1px solid var(--primary-border);
	border-radius: 50px;
	padding: 4px 12px;
	font-size: .8rem;
	font-weight: 600;
}

.filter-chip .remove { font-size: 1rem; cursor: pointer; opacity: .6; }
.filter-chip .remove:hover { opacity: 1; }

/* ── Pagination ───────────────────────────────────── */
.woocommerce-pagination {
	display: flex;
	justify-content: center;
	margin-top: 40px;
}

.woocommerce-pagination ul {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	justify-content: center;
	list-style: none;
	margin: 0;
	padding: 0;
}

.woocommerce-pagination .page-numbers {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border-radius: var(--radius-sm);
	font-size: .88rem;
	font-weight: 600;
	color: var(--text-mid);
	border: 1px solid var(--border);
	background: white;
	transition: var(--transition);
	text-decoration: none;
}

.woocommerce-pagination .page-numbers:hover,
.woocommerce-pagination .page-numbers.current {
	background: var(--primary);
	color: white;
	border-color: var(--primary);
}

/* ============================================================
   PAGE CONTENT (page.php, generic pages)
   ============================================================ */
.page-content-wrap {
	padding: 40px 0 64px;
}

.page-article-title {
	font-size: clamp(1.5rem, 3vw, 2.2rem);
	color: var(--primary);
	margin-bottom: 24px;
	padding-bottom: 16px;
	border-bottom: 2px solid var(--border);
}

.entry-content {
	font-size: 1rem;
	line-height: 1.8;
	color: var(--text-mid);
	max-width: 820px;
}

/* WooCommerce pages use page.php which wraps content in .entry-content —
   remove the max-width so account / shop layouts can use their own widths */
.woocommerce-page .entry-content,
.woocommerce-account .entry-content {
	max-width: none;
}

.entry-content h2,
.entry-content h3 { color: var(--primary); margin: 1.5em 0 .6em; }
.entry-content p  { margin-bottom: 1.1em; }
.entry-content ul,
.entry-content ol { padding-left: 1.4em; margin-bottom: 1em; }
.entry-content a  { color: var(--primary-light); text-decoration: underline; }

/* ============================================================
   SINGLE PRODUCT PAGE — WooCommerce default template override
   ============================================================ */
.product-page { padding: 40px 0 60px; }

/* reset WooCommerce float layout → CSS grid */
.product-page div.product {
	display: grid;
	grid-template-columns: 340px 1fr;
	grid-template-rows: auto;
	gap: 40px;
	align-items: start;
	margin-bottom: 48px;
}

/* gallery column — sticky on inner wrapper, NOT on the grid item itself
   (sticky on a grid item causes a 100px downward offset in Chrome) */
.product-page .woocommerce-product-gallery {
	float: none !important;
	width: auto !important;
	grid-column: 1;
	grid-row: 1;
	align-self: start;
}

.product-page .woocommerce-product-gallery .woocommerce-product-gallery__wrapper {
	position: sticky;
	top: calc(var(--header-h) + 20px);
	border-radius: var(--radius);
	overflow: hidden;
}

.product-page .woocommerce-product-gallery img {
	width: 100%;
	border-radius: var(--radius);
	display: block;
}

/* summary column */
.product-page .summary.entry-summary {
	float: none !important;
	width: auto !important;
	clear: none !important;
	grid-column: 2;
	grid-row: 1;
	display: flex;
	flex-direction: column;
	gap: 0;
}

/* title */
.product-page .product_title {
	font-size: clamp(1.3rem, 2.3vw, 1.85rem);
	color: var(--primary);
	margin: 0 0 16px;
	line-height: 1.35;
}

/* price area */
.product-page .price {
	font-size: 2.2rem !important;
	font-weight: 900 !important;
	color: var(--primary) !important;
	margin: 0 0 4px !important;
	display: block;
}

.product-page .price ins { text-decoration: none; }
.product-page .price del { color: var(--text-light); font-size: 1.1rem; font-weight: 400; }

/* short description */
.product-page .woocommerce-product-details__short-description {
	font-size: .95rem;
	color: var(--text-mid);
	line-height: 1.7;
	margin-bottom: 16px;
	padding: 14px 16px;
	background: var(--bg);
	border-radius: var(--radius-sm);
	border-left: 3px solid var(--primary-light);
}

/* cart form — framed section */
.product-page form.cart {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 20px 0;
	border-top: 1px solid var(--border);
	border-bottom: 1px solid var(--border);
	margin: 16px 0;
}

/* add to cart button */
.product-page .single_add_to_cart_button {
	background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%) !important;
	color: white !important;
	border: none !important;
	border-radius: var(--radius) !important;
	padding: 16px 32px !important;
	font-size: 1.1rem !important;
	font-weight: 700 !important;
	font-family: inherit !important;
	width: 100%;
	cursor: pointer;
	transition: var(--transition) !important;
	box-shadow: 0 4px 16px rgba(30,58,110,.25);
	letter-spacing: .02em;
}
.product-page .single_add_to_cart_button:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 24px rgba(30,58,110,.35) !important;
}
.product-page .quantity { display: none; }

/* trust badges row — output via PHP hook */
.product-trust-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 8px;
}
.product-trust-badge {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: .82rem;
	font-weight: 600;
	color: var(--text-mid);
}
.product-trust-badge span.badge-icon { font-size: 1rem; }

/* tabs + related: span full width below the 2-col grid */
.product-page .woocommerce-tabs,
.product-page .related.products,
.product-page .upsells.products,
.product-page .woocommerce-notices-wrapper {
	grid-column: 1 / -1;
	clear: both;
}

/* related products heading */
.product-page .related h2,
.product-page .upsells h2 {
	font-size: 1.3rem;
	color: var(--primary);
	margin-bottom: 20px;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--border);
}

/* WooCommerce meta (category, tag, brand) — styled as pill chips */
.product-page .product_meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	font-size: .8rem;
	color: var(--text-light);
}
.product-page .product_meta .posted_in,
.product-page .product_meta .tagged_as,
.product-page .product_meta > span {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 5px;
}
.product-page .product_meta a {
	display: inline-block;
	padding: 3px 11px;
	background: var(--primary-pale);
	color: var(--primary-light);
	border-radius: 100px;
	font-size: .78rem;
	font-weight: 600;
	text-decoration: none;
	transition: var(--transition);
}
.product-page .product_meta a:hover { background: var(--primary); color: white; }
.product-page .product_meta .sku_wrapper { display: none; }

/* ============================================================
   CATEGORY CARDS — custom template (content-product-cat.php)
   ============================================================ */

ul.products li.product-category {
	background: var(--bg-card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden !important;
	transition: var(--transition);
	list-style: none;
	padding: 0 !important;
}
ul.products li.product-category:hover {
	box-shadow: 0 10px 40px rgba(30,58,110,.14);
	transform: translateY(-5px);
	border-color: var(--primary-border);
}

a.exam-cat-card-inner {
	display: flex !important;
	flex-direction: column;
	height: 100%;
	text-decoration: none !important;
	color: inherit !important;
	padding: 0;
}

/* ── Thumbnail: 3:2 ratio ──────────────────────────── */
.exam-cat-thumb {
	position: relative;
	width: 100%;
	padding-top: 66%;
	overflow: hidden;
	background: linear-gradient(135deg, var(--primary-pale) 0%, #dce8ff 100%);
	flex-shrink: 0;
}
.exam-cat-thumb img {
	position: absolute !important;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	object-fit: cover;
	object-position: center;
	display: block;
	transition: transform .4s ease;
	max-width: none !important;
}
ul.products li.product-category:hover .exam-cat-thumb img { transform: scale(1.05); }

.exam-cat-thumb-placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}
.exam-cat-icon-big { font-size: 4rem; }

.exam-cat-count-chip {
	position: absolute;
	bottom: 10px;
	left: 12px;
	background: rgba(255,255,255,.92);
	color: var(--primary);
	font-size: .75rem;
	font-weight: 700;
	padding: 3px 10px;
	border-radius: 100px;
	box-shadow: 0 2px 8px rgba(0,0,0,.12);
}

/* ── Body ──────────────────────────────────────────── */
.exam-cat-body {
	padding: 16px 18px 0;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.exam-cat-header {
	display: flex;
	align-items: center;
	gap: 8px;
}
.exam-cat-icon-sm { font-size: 1.2rem; flex-shrink: 0; }
.exam-cat-name {
	font-size: 1.05rem;
	font-weight: 800;
	color: var(--primary);
	line-height: 1.35;
	margin: 0;
}
.exam-cat-desc {
	font-size: .82rem;
	color: var(--text-light);
	line-height: 1.65;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.exam-cat-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 4px;
}
.exam-cat-pill {
	font-size: .7rem;
	font-weight: 700;
	color: var(--primary-light);
	background: var(--primary-pale);
	border-radius: 100px;
	padding: 2px 9px;
	white-space: nowrap;
}

/* ── Footer ────────────────────────────────────────── */
.exam-cat-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 18px 16px;
	margin-top: 12px;
}
.exam-cat-stat {
	font-size: .8rem;
	color: var(--text-light);
	font-weight: 600;
}
.btn-cat-view {
	display: inline-flex;
	align-items: center;
	padding: 8px 18px;
	background: var(--primary);
	color: white !important;
	border-radius: var(--radius-sm);
	font-size: .85rem;
	font-weight: 700;
	transition: var(--transition);
}
ul.products li.product-category:hover .btn-cat-view { background: var(--primary-light); }

/* kill pseudo-element button from old CSS / inline CSS */
ul.products li.product-category > a::after,
a.exam-cat-card-inner::after { content: none !important; display: none !important; }

/* ============================================================
   QMCA QUIZ SYSTEM — vivid colors, large text, clear UI
   ============================================================ */

/* ── Container ────────────────────────────────────────── */
.qmca-quiz-container {
	padding: 8px 0 28px;
}
.qmca-quiz-container > h2 {
	font-size: 1.15rem;
	font-weight: 800;
	color: var(--primary);
	margin: 0 0 18px;
	padding-bottom: 14px;
	border-bottom: 3px solid var(--primary);
	display: flex;
	align-items: center;
	gap: 8px;
}

/* ── Quiz set accordion ───────────────────────────────── */
.qmca-quiz-set {
	border: 2px solid var(--border);
	border-left: 4px solid var(--primary-light);
	border-radius: var(--radius);
	overflow: hidden;
	margin-bottom: 10px;
	background: white;
	transition: border-color .2s, box-shadow .2s;
}
.qmca-quiz-set:last-child { margin-bottom: 0; }
.qmca-quiz-set:hover { box-shadow: 0 4px 16px rgba(30,58,110,.1); }

/* Free set: green left border */
.qmca-quiz-set:has(.qmca-quiz-interface) {
	border-left-color: #16a34a;
}

/* ── Set header ───────────────────────────────────────── */
.qmca-quiz-set-header {
	cursor: pointer;
	user-select: none;
	background: #f8fafc;
	transition: background .15s;
}
.qmca-quiz-set-header:hover { background: #f1f5ff; }

.qmca-quiz-set-header h3 {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 20px;
	margin: 0;
	font-size: 1rem;
	font-weight: 700;
	color: var(--text);
	line-height: 1.4;
}

.qmca-toggle-icon {
	font-size: .72rem;
	color: var(--primary);
	flex-shrink: 0;
	transition: transform .2s;
}

.qmca-question-count {
	font-size: .78rem;
	font-weight: 600;
	color: var(--primary);
	background: var(--primary-pale);
	border-radius: 100px;
	padding: 3px 10px;
	white-space: nowrap;
}

/* Status badge */
.qmca-status {
	margin-left: auto;
	font-size: .8rem;
	font-weight: 700;
	white-space: nowrap;
	padding: 4px 12px;
	border-radius: 100px;
	background: #dcfce7;
	color: #15803d;
}

/* Locked status: amber */
.qmca-quiz-set:has(.qmca-locked) .qmca-status {
	background: #fef3c7;
	color: #b45309;
}

/* ── Set content ──────────────────────────────────────── */
.qmca-quiz-set-content {
	border-top: 2px solid var(--border);
}

/* ── Mode selector (pre-start) ────────────────────────── */
.qmca-quiz-interface { padding: 24px 22px; }

.qmca-quiz-options h4 {
	font-size: .95rem;
	font-weight: 700;
	color: var(--text);
	margin: 0 0 12px;
}
.qmca-quiz-options {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 20px;
}

.qmca-option-radio {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 13px 16px;
	border: 2px solid var(--border);
	border-radius: var(--radius);
	cursor: pointer;
	background: white;
	font-size: .95rem;
	font-weight: 500;
	color: var(--text);
	transition: border-color .15s, background .15s, box-shadow .15s;
}
.qmca-option-radio:hover {
	border-color: var(--primary);
	background: var(--primary-pale);
	box-shadow: 0 2px 8px rgba(30,58,110,.1);
}
.qmca-option-radio input[type="radio"] {
	accent-color: var(--primary);
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

/* Start button */
button.qmca-start-quiz,
.qmca-start-quiz {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 15px 28px;
	background: linear-gradient(135deg, #1e3a6e 0%, #2563eb 100%);
	color: white;
	border: none;
	border-radius: var(--radius);
	font-size: 1.05rem;
	font-weight: 800;
	font-family: inherit;
	cursor: pointer;
	transition: var(--transition);
	box-shadow: 0 6px 20px rgba(30,58,110,.3);
	letter-spacing: .02em;
	text-decoration: none;
}
button.qmca-start-quiz:hover,
.qmca-start-quiz:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 28px rgba(30,58,110,.4);
	color: white;
}

/* ── Locked set ───────────────────────────────────────── */
.qmca-locked {
	padding: 24px 22px;
	text-align: center;
	background: #fafbff;
}
.qmca-locked p {
	color: var(--text-light);
	font-size: .95rem;
	margin-bottom: 16px;
}
.qmca-locked a {
	display: inline-block;
	padding: 12px 32px;
	background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
	color: white;
	border-radius: var(--radius);
	font-weight: 800;
	text-decoration: none;
	font-size: .95rem;
	transition: var(--transition);
	box-shadow: 0 4px 14px rgba(245,158,11,.35);
}
.qmca-locked a:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 20px rgba(245,158,11,.5);
	color: white;
}

/* ── Loading & error ──────────────────────────────────── */
.qmca-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	padding: 48px 24px;
	color: var(--text-mid);
	text-align: center;
	font-size: 1rem;
}
.qmca-spinner {
	width: 40px;
	height: 40px;
	border: 4px solid #dbeafe;
	border-top-color: #2563eb;
	border-radius: 50%;
	animation: qmca-spin .7s linear infinite;
}
@keyframes qmca-spin { to { transform: rotate(360deg); } }

.qmca-error { padding: 28px 22px; text-align: center; color: #dc2626; }
.qmca-error p { margin-bottom: 14px; font-size: 1rem; }
button.qmca-retry-load {
	padding: 10px 24px;
	background: white;
	border: 2px solid var(--border);
	border-radius: var(--radius-sm);
	cursor: pointer;
	font-family: inherit;
	font-size: .95rem;
	color: var(--text-mid);
	transition: var(--transition);
}
button.qmca-retry-load:hover { border-color: var(--primary); color: var(--primary); }

/* ── Active quiz ──────────────────────────────────────── */
.qmca-question-container {
	padding: 24px 22px;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

/* Progress bar — thicker, vivid */
.qmca-progress {
	display: flex;
	align-items: center;
	gap: 14px;
	font-size: .88rem;
	color: var(--primary);
	font-weight: 700;
}
.qmca-progress-bar {
	flex: 1;
	height: 10px;
	background: #e2e8f0;
	border-radius: 100px;
	overflow: hidden;
}
.qmca-progress-fill {
	height: 100%;
	background: linear-gradient(90deg, #1e3a6e 0%, #2563eb 50%, #38bdf8 100%);
	border-radius: 100px;
	transition: width .4s cubic-bezier(.4,0,.2,1);
	box-shadow: 0 0 8px rgba(37,99,235,.4);
}

/* Question text — bigger, bolder */
.qmca-question {
	background: #f0f7ff;
	border-left: 5px solid #2563eb;
	border-radius: 0 var(--radius) var(--radius) 0;
	padding: 18px 20px;
}
.qmca-question h4 {
	font-size: 1.1rem;
	font-weight: 700;
	color: #1e293b;
	line-height: 1.75;
	margin: 0;
}

/* Answer options — larger, vivid hover/selected */
.qmca-options {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

label.qmca-option {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 14px 18px;
	border: 2px solid #e2e8f0;
	border-radius: var(--radius);
	cursor: pointer;
	background: white;
	font-size: 1rem;
	color: #1e293b;
	transition: border-color .15s, background .15s, box-shadow .15s;
	line-height: 1.65;
	box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
label.qmca-option:hover {
	border-color: #2563eb;
	background: #eff6ff;
	box-shadow: 0 2px 10px rgba(37,99,235,.12);
}
label.qmca-option input[type="radio"] {
	margin-top: 3px;
	accent-color: #2563eb;
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}
label.qmca-option:has(input:checked) {
	border-color: #2563eb;
	background: #2563eb;
	color: white;
	box-shadow: 0 4px 14px rgba(37,99,235,.3);
}
label.qmca-option:has(input:checked) .qmca-option-label {
	color: white;
}
label.qmca-option.disabled-option {
	cursor: default;
	pointer-events: none;
}
/* Correct option after submit */
label.qmca-option.correct-answer {
	border-color: #16a34a !important;
	background: #16a34a !important;
	color: white !important;
}
label.qmca-option.correct-answer .qmca-option-label { color: white !important; }
/* Wrong selected option */
label.qmca-option.wrong-answer {
	border-color: #dc2626 !important;
	background: #dc2626 !important;
	color: white !important;
}
label.qmca-option.wrong-answer .qmca-option-label { color: white !important; }

.qmca-option-label {
	font-size: 1rem;
	font-weight: 800;
	color: #2563eb;
	flex-shrink: 0;
	min-width: 28px;
	transition: color .15s;
}
.qmca-option-text { flex: 1; }

/* Navigation buttons — bigger */
.qmca-navigation {
	display: flex;
	gap: 12px;
	padding-top: 4px;
}
button.qmca-prev-question,
button.qmca-next-question,
button.qmca-submit-quiz {
	padding: 13px 28px;
	border-radius: var(--radius);
	font-family: inherit;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	border: none;
	transition: var(--transition);
	letter-spacing: .01em;
}
button.qmca-prev-question {
	background: white;
	color: var(--text-mid);
	border: 2px solid #cbd5e1;
}
button.qmca-prev-question:hover { border-color: var(--primary); color: var(--primary); }
button.qmca-next-question {
	margin-left: auto;
	background: linear-gradient(135deg, #1e3a6e 0%, #2563eb 100%);
	color: white;
	box-shadow: 0 4px 14px rgba(37,99,235,.3);
}
button.qmca-next-question:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 20px rgba(37,99,235,.4);
}
button.qmca-submit-quiz {
	margin-left: auto;
	background: linear-gradient(135deg, #15803d 0%, #16a34a 100%);
	color: white;
	box-shadow: 0 4px 14px rgba(22,163,74,.3);
}
button.qmca-submit-quiz:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 20px rgba(22,163,74,.45);
}

/* ── Immediate feedback ───────────────────────────────── */
.qmca-immediate-feedback {
	margin-top: 14px;
	padding: 18px 20px;
	border-radius: var(--radius);
	border-left: 6px solid;
	font-size: .95rem;
	line-height: 1.6;
}
.qmca-immediate-feedback.correct {
	background: #f0fdf4;
	border-color: #16a34a;
	color: #14532d;
}
.qmca-immediate-feedback.incorrect {
	background: #fef2f2;
	border-color: #dc2626;
	color: #7f1d1d;
}
.qmca-feedback-icon {
	font-size: 1.1rem;
	font-weight: 800;
	margin-bottom: 10px;
}
.qmca-explanation {
	margin-top: 10px;
	padding: 12px 16px;
	background: rgba(255,255,255,.75);
	border-radius: var(--radius-sm);
	font-size: .92rem;
	line-height: 1.7;
	border-left: 3px solid currentColor;
}
.qmca-analysis-keywords,
.qmca-analysis-memory {
	margin-top: 8px;
	padding: 10px 14px;
	background: rgba(255,255,255,.6);
	border-radius: var(--radius-sm);
	font-size: .88rem;
	line-height: 1.65;
}

/* ── Results ──────────────────────────────────────────── */
.qmca-results { padding: 24px 22px; }

.qmca-score {
	text-align: center;
	padding: 36px 24px;
	background: linear-gradient(135deg, #1e3a6e 0%, #2563eb 60%, #38bdf8 100%);
	border-radius: var(--radius);
	color: white;
	margin-bottom: 28px;
	box-shadow: 0 8px 32px rgba(37,99,235,.35);
}
.qmca-score h3 {
	font-size: 1.05rem;
	font-weight: 600;
	opacity: .85;
	margin: 0 0 10px;
	color: white;
	letter-spacing: .04em;
	text-transform: uppercase;
}
.qmca-score-big {
	font-size: 5rem;
	font-weight: 900;
	line-height: 1;
	margin-bottom: 10px;
	color: white;
	text-shadow: 0 2px 16px rgba(0,0,0,.2);
}
.qmca-score p { opacity: .9; margin: 4px 0 0; font-size: 1.05rem; color: white; }

.qmca-results-details h4 {
	font-size: 1.05rem;
	font-weight: 800;
	color: var(--primary);
	margin: 0 0 14px;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--primary-border);
}

.qmca-result-item {
	border: 2px solid #e2e8f0;
	border-radius: var(--radius);
	overflow: hidden;
	margin-bottom: 10px;
	transition: box-shadow .15s;
}
.qmca-result-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.qmca-result-item.correct { border-color: #16a34a; }
.qmca-result-item.incorrect { border-color: #dc2626; }

.qmca-result-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 16px;
	font-size: .88rem;
	font-weight: 700;
}
.qmca-result-item.correct  .qmca-result-header { background: #dcfce7; color: #14532d; }
.qmca-result-item.incorrect .qmca-result-header { background: #fee2e2; color: #7f1d1d; }

.qmca-result-body {
	padding: 12px 16px;
	font-size: .92rem;
	color: var(--text-mid);
	line-height: 1.65;
}
.qmca-result-question { font-weight: 700; color: #1e293b; margin-bottom: 8px; font-size: .95rem; }

.qmca-wrong-ans {
	display: inline-block;
	color: white;
	font-weight: 700;
	background: #dc2626;
	padding: 2px 10px;
	border-radius: 6px;
	font-size: .88rem;
}
.qmca-right-ans {
	display: inline-block;
	color: white;
	font-weight: 700;
	background: #16a34a;
	padding: 2px 10px;
	border-radius: 6px;
	font-size: .88rem;
}

.qmca-retry { margin-top: 24px; text-align: center; }
button.qmca-retry-quiz {
	padding: 14px 36px;
	background: linear-gradient(135deg, #1e3a6e 0%, #2563eb 100%);
	color: white;
	border: none;
	border-radius: var(--radius);
	font-family: inherit;
	font-size: 1.05rem;
	font-weight: 800;
	cursor: pointer;
	transition: var(--transition);
	box-shadow: 0 6px 20px rgba(37,99,235,.3);
	letter-spacing: .02em;
}
button.qmca-retry-quiz:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 28px rgba(37,99,235,.45);
}

/* responsive — single column on tablet */
@media (max-width: 860px) {
	.product-page div.product {
		grid-template-columns: 1fr;
	}
	.product-page .woocommerce-product-gallery {
		position: static;
		grid-column: 1;
	}
	.product-page .summary.entry-summary {
		grid-column: 1;
	}
}

.product-breadcrumb {
	padding: 16px 0;
	font-size: .85rem;
	color: var(--text-light);
	border-bottom: 1px solid var(--border);
	margin-bottom: 32px;
}

.product-breadcrumb a { color: var(--primary-light); }
.product-breadcrumb span { margin: 0 6px; }

.product-layout {
	display: grid;
	grid-template-columns: 340px 1fr;
	gap: 40px;
	align-items: start;
	margin-bottom: 48px;
}

/* Product Image Panel */
.product-image-panel {
	position: sticky;
	top: calc(var(--header-h) + 20px);
}

.product-image-wrap {
	background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 100%);
	border-radius: var(--radius);
	aspect-ratio: 4/3;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	margin-bottom: 16px;
}

.product-image-wrap img { width: 100%; height: 100%; object-fit: cover; }
.product-image-placeholder { font-size: 5rem; opacity: .35; }

/* Product Info Panel */
.product-info-panel { }

.product-category-link {
	display: inline-block;
	background: var(--primary-pale);
	color: var(--primary-light);
	padding: 4px 12px;
	border-radius: 50px;
	font-size: .78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	margin-bottom: 12px;
}

.product-title {
	font-size: clamp(1.4rem, 3vw, 2rem);
	color: var(--primary);
	line-height: 1.3;
	margin-bottom: 16px;
}

.product-rating-row {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
	flex-wrap: wrap;
}

.product-badges {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 20px;
}

.product-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 5px 12px;
	border-radius: 50px;
	font-size: .82rem;
	font-weight: 600;
	border: 1px solid;
}

.product-badge.badge-questions {
	background: var(--primary-pale);
	color: var(--primary);
	border-color: var(--primary-border);
}

.product-badge.badge-sets {
	background: var(--success-pale);
	color: var(--success);
	border-color: #b2dfb9;
}

.product-badge.badge-free {
	background: #fff8e1;
	color: #e65100;
	border-color: #ffe082;
}

.product-short-desc {
	font-size: .95rem;
	color: var(--text-mid);
	line-height: 1.7;
	margin-bottom: 24px;
	padding: 16px;
	background: var(--bg);
	border-radius: var(--radius-sm);
	border-left: 3px solid var(--primary-light);
}

.product-price-box {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-bottom: 24px;
	flex-wrap: wrap;
}

.product-price-main {
	font-size: 2.4rem;
	font-weight: 900;
	color: var(--primary);
}
.product-price-main.is-free { color: var(--success); }
.product-price-unit { font-size: 1rem; font-weight: 400; color: var(--text-light); }

.btn-add-to-cart {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 16px 32px;
	background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
	color: white;
	border: none;
	border-radius: var(--radius);
	font-size: 1.1rem;
	font-weight: 700;
	font-family: inherit;
	transition: var(--transition);
	margin-bottom: 12px;
	box-shadow: 0 4px 16px rgba(30,58,110,.25);
}

.btn-add-to-cart:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 24px rgba(30,58,110,.35);
	color: white;
}

.btn-try-free {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 13px 32px;
	background: white;
	color: var(--primary);
	border: 2px solid var(--primary-border);
	border-radius: var(--radius);
	font-size: 1rem;
	font-weight: 700;
	font-family: inherit;
	transition: var(--transition);
}
.btn-try-free:hover { background: var(--primary-pale); color: var(--primary); }

/* Product Tabs */
.product-tabs-section { margin-top: 40px; }

.woocommerce-tabs .tabs {
	display: flex;
	gap: 0;
	border-bottom: 2px solid var(--border);
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.woocommerce-tabs .tabs li a {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 13px 24px;
	font-weight: 600;
	font-size: .95rem;
	color: var(--text-mid);
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	white-space: nowrap;
	transition: var(--transition);
}

.woocommerce-tabs .tabs li.active a,
.woocommerce-tabs .tabs li a:hover {
	color: var(--primary);
	border-bottom-color: var(--primary);
}

.woocommerce-tabs .panel { padding: 32px 0; }

/* ============================================================
   QUIZ TAB (QMCA Plugin Integration)
   ============================================================ */
.qmca-quiz-container { }
.qmca-quiz-container h2 { font-size: 1.2rem; color: var(--primary); margin-bottom: 20px; }

.qmca-quiz-set {
	background: white;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	margin-bottom: 12px;
	overflow: hidden;
	transition: var(--transition);
}

.qmca-quiz-set:hover { box-shadow: var(--shadow-sm); }

.qmca-quiz-set-header {
	padding: 0;
	cursor: pointer;
}

.qmca-quiz-set-header h3 {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px 20px;
	font-size: .95rem;
	font-weight: 600;
	color: var(--text);
	margin: 0;
	user-select: none;
}

.qmca-quiz-set-header h3:hover { background: var(--bg); }
.qmca-toggle-icon { color: var(--primary-light); font-size: .85rem; }
.qmca-question-count { color: var(--text-light); font-size: .82rem; font-weight: 400; }
.qmca-status { margin-left: auto; font-size: .85rem; }

.qmca-quiz-set-content { border-top: 1px solid var(--border); padding: 20px; }

.qmca-quiz-options { margin-bottom: 16px; }
.qmca-quiz-options h4 { font-size: .9rem; color: var(--text-mid); margin-bottom: 10px; }

.qmca-option-radio {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 9px 14px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	cursor: pointer;
	margin-bottom: 6px;
	font-size: .9rem;
	color: var(--text-mid);
	transition: var(--transition);
}

.qmca-option-radio:has(input:checked) {
	border-color: var(--primary-light);
	background: var(--primary-pale);
	color: var(--primary);
}

.qmca-start-quiz {
	background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
	color: white;
	border: none;
	padding: 11px 28px;
	border-radius: var(--radius-sm);
	font-size: .95rem;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	transition: var(--transition);
}
.qmca-start-quiz:hover { opacity: .9; }

.qmca-locked {
	text-align: center;
	padding: 20px;
}
.qmca-locked p { color: var(--text-light); margin-bottom: 12px; }
.qmca-locked .button {
	background: var(--primary);
	color: white;
	padding: 10px 24px;
	border-radius: var(--radius-sm);
	font-weight: 700;
	display: inline-block;
}

/* Quiz interface */
.qmca-quiz-interface { }
.qmca-question-wrap {
	background: white;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 24px;
	margin-bottom: 16px;
}

.qmca-question-number {
	font-size: .8rem;
	font-weight: 700;
	color: var(--primary-light);
	text-transform: uppercase;
	letter-spacing: .05em;
	margin-bottom: 10px;
}

.qmca-question-text {
	font-size: 1.05rem;
	font-weight: 600;
	color: var(--text);
	line-height: 1.6;
	margin-bottom: 20px;
}

.qmca-options { display: flex; flex-direction: column; gap: 8px; }

.qmca-option {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 12px 16px;
	border: 2px solid var(--border);
	border-radius: var(--radius-sm);
	cursor: pointer;
	font-size: .95rem;
	transition: var(--transition);
	background: white;
}

.qmca-option:hover { border-color: var(--primary-border); background: var(--primary-pale); }
.qmca-option.selected { border-color: var(--primary-light); background: var(--primary-pale); }
.qmca-option.correct   { border-color: var(--success); background: var(--success-pale); }
.qmca-option.wrong     { border-color: var(--danger); background: #fde8e8; }

.qmca-option-letter {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--border);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: .8rem;
	font-weight: 700;
	flex-shrink: 0;
}

/* ============================================================
   VIDEO TAB
   ============================================================ */
.qmca-video-tab h2 { font-size: 1.2rem; color: var(--primary); margin-bottom: 20px; }
.qmca-video-wrapper {
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: var(--shadow);
}

/* ============================================================
   MY ACCOUNT / DASHBOARD
   ============================================================ */
.account-page {
	padding: 40px 0 64px;
}

/* wider than standard .container — full width with padding */
.account-page > .container {
	max-width: 1440px;
	padding: 0 40px;
}

.account-layout {
	display: grid;
	grid-template-columns: 260px 1fr;
	gap: 32px;
	align-items: start;
}

/* Account Sidebar */
.account-sidebar {
	position: sticky;
	top: calc(var(--header-h) + 20px);
}

.account-avatar-box {
	background: white;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 24px;
	text-align: center;
	margin-bottom: 12px;
}

.account-avatar {
	width: 72px;
	height: 72px;
	background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 12px;
	font-size: 2rem;
	color: white;
}

.account-name { font-size: 1rem; font-weight: 700; color: var(--primary); }
.account-email { font-size: .8rem; color: var(--text-light); margin-top: 2px; }

.account-nav {
	background: white;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
}

.account-nav a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 18px;
	font-size: .9rem;
	font-weight: 600;
	color: var(--text-mid);
	border-left: 3px solid transparent;
	transition: var(--transition);
}

.account-nav a:hover,
.account-nav .is-active { color: var(--primary); border-left-color: var(--primary); background: var(--primary-pale); }
.account-nav li:not(:last-child) a { border-bottom: 1px solid var(--border); }

/* Account Content */
.account-content { }

.account-content-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 24px;
	flex-wrap: wrap;
	gap: 12px;
}

.account-content-header h2 { font-size: 1.3rem; color: var(--primary); }

/* Purchased Exams Grid */
.purchased-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
}

.purchased-card {
	background: white;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	transition: var(--transition);
}

.purchased-card:hover { box-shadow: var(--shadow); }

.purchased-card-header {
	background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 100%);
	padding: 20px;
	color: white;
}

.purchased-card-header h3 { font-size: 1rem; color: white; margin-bottom: 6px; line-height: 1.4; }
.purchased-card-header .date { font-size: .78rem; opacity: .75; }

.purchased-card-body { padding: 16px; }

.progress-label {
	display: flex;
	justify-content: space-between;
	font-size: .82rem;
	color: var(--text-mid);
	margin-bottom: 6px;
}

.progress-bar {
	height: 6px;
	background: var(--border);
	border-radius: 3px;
	overflow: hidden;
	margin-bottom: 14px;
}

.progress-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
	border-radius: 3px;
	transition: width .5s ease;
}

.purchased-stats {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin-bottom: 14px;
}

.p-stat {
	background: var(--bg);
	border-radius: var(--radius-sm);
	padding: 8px;
	text-align: center;
}

.p-stat-num { font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.p-stat-label { font-size: .72rem; color: var(--text-light); }

.btn-goto-exam {
	display: block;
	text-align: center;
	background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
	color: white;
	padding: 10px;
	border-radius: var(--radius-sm);
	font-weight: 700;
	font-size: .9rem;
	transition: var(--transition);
}
.btn-goto-exam:hover { opacity: .9; color: white; }

/* WooCommerce Account default styles */
.woocommerce-account .woocommerce { width: 100%; }

/* ============================================================
   BREADCRUMB
   ============================================================ */
.woocommerce-breadcrumb {
	font-size: .85rem;
	color: var(--text-light);
	padding: 14px 0;
}
.woocommerce-breadcrumb a { color: var(--primary-light); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
	background: var(--primary);
	color: rgba(255,255,255,.85);
	padding: 56px 0 0;
}

.footer-grid {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr 1fr;
	gap: 40px;
	padding-bottom: 40px;
}

.footer-brand .logo-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 14px;
}

.footer-brand .logo-icon {
	background: rgba(255,255,255,.15);
	color: white;
}

.footer-brand .logo-name { font-size: 1.1rem; font-weight: 800; color: white; }

.footer-brand p {
	font-size: .88rem;
	line-height: 1.7;
	color: rgba(255,255,255,.65);
	max-width: 280px;
}

.footer-col h4 {
	font-size: .9rem;
	font-weight: 700;
	color: white;
	margin-bottom: 16px;
	letter-spacing: .04em;
}

.footer-col ul { display: flex; flex-direction: column; gap: 8px; }

.footer-col a {
	font-size: .88rem;
	color: rgba(255,255,255,.65);
	transition: var(--transition);
}
.footer-col a:hover { color: white; }

.footer-bottom {
	border-top: 1px solid rgba(255,255,255,.1);
	padding: 20px 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
}

.footer-bottom p { font-size: .82rem; color: rgba(255,255,255,.5); }

/* ============================================================
   ALERTS & NOTICES
   ============================================================ */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
	padding: 14px 20px;
	border-radius: var(--radius-sm);
	margin-bottom: 20px;
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: .9rem;
}

.woocommerce-message { background: var(--success-pale); color: #155724; border-left: 4px solid var(--success); }
.woocommerce-info    { background: var(--primary-pale); color: var(--primary); border-left: 4px solid var(--primary-light); }
.woocommerce-error   { background: #fde8e8; color: #721c24; border-left: 4px solid var(--danger); }

/* ============================================================
   UTILITY
   ============================================================ */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-4 { margin-bottom: 1rem; }
.hidden { display: none; }

.loading-spinner {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 2px solid rgba(255,255,255,.3);
	border-top-color: white;
	border-radius: 50%;
	animation: spin .7s linear infinite;
}

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

/* ============================================================
   SINGLE POST (single.php)
   ============================================================ */

.single-post-wrap {
	padding: 40px 0 64px;
}

.single-post-article {
	max-width: 780px;
	margin: 0 auto;
}

/* Header */
.single-post-header {
	margin-bottom: 28px;
}

.single-post-cat-chip {
	display: inline-block;
	background: var(--primary-pale);
	color: var(--primary);
	font-size: .78rem;
	font-weight: 700;
	padding: 4px 12px;
	border-radius: 100px;
	letter-spacing: .03em;
	text-transform: uppercase;
	text-decoration: none;
	margin-bottom: 14px;
	transition: background .15s, color .15s;
}
.single-post-cat-chip:hover {
	background: var(--primary);
	color: white;
}

.single-post-title {
	font-size: 1.75rem;
	font-weight: 800;
	color: var(--primary);
	line-height: 1.4;
	margin: 0 0 14px;
}

.single-post-meta {
	display: flex;
	align-items: center;
	gap: 16px;
	font-size: .85rem;
	color: var(--text-light);
	flex-wrap: wrap;
}

/* Featured image */
.single-post-thumb {
	border-radius: var(--radius);
	overflow: hidden;
	margin-bottom: 36px;
	box-shadow: 0 4px 24px rgba(30,58,110,.1);
}
.single-post-thumb img {
	width: 100%;
	height: auto;
	display: block;
}

/* Content */
.single-post-content {
	font-size: 1rem;
	line-height: 1.85;
	color: var(--text);
}
.single-post-content h2,
.single-post-content h3,
.single-post-content h4 {
	color: var(--primary);
	font-weight: 700;
	margin: 1.6em 0 .6em;
	line-height: 1.4;
}
.single-post-content h2 { font-size: 1.35rem; }
.single-post-content h3 { font-size: 1.15rem; }
.single-post-content h4 { font-size: 1rem; }
.single-post-content p  { margin-bottom: 1.25em; }
.single-post-content a  { color: var(--primary-light); text-decoration: underline; }
.single-post-content a:hover { color: var(--primary); }
.single-post-content ul,
.single-post-content ol {
	padding-left: 1.5em;
	margin-bottom: 1.25em;
}
.single-post-content li { margin-bottom: .4em; }
.single-post-content blockquote {
	border-left: 4px solid var(--primary-light);
	margin: 1.5em 0;
	padding: 14px 20px;
	background: var(--primary-pale);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	color: var(--text-mid);
	font-style: italic;
}
.single-post-content img {
	max-width: 100%;
	height: auto;
	border-radius: var(--radius-sm);
	display: block;
	margin: 1em auto;
}
.single-post-content table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 1.5em;
	font-size: .92rem;
}
.single-post-content th,
.single-post-content td {
	padding: 10px 14px;
	border: 1px solid var(--border);
	text-align: left;
}
.single-post-content th {
	background: var(--primary);
	color: white;
	font-weight: 700;
}
.single-post-content tr:nth-child(even) td { background: var(--bg); }

/* Back button */
.single-post-back {
	margin-top: 48px;
	padding-top: 24px;
	border-top: 1px solid var(--border);
}
.btn-back-cat {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 11px 22px;
	background: white;
	border: 1.5px solid var(--border);
	border-radius: var(--radius);
	font-size: .92rem;
	font-weight: 700;
	color: var(--primary);
	text-decoration: none;
	transition: var(--transition);
}
.btn-back-cat:hover {
	border-color: var(--primary);
	background: var(--primary-pale);
}

/* Mobile */
@media (max-width: 768px) {
	.single-post-title { font-size: 1.3rem; }
	.single-post-wrap  { padding: 24px 0 48px; }
	.single-post-content { font-size: .95rem; }
}

/* ============================================================
   BLOG ARCHIVE (category.php)
   ============================================================ */

.blog-archive-wrap {
	padding: 40px 0 64px;
}

/* ── Post grid ─────────────────────────────────────────── */
.blog-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 24px;
}

/* ── Post card ─────────────────────────────────────────── */
.blog-card {
	background: white;
	border: 1.5px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: box-shadow .2s, transform .2s;
}
.blog-card:hover {
	box-shadow: 0 8px 32px rgba(30,58,110,.12);
	transform: translateY(-3px);
}

/* Thumbnail */
.blog-card-thumb {
	display: block;
	position: relative;
	width: 100%;
	padding-top: 56.25%;
	overflow: hidden;
	background: linear-gradient(135deg, var(--primary) 0%, var(--primary-mid) 100%);
}
.blog-card-thumb img {
	position: absolute !important;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	object-fit: cover;
	transition: transform .35s ease;
}
.blog-card:hover .blog-card-thumb img { transform: scale(1.05); }

.blog-card-thumb--empty {
	display: flex;
	align-items: center;
	justify-content: center;
}
.blog-thumb-placeholder-icon {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 3.5rem;
	opacity: .35;
}

/* Body */
.blog-card-body {
	padding: 18px 20px 0;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.blog-card-meta {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}
.blog-cat-chip {
	display: inline-block;
	background: var(--primary-pale);
	color: var(--primary);
	font-size: .72rem;
	font-weight: 700;
	padding: 3px 10px;
	border-radius: 100px;
	letter-spacing: .02em;
	text-transform: uppercase;
}
.blog-card-date {
	font-size: .78rem;
	color: var(--text-light);
	font-weight: 500;
}

.blog-card-title {
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.55;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.blog-card-title a {
	color: var(--primary);
	text-decoration: none;
	transition: color .15s;
}
.blog-card-title a:hover { color: var(--primary-light); }

.blog-card-excerpt {
	font-size: .88rem;
	color: var(--text-mid);
	line-height: 1.65;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Footer */
.blog-card-footer {
	padding: 14px 20px 18px;
	margin-top: auto;
	border-top: 1px solid var(--border);
}
.blog-read-more {
	font-size: .88rem;
	font-weight: 700;
	color: var(--primary);
	text-decoration: none;
	transition: color .15s, gap .15s;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}
.blog-read-more:hover { color: var(--primary-light); gap: 8px; }

/* ── Pagination ───────────────────────────────────────── */
.blog-pagination {
	margin-top: 48px;
	display: flex;
	justify-content: center;
}
.blog-pagination .nav-links {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}
.blog-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border-radius: var(--radius-sm);
	border: 1.5px solid var(--border);
	font-size: .9rem;
	font-weight: 600;
	color: var(--text-mid);
	text-decoration: none;
	background: white;
	transition: var(--transition);
}
.blog-pagination .page-numbers:hover { border-color: var(--primary); color: var(--primary); }
.blog-pagination .page-numbers.current {
	background: var(--primary);
	border-color: var(--primary);
	color: white;
}
.blog-pagination .page-numbers.dots { border: none; background: none; }

/* ── Empty state ──────────────────────────────────────── */
.blog-empty {
	text-align: center;
	padding: 80px 0;
}
.blog-empty-icon { font-size: 4rem; margin-bottom: 16px; }
.blog-empty h2 { font-size: 1.3rem; color: var(--primary); margin-bottom: 8px; }
.blog-empty p  { color: var(--text-light); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Large tablet */
@media (max-width: 1100px) {
	.footer-grid    { grid-template-columns: 1.5fr 1fr 1fr; }
	.shop-layout    { grid-template-columns: 210px 1fr; gap: 20px; }
	.product-layout { grid-template-columns: 260px 1fr; gap: 24px; }
	ul.products,
	.products-grid  { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)) !important; gap: 16px !important; }
}

/* Tablet */
@media (max-width: 900px) {
	.main-nav    { display: none; }
	.header-actions .btn-login,
	.header-actions .btn-register { display: none; }
	.mobile-menu-toggle { display: flex; }
	.steps-grid  { grid-template-columns: 1fr; gap: 24px; }
	.steps-grid::before { display: none; }
	.account-layout  { grid-template-columns: 1fr; }
	.account-sidebar { position: static; }
	.account-page > .container { padding: 0 24px; }
	.footer-grid { grid-template-columns: 1fr 1fr; }
	ul.products,
	.products-grid { grid-template-columns: repeat(3, 1fr) !important; }
	.blog-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile landscape */
@media (max-width: 768px) {
	:root { --header-h: 68px; }
	.container { padding: 0 16px; }
	.hero { padding: 48px 0 56px; }
	.section { padding: 44px 0; }
	.stats-grid { grid-template-columns: repeat(2, 1fr); }
	.stat-item:nth-child(2) { border-right: none; }
	.stat-item:nth-child(3) { border-top: 1px solid var(--border); border-right: 1px solid var(--border); }
	.stat-item:nth-child(4) { border-top: 1px solid var(--border); }
	.shop-layout  { grid-template-columns: 1fr; padding-top: 20px; }
	.shop-sidebar { display: none; }
	.product-layout { grid-template-columns: 1fr; }
	.product-image-panel { position: static; }
	.category-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
	ul.products,
	.products-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
	/* smaller card text on mobile */
	.exam-card-title { font-size: .88rem; }
	.exam-card-body  { padding: 10px 12px 0; }
	.exam-card-footer { padding: 8px 12px; }
	.btn-buy { padding: 6px 12px; font-size: .78rem; }
	/* archive header */
	.archive-page-header { padding: 20px 0 24px; }
	.archive-header-body { flex-direction: column; gap: 12px; }
	.archive-cat-icon { width: 52px; height: 52px; font-size: 1.7rem; }
	.archive-page-header h1 { font-size: 1.3rem; }
	/* blog grid */
	.blog-grid { grid-template-columns: 1fr; gap: 16px; }
	.blog-archive-wrap { padding: 24px 0 48px; }
	/* page */
	.page-content-wrap { padding: 28px 0 48px; }
	.account-page { padding: 24px 0 48px; }
	.account-page > .container { padding: 0 16px; }
}

/* Mobile portrait */
@media (max-width: 480px) {
	.hero-search { flex-direction: column; }
	.hero-search input,
	.hero-search button { border-radius: var(--radius-sm); width: 100%; }
	.stats-grid  { grid-template-columns: 1fr 1fr; }
	.footer-grid { grid-template-columns: 1fr; }
	ul.products,
	.products-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
	.purchased-grid { grid-template-columns: 1fr; }
	.footer-bottom { flex-direction: column; text-align: center; }
}

/* Mobile nav overlay */
.mobile-nav-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.5);
	z-index: 900;
}

.mobile-nav {
	position: fixed;
	top: 0; left: -100%;
	width: 280px;
	height: 100%;
	background: white;
	z-index: 1001;
	transition: left .3s ease;
	overflow-y: auto;
	box-shadow: var(--shadow-lg);
	padding: 20px;
}

.mobile-nav.is-open { left: 0; }
.mobile-nav-overlay.is-open { display: block; }

.mobile-nav-close {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 20px;
}

.mobile-nav-close button {
	background: none;
	border: none;
	font-size: 1.5rem;
	color: var(--text-mid);
	padding: 4px;
}

.mobile-nav ul { display: flex; flex-direction: column; }
.mobile-nav a {
	display: block;
	padding: 13px 4px;
	font-size: 1rem;
	font-weight: 600;
	color: var(--text-mid);
	border-bottom: 1px solid var(--border);
}

.mobile-nav a:hover { color: var(--primary); }

.mobile-nav .mobile-nav-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 20px;
}

/* Print styles */
@media print { .site-header, .site-footer, .shop-sidebar { display: none; } }
