/* ==========================================================================
   CouponHub — single coupon, entries, sidebar, footer, comments, responsive
   ========================================================================== */

:focus-visible {
	outline: 3px solid rgba(37, 99, 235, 0.45);
	outline-offset: 2px;
}

.layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 32px;
	align-items: start;
	padding: 32px 0 64px;
}

.layout__main {
	min-width: 0;
}

.layout__sidebar {
	position: sticky;
	top: 96px;
}

.layout__sidebar:empty {
	display: none;
}

.layout:has(.layout__sidebar:empty) {
	grid-template-columns: minmax(0, 1fr);
}

/* Single coupon ----------------------------------------------------------- */

.coupon-single {
	padding: 28px;
	background: #fff;
	border: 1px solid var(--ch-border);
	border-radius: var(--ch-radius);
}

.coupon-single__header {
	margin-bottom: 24px;
}

.coupon-single__store {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
	color: var(--ch-text);
	font-weight: 600;
}

.coupon-single__store img {
	width: 44px;
	height: 44px;
	object-fit: contain;
	background: #fff;
	border: 1px solid var(--ch-border);
	border-radius: 50%;
}

.coupon-single__title {
	margin: 0 0 12px;
	font-size: clamp(1.5rem, 3vw, 2.2rem);
}

.coupon-single__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	color: var(--ch-muted);
	font-size: 0.85rem;
}

.coupon-single__expiry.is-expired {
	color: #dc2626;
	font-weight: 600;
}

.coupon-reveal {
	position: relative;
	margin: 0 0 28px;
	padding: 36px 24px;
	background: linear-gradient(135deg, #1e3a8a, var(--ch-primary));
	border-radius: 14px;
	color: #fff;
	text-align: center;
	overflow: hidden;
}

.coupon-reveal::before {
	content: "";
	position: absolute;
	top: -40%;
	left: -20%;
	width: 140%;
	height: 220px;
	background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 65%);
}

.coupon-reveal__inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
}

.coupon-reveal__discount {
	margin: 0;
	font-size: clamp(2rem, 5vw, 3rem);
	font-weight: 800;
	letter-spacing: -0.03em;
}

.coupon-reveal__label {
	margin: 0;
	color: #dbeafe;
	font-size: 0.95rem;
}

.coupon-reveal__message {
	margin: 0;
	color: #fee2e2;
	font-weight: 600;
}

.coupon-reveal__store-link {
	color: #dbeafe;
	font-size: 0.9rem;
	font-weight: 600;
}

.coupon-reveal__store-link:hover {
	color: #fff;
}

.coupon-reveal.is-expired {
	background: linear-gradient(135deg, #475569, #64748b);
}

.coupon-code--large {
	width: 100%;
	max-width: 420px;
	background: #fff;
	border-color: #fff;
}

.coupon-code--large .coupon-code__value {
	font-size: 1.25rem;
}

.coupon-code--large .coupon-code__copy {
	padding: 9px 18px;
}

.coupon-single__content {
	margin-top: 8px;
}

.coupon-terms {
	margin: 24px 0;
	padding: 20px;
	background: var(--ch-bg);
	border-radius: 12px;
}

.coupon-terms h2 {
	margin-bottom: 8px;
	font-size: 1.05rem;
}

.coupon-terms p {
	margin: 0;
	color: var(--ch-muted);
	font-size: 0.9rem;
}

.coupon-vote {
	margin: 28px 0;
	padding: 24px;
	border: 1px dashed var(--ch-border);
	border-radius: 12px;
	text-align: center;
}

.coupon-vote h2 {
	margin-bottom: 14px;
	font-size: 1.1rem;
}

.coupon-vote__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
}

.coupon-vote .is-voted {
	border-color: #15803d;
	color: #15803d;
}

.related-coupons {
	margin-top: 32px;
}

/* Entries ----------------------------------------------------------------- */

.entry {
	padding: 32px;
	background: #fff;
	border: 1px solid var(--ch-border);
	border-radius: var(--ch-radius);
}

.entry-header {
	margin-bottom: 20px;
}

.entry-title {
	margin: 0 0 10px;
	font-size: clamp(1.6rem, 3vw, 2.3rem);
}

.entry-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	color: var(--ch-muted);
	font-size: 0.85rem;
}

.entry-thumbnail {
	margin: 0 0 24px;
	overflow: hidden;
	border-radius: 12px;
}

.entry-content {
	font-size: 1.02rem;
}

.entry-content h2,
.entry-content h3 {
	margin-top: 1.4em;
}

.entry-content img {
	border-radius: 10px;
}

.entry-content blockquote {
	margin: 0 0 1.5em;
	padding: 0.5em 0 0.5em 1.25em;
	border-left: 4px solid var(--ch-primary);
	color: var(--ch-muted);
	font-style: italic;
}

.entry-content code {
	padding: 2px 6px;
	background: var(--ch-bg);
	border-radius: 4px;
	font-size: 0.9em;
}

.entry-content pre {
	overflow: auto;
	padding: 16px;
	background: #0f172a;
	color: #e2e8f0;
	border-radius: 10px;
}

