/* BookNest — Kobo.com inspired theme layer */

:root {
	--color-primary: #bf0000;
	--color-primary-hover: #a30000;
	--color-accent: #bf0000;
	--color-dark: #1a1a1a;
	--color-text: #333333;
	--color-muted: #666666;
	--color-bg: #ffffff;
	--color-surface: #ffffff;
	--color-border: #e5e5e5;
	--color-utility-bg: #f7f7f7;
	--color-hero: #1f4d3a;
	--color-section-muted: #f3f3f3;
	--radius: 8px;
	--font-heading: "Source Serif 4", Georgia, "Times New Roman", serif;
	--font-ui: "Inter", system-ui, -apple-system, sans-serif;
	--font-body: var(--font-ui);
	--shadow-sm: none;
	--shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
	--header-h: auto;
}

body {
	font-family: var(--font-ui);
	color: var(--color-text);
	background: var(--color-bg);
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-ui);
	font-weight: 600;
	color: var(--color-dark);
}

/* Header */
.kobo-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: #fff;
	border-bottom: 1px solid var(--color-border);
	box-shadow: none;
}

.booknest-dark .kobo-header {
	background: #111;
}

.header-utility {
	background: var(--color-utility-bg);
	border-bottom: 1px solid var(--color-border);
	font-size: 0.8125rem;
}

.header-utility__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.4rem 0;
	color: var(--color-muted);
}