.entry-footer {
	margin-top: 24px;
	padding-top: 16px;
	border-top: 1px solid var(--ch-border);
	color: var(--ch-muted);
	font-size: 0.85rem;
}

.entry-footer span {
	display: block;
	margin-bottom: 4px;
}

.page-links {
	margin-top: 20px;
	font-weight: 600;
}

.page-intro {
	margin: 24px 0;
}

.post-navigation {
	margin: 32px 0;
}

.post-navigation .nav-links {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.post-navigation a {
	display: block;
	padding: 16px;
	background: #fff;
	border: 1px solid var(--ch-border);
	border-radius: 12px;
}

.post-navigation a:hover {
	border-color: var(--ch-primary);
}

.post-navigation .nav-label {
	display: block;
	color: var(--ch-muted);
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.post-navigation .nav-title {
	color: var(--ch-text);
	font-weight: 600;
}

/* Sidebar widgets --------------------------------------------------------- */

.widget-area {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.widget {
	padding: 20px;
	background: #fff;
	border: 1px solid var(--ch-border);
	border-radius: 14px;
}

.widget-title {
	margin: 0 0 14px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--ch-border);
	font-size: 1rem;
}

.widget ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.widget li {
	padding: 8px 0;
	border-bottom: 1px solid #f1f5f9;
	font-size: 0.9rem;
}

.widget li:last-child {
	padding-bottom: 0;
	border-bottom: 0;
}

.widget a {
	color: var(--ch-text);
}

.widget a:hover {
	color: var(--ch-primary);
}

.widget-store-list a {
	display: flex;
	align-items: center;
	gap: 10px;
}

.widget-store-list img {
	width: 36px;
	height: 36px;
	object-fit: contain;
	background: #fff;
	border: 1px solid var(--ch-border);
	border-radius: 50%;
}

.widget-store-list__count {
	margin-left: auto;
	color: var(--ch-muted);
	font-size: 0.78rem;
}

.widget-coupon-list__title {
	display: block;
	font-weight: 600;
}

.widget-coupon-list__meta {
	display: block;
	color: var(--ch-muted);
	font-size: 0.78rem;
}

.widget select {
	width: 100%;
	padding: 10px;
	border: 1px solid var(--ch-border);
	border-radius: 8px;
}

.widget .search-form {
	display: flex;
	gap: 8px;
}

.widget .search-field {
	flex: 1;
	min-width: 0;
	padding: 10px 12px;
	border: 1px solid var(--ch-border);
	border-radius: 8px;
}

/* Footer ------------------------------------------------------------------ */

.site-footer {
	margin-top: 72px;
	background: #0f172a;
	color: #cbd5e1;
}

.footer-widgets {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 32px;
	padding: 56px 24px 24px;
}

.footer-widgets .widget {
	padding: 0;
	background: transparent;
	border: 0;
}

.footer-widgets .widget-title {
	color: #fff;
	border-bottom-color: rgba(255, 255, 255, 0.12);
}

.footer-widgets a {
	color: #cbd5e1;
}

.footer-widgets a:hover {
	color: #fff;
}

.footer-widgets li {
	border-bottom-color: rgba(255, 255, 255, 0.08);
}

.footer-bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding: 24px 24px 8px;
}

.footer-brand {
	margin: 0;
	font-size: 1.2rem;
	font-weight: 800;
}

.footer-brand a {
	color: #fff;
}

.footer-text {
	max-width: 420px;
	margin: 4px 0 0;
	color: #94a3b8;
	font-size: 0.85rem;
}

.footer-menu {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.88rem;
}

.footer-menu a {
	color: #cbd5e1;
}

.footer-social {
	display: flex;
	gap: 8px;
}

.footer-social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 50%;
	color: #fff;
	font-weight: 700;
}

.footer-social a:hover {
	background: #fff;
	color: #0f172a;
}

.footer-legal {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 16px;
	padding: 8px 24px 28px;
	color: #94a3b8;
	font-size: 0.78rem;
}

.footer-legal p {
	margin: 0;
}

.back-to-top {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 90;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 0;
	background: var(--ch-primary);
	color: #fff;
	border-radius: 50%;
	box-shadow: var(--ch-shadow);
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.back-to-top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: none;
}

/* Comments ---------------------------------------------------------------- */

.comments-area {
	margin-top: 40px;
	padding: 28px;
	background: #fff;
	border: 1px solid var(--ch-border);
	border-radius: var(--ch-radius);
}

.comments-title,
.comment-reply-title {
	font-size: 1.2rem;
}

.comment-list {
	margin: 0 0 24px;
	padding: 0;
	list-style: none;
}

.comment-list .comment {
	padding: 18px 0;
	border-top: 1px solid var(--ch-border);
}

.comment-list .children {
	padding-left: 20px;
	list-style: none;
}

.comment-author img {
	float: left;
	margin-right: 10px;
	border-radius: 50%;
}

.comment-metadata {
	color: var(--ch-muted);
	font-size: 0.78rem;
}

.comment-content {
	clear: both;
	padding-top: 8px;
}

.comment-form label {
	display: block;
	margin-bottom: 4px;
	font-size: 0.9rem;
	font-weight: 600;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--ch-border);
	border-radius: 8px;
}

.comment-form .submit {
	padding: 11px 22px;
	border: 0;
	background: var(--ch-primary);
	color: #fff;
	border-radius: 999px;
	font-weight: 600;
	cursor: pointer;
}

.comment-form .submit:hover {
	background: var(--ch-primary-dark);
}

/* Empty states and 404 ---------------------------------------------------- */

.no-results {
	padding: 40px;
	background: #fff;
	border: 1px solid var(--ch-border);
	border-radius: var(--ch-radius);
	text-align: center;
}

.no-results__title {
	margin-bottom: 10px;
}

.no-results .search-form,
.error-404 .search-form {
	display: flex;
	gap: 8px;
	max-width: 480px;
	margin: 16px auto;
}

.no-results .search-field,
.error-404 .search-field {
	flex: 1;
	min-width: 0;
	padding: 12px 16px;
	border: 1px solid var(--ch-border);
	border-radius: 999px;
}

.error-404 {
	padding: 48px 0;
	text-align: center;
}

.error-404__code {
	margin: 0;
	color: var(--ch-primary);
	font-size: clamp(4rem, 12vw, 7rem);
	font-weight: 800;
	line-height: 1;
}

.error-404__title {
	margin-top: 8px;
}

.error-404__text {
	max-width: 560px;
	margin: 0 auto;
	color: var(--ch-muted);
}

/* WooCommerce ------------------------------------------------------------- */

.woocommerce-main {
	padding: 32px 0;
}

.woocommerce ul.products {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.woocommerce ul.products li.product {
	float: none !important;
	width: auto !important;
	margin: 0;
	padding-bottom: 16px;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--ch-border);
	border-radius: 14px;
	text-align: center;
}

.woocommerce ul.products li.product img {
	border-radius: 0;
}

.woocommerce .woocommerce-result-count,
.woocommerce .woocommerce-ordering {
	margin-bottom: 20px;
}

.woocommerce .button,
.woocommerce button.button,
.woocommerce a.button {
	padding: 10px 18px;
	background: var(--ch-primary);
	color: #fff;
	border-radius: 999px;
	font-weight: 600;
}

.woocommerce .button:hover,
.woocommerce button.button:hover,
.woocommerce a.button:hover {
	background: var(--ch-primary-dark);
	color: #fff;
}

.woocommerce-message,
.woocommerce-info {
	border-top-color: var(--ch-primary);
}

.woocommerce .star-rating span {
	color: var(--ch-accent);
}

.woocommerce div.product .product_title {
	font-size: 1.8rem;
}

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

@media (max-width: 1024px) {
	.coupon-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.store-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.category-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.layout {
		grid-template-columns: 1fr;
	}

	.layout__sidebar {
		position: static;
	}

	.footer-widgets {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.woocommerce ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 860px) {
	.menu-toggle {
		display: block;
	}

	.main-navigation {
		position: relative;
		margin-left: auto;
	}

	.primary-menu,
	.main-navigation .menu {
		position: absolute;
		top: calc(100% + 10px);
		right: 0;
		z-index: 50;
		display: none;
		flex-direction: column;
		align-items: stretch;
		width: 240px;
		padding: 10px;
		background: #fff;
		border: 1px solid var(--ch-border);
		border-radius: 12px;
		box-shadow: var(--ch-shadow);
	}

	.main-navigation.is-open .primary-menu,
	.main-navigation.is-open .menu {
		display: flex;
	}

	.primary-menu .sub-menu,
	.main-navigation .menu .sub-menu {
		position: static;
		display: block;
		padding-left: 12px;
		border: 0;
		box-shadow: none;
	}

	.header-cta {
		display: none;
	}

	.hero {
		padding: 64px 0;
	}

	.steps {
		grid-template-columns: 1fr;
	}

	.store-grid--large {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.post-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 640px) {
	.coupon-grid {
		grid-template-columns: 1fr;
	}

	.store-grid,
	.store-grid--large {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.category-grid {
		grid-template-columns: 1fr;
	}

	.hero-search {
		flex-direction: column;
		padding: 12px;
		border-radius: 16px;
	}

	.hero-search .btn {
		width: 100%;
	}

	.hero__stats {
		gap: 24px;
	}

	.section {
		padding: 52px 0;
	}

	.section__head {
		flex-direction: column;
		align-items: flex-start;
	}

	.coupon-filters {
		flex-direction: column;
		align-items: stretch;
	}

	.coupon-filters__actions {
		justify-content: space-between;
	}

	.store-hero {
		flex-direction: column;
		text-align: center;
	}

	.coupon-single {
		padding: 20px;
	}

	.coupon-reveal {
		padding: 28px 16px;
	}

	.footer-widgets {
		grid-template-columns: 1fr;
	}

	.footer-bottom__inner {
		flex-direction: column;
		align-items: flex-start;
	}

	.footer-legal {
		flex-direction: column;
	}

	.entry {
		padding: 22px;
	}

	.comments-area {
		padding: 20px;
	}

	.post-navigation .nav-links {
		grid-template-columns: 1fr;
	}

	.woocommerce ul.products {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}