.header-utility__links {
	display: flex;
	gap: 1.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.header-utility__links a {
	color: inherit;
}

.header-main__inner {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 1.5rem;
	padding: 0.85rem 0;
}

.site-logo__mark {
	font-size: 1.75rem;
	font-weight: 700;
	color: var(--color-primary);
	letter-spacing: -0.02em;
}

.header-search {
	position: relative;
	display: flex;
	align-items: center;
	max-width: 640px;
	width: 100%;
	margin: 0 auto;
}

.header-search input[type="search"] {
	width: 100%;
	padding: 0.65rem 2.75rem 0.65rem 1rem;
	border: 1px solid #ccc;
	border-radius: 4px;
	background: #fff;
	font-size: 0.9375rem;
}

.header-search__submit {
	position: absolute;
	right: 0.35rem;
	background: none;
	border: none;
	padding: 0.35rem;
	cursor: pointer;
	color: var(--color-muted);
}

.header-actions {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.header-action-tile {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.15rem;
	background: none;
	border: none;
	padding: 0.25rem 0.5rem;
	font-size: 0.75rem;
	color: var(--color-dark);
	cursor: pointer;
	text-decoration: none;
	min-width: 56px;
}

.header-action-tile .booknest-cart-count {
	top: 0;
	right: 0.25rem;
	background: var(--color-primary);
	color: #fff;
}

.header-auth {
	display: none;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.15rem;
	margin-left: 0.5rem;
}

.header-auth__signin {
	font-size: 0.8125rem;
	color: var(--color-muted);
}

.btn--kobo {
	background: var(--color-primary);
	color: #fff !important;
	border-radius: 4px;
	padding: 0.5rem 1rem;
	font-size: 0.875rem;
	font-weight: 600;
	border: none;
}

.btn--kobo:hover {
	background: var(--color-primary-hover);
	color: #fff !important;
}

.btn--kobo-white {
	background: #fff;
	color: var(--color-dark) !important;
	border-radius: 4px;
	padding: 0.65rem 1.25rem;
	font-weight: 600;
}

.btn--text {
	background: none;
	border: none;
	color: var(--color-primary);
	font-weight: 600;
	cursor: pointer;
	padding: 0;
}

.header-nav {
	border-top: 1px solid var(--color-border);
	border-bottom: 1px solid var(--color-border);
}

.kobo-menu {
	display: none;
	list-style: none;
	margin: 0;
	padding: 0.65rem 0;
	gap: 1.75rem;
	flex-wrap: wrap;
}

.kobo-menu a {
	color: var(--color-dark);
	font-size: 0.9375rem;
	font-weight: 500;
}

.kobo-menu a:hover {
	color: var(--color-primary);
}

.header-quicklinks {
	border-bottom: 1px solid var(--color-border);
	background: #fff;
}

.header-quicklinks__scroll {
	display: flex;
	gap: 1.5rem;
	overflow-x: auto;
	padding: 0.65rem 0;
	font-size: 0.875rem;
	white-space: nowrap;
	scrollbar-width: thin;
}

.header-quicklinks__scroll a {
	color: var(--color-dark);
	font-weight: 500;
}

.nav-toggle {
	display: flex;
}

@media (min-width: 900px) {
	.header-auth {
		display: flex;
	}
	.kobo-menu {
		display: flex;
	}
	.nav-toggle {
		display: none;
	}
}

.nav-open .kobo-menu {
	display: flex;
	flex-direction: column;
	padding: 1rem 0;
}

.nav-open .header-nav .container {
	border-top: 1px solid var(--color-border);
}

@media (max-width: 899px) {
	.header-main__inner {
		grid-template-columns: 1fr auto;
		grid-template-areas:
			"logo actions"
			"search search";
	}
	.site-branding { grid-area: logo; }
	.header-actions { grid-area: actions; }
	.header-search {
		grid-area: search;
		max-width: none;
	}
	.header-auth { display: none; }
	.header-action-tile span { display: none; }
}

/* Hero */
.kobo-hero {
	background: var(--color-hero);
	color: #fff;
	padding: 2rem 0;
}

.kobo-hero__grid {
	display: grid;
	gap: 1.5rem;
	align-items: center;
}

.kobo-hero__title {
	font-family: var(--font-heading);
	font-size: clamp(1.75rem, 4vw, 2.5rem);
	font-weight: 600;
	color: #fff;
	line-height: 1.2;
	margin-bottom: 0.5rem;
}

.kobo-hero__subtitle {
	font-size: 1.0625rem;
	opacity: 0.92;
	margin-bottom: 1.25rem;
}

.kobo-hero__media img {
	width: 100%;
	border-radius: 12px;
}

@media (min-width: 900px) {
	.kobo-hero__grid {
		grid-template-columns: 1fr 1fr;
	}
}

.kobo-promo-strip {
	background: var(--color-section-muted);
	padding: 2rem 0;
}

.kobo-promo-strip__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.kobo-promo-strip__title {
	font-family: var(--font-heading);
	font-size: clamp(1.5rem, 3vw, 2rem);
	margin: 0;
}

/* Sections & rails */
.kobo-section {
	padding: 2rem 0 2.5rem;
}

.kobo-section--muted {
	background: var(--color-section-muted);
}

.kobo-section__header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1rem;
}

.kobo-section__title {
	font-size: 1.25rem;
	font-weight: 600;
	margin: 0;
}

.kobo-section__title--serif {
	font-family: var(--font-heading);
	font-size: clamp(1.5rem, 3vw, 2rem);
	font-weight: 600;
}

.kobo-skip-list {
	font-size: 0.8125rem;
	color: var(--color-muted);
	white-space: nowrap;
}

.kobo-rail-wrap {
	margin: 0 -0.5rem;
}

ul.products.kobo-rail {
	display: flex !important;
	flex-wrap: nowrap !important;
	gap: 1.25rem !important;
	overflow-x: auto;
	padding: 0.25rem 0.5rem 1rem !important;
	margin: 0 !important;
	list-style: none;
	scroll-snap-type: x proximity;
	scrollbar-width: thin;
}

ul.products.kobo-rail > li.product {
	flex: 0 0 140px !important;
	width: 140px !important;
	margin: 0 !important;
	scroll-snap-align: start;
	border: none;
	box-shadow: none;
	background: transparent;
}

@media (min-width: 768px) {
	ul.products.kobo-rail > li.product {
		flex-basis: 160px !important;
		width: 160px !important;
	}
}

.kobo-product.product-card {
	box-shadow: none;
	border: none;
	background: transparent;
}

.kobo-product .product-card__media {
	border-radius: 4px;
	overflow: hidden;
	box-shadow: var(--shadow-md);
}

.kobo-product .product-card__title {
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.35;
	margin: 0.5rem 0 0.15rem;
}

.kobo-product .product-card__title a {
	color: var(--color-dark);
}

.kobo-product .product-card__author {
	font-size: 0.8125rem;
	color: var(--color-muted);
	margin: 0;
}

.kobo-product .product-card__rating {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	font-size: 0.75rem;
}

.kobo-product .product-card__review-count {
	color: var(--color-muted);
}

.kobo-product .product-card__price {
	font-size: 0.875rem;
	font-weight: 600;
	margin-top: 0.25rem;
}

.kobo-product .product-card__price del {
	color: var(--color-muted);
	font-weight: 400;
}

.kobo-product .product-card__actions {
	display: none;
}

.kobo-section__more {
	margin-top: 0.5rem;
	font-size: 0.9375rem;
}

.kobo-features {
	display: grid;
	gap: 1.5rem;
}

@media (min-width: 768px) {
	.kobo-features {
		grid-template-columns: repeat(3, 1fr);
	}
}

.kobo-feature h3 {
	font-size: 1rem;
	margin-bottom: 0.35rem;
}

.kobo-feature p {
	margin: 0;
	color: var(--color-muted);
	font-size: 0.9375rem;
}

.kobo-categories {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 1rem;
}

.kobo-category-pill {
	padding: 0.45rem 0.85rem;
	border: 1px solid var(--color-border);
	border-radius: 999px;
	font-size: 0.875rem;
	color: var(--color-dark);
	background: #fff;
}

.kobo-category-pill:hover {
	border-color: var(--color-primary);
	color: var(--color-primary);
}

.kobo-deal {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	padding: 1.5rem;
	background: #fff;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
}

.kobo-countdown .countdown__unit {
	background: var(--color-section-muted);
	color: var(--color-dark);
}

.kobo-newsletter {
	background: var(--color-section-muted);
	padding: 2.5rem 0;
	border-top: 1px solid var(--color-border);
}

.kobo-newsletter__inner {
	display: grid;
	gap: 1.25rem;
	align-items: center;
}

@media (min-width: 768px) {
	.kobo-newsletter__inner {
		grid-template-columns: 1fr 1fr;
	}
}

.kobo-newsletter__form {
	display: flex;
	gap: 0.5rem;
}

.kobo-newsletter__form input {
	flex: 1;
	padding: 0.65rem 0.85rem;
	border: 1px solid #ccc;
	border-radius: 4px;
}

/* Footer Kobo-like */
.site-footer {
	background: #f7f7f7;
	border-top: 1px solid var(--color-border);
	margin-top: 0;
}

.site-footer .site-title {
	color: var(--color-primary);
	font-weight: 700;
}

/* Shop grid products */
.woocommerce ul.products:not(.kobo-rail) .kobo-product {
	background: #fff;
}

.btn--primary {
	background: var(--color-primary);
}

.btn--primary:hover {
	background: var(--color-primary-hover);
}

.woocommerce .star-rating {
	color: #f5a623;
}

/* Hide old header layout remnants */
.site-header__inner,
.primary-nav,
.theme-toggle {
	display: none !important;
}
