/* ============================================
   AmazonFinds Theme — Custom Styles
   ============================================ */

/* --- Reset & Base --- */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* --- Sticky Header --- */

.site-header {
	z-index: 100;
	backdrop-filter: blur(12px) saturate(1.5);
	-webkit-backdrop-filter: blur(12px) saturate(1.5);
	background-color: rgba(255, 255, 255, 0.92) !important;
	box-shadow: 0 1px 0 var(--wp--preset--color--border);
	transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
	box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

/* --- Logo --- */

.site-logo-mark {
	gap: 6px !important;
}

.site-logo-mark .wp-block-site-title a {
	background: linear-gradient(135deg, var(--wp--preset--color--primary), var(--wp--preset--color--amber));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

/* --- Navigation --- */

.main-navigation .wp-block-navigation-item a {
	position: relative;
	transition: color 0.2s ease;
}

.main-navigation .wp-block-navigation-item a::after {
	content: '';
	position: absolute;
	bottom: -4px;
	left: 0;
	width: 0;
	height: 2px;
	background: var(--wp--preset--color--primary);
	border-radius: 2px;
	transition: width 0.25s ease;
}

.main-navigation .wp-block-navigation-item a:hover::after {
	width: 100%;
}

.nav-viral a {
	color: var(--wp--preset--color--pink) !important;
}

.nav-deals a {
	color: var(--wp--preset--color--deal-red) !important;
	font-weight: 700 !important;
}

/* --- Category Bar --- */

.category-bar {
	overflow-x: auto;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.category-bar::-webkit-scrollbar {
	display: none;
}

.category-pill a {
	display: inline-block;
	padding: 6px 14px;
	border-radius: 100px;
	background: var(--wp--preset--color--background);
	transition: all 0.2s ease;
	text-decoration: none !important;
}

.category-pill a:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* --- Hero Section --- */

.hero-section {
	position: relative;
	overflow: hidden;
}

.hero-section::before {
	content: '';
	position: absolute;
	top: -50%;
	right: -20%;
	width: 400px;
	height: 400px;
	background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
	border-radius: 50%;
	pointer-events: none;
}

.hero-section::after {
	content: '';
	position: absolute;
	bottom: -30%;
	left: -10%;
	width: 300px;
	height: 300px;
	background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
	border-radius: 50%;
	pointer-events: none;
}

/* --- Product Cards --- */

.product-card {
	overflow: hidden;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.04);
}

.product-card .wp-block-post-featured-image {
	overflow: hidden;
}

.product-card .wp-block-post-featured-image img {
	transition: transform 0.4s ease;
}

.product-card:hover .wp-block-post-featured-image img {
	transform: scale(1.04);
}

.product-card .wp-block-post-title a {
	transition: color 0.2s ease;
}

/* --- Product Grid Responsive --- */

.product-grid .wp-block-post-template {
	gap: var(--wp--preset--spacing--50) !important;
}

@media (max-width: 782px) {
	.product-grid .wp-block-post-template {
		grid-template-columns: 1fr 1fr !important;
	}
}

@media (max-width: 480px) {
	.product-grid .wp-block-post-template {
		grid-template-columns: 1fr !important;
	}
}

/* --- Category Cards --- */

.category-card {
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	cursor: pointer;
}

.category-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.category-card h3 a {
	text-decoration: none !important;
}

.category-card h3 a::after {
	content: ' \2192';
	opacity: 0;
	transition: opacity 0.2s ease;
}

.category-card:hover h3 a::after {
	opacity: 1;
}

/* --- Affiliate Disclosure --- */

.affiliate-disclosure {
	border-top: none !important;
	border-right: none !important;
	border-bottom: none !important;
}

/* --- Amazon CTA Buttons --- */

.amazon-cta .wp-block-button__link {
	position: relative;
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	box-shadow: 0 4px 14px rgba(255, 153, 0, 0.3);
}

.amazon-cta .wp-block-button__link:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(255, 153, 0, 0.4);
}

.amazon-cta .wp-block-button__link::after {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
	transition: left 0.5s ease;
}

.amazon-cta .wp-block-button__link:hover::after {
	left: 100%;
}

/* --- Deal Badge --- */

.deal-badge-banner {
	animation: deal-pulse 3s ease-in-out infinite;
}

@keyframes deal-pulse {
	0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
	50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.08); }
}

.deal-cta .wp-block-button__link {
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.deal-cta .wp-block-button__link:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* --- Product Highlight --- */

.product-highlight {
	transition: box-shadow 0.3s ease;
}

.product-highlight:hover {
	box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

.product-highlight .product-image img {
	transition: transform 0.3s ease;
}

.product-highlight:hover .product-image img {
	transform: scale(1.02);
}

/* --- Pros & Cons --- */

.pros-box ul,
.cons-box ul {
	list-style: none;
	padding-left: 0;
}

.pros-box ul li::before {
	content: '\2713\0020';
	color: var(--wp--preset--color--emerald);
	font-weight: 700;
}

.cons-box ul li::before {
	content: '\2717\0020';
	color: var(--wp--preset--color--amber);
	font-weight: 700;
}

/* --- Post Content Styling --- */

.post-content h2 {
	margin-top: var(--wp--preset--spacing--60);
	padding-top: var(--wp--preset--spacing--40);
}

.post-content .wp-block-image {
	margin-top: var(--wp--preset--spacing--50);
	margin-bottom: var(--wp--preset--spacing--50);
}

.post-content .wp-block-image img {
	border-radius: 12px;
}

.post-content .wp-block-list {
	padding-left: 1.2em;
}

.post-content .wp-block-list li {
	margin-bottom: 0.4em;
}

/* --- Newsletter Section --- */

.newsletter-section .wp-block-search {
	margin-top: var(--wp--preset--spacing--40);
}

.newsletter-section .wp-block-search__inside-wrapper {
	background: rgba(255, 255, 255, 0.06);
	border-radius: 12px;
}

.newsletter-section .wp-block-search__input {
	background: transparent;
	color: #fff;
	border: none;
}

.newsletter-section .wp-block-search__input::placeholder {
	color: var(--wp--preset--color--muted);
}

.newsletter-section .wp-block-search__button {
	background: var(--wp--preset--color--primary) !important;
	color: #fff !important;
	border: none;
	border-radius: 10px !important;
	font-weight: 600;
	transition: background 0.2s ease;
}

.newsletter-section .wp-block-search__button:hover {
	background: var(--wp--preset--color--primary-dark) !important;
}

/* --- Pagination --- */

.wp-block-query-pagination {
	gap: var(--wp--preset--spacing--20);
}

.wp-block-query-pagination .page-numbers,
.wp-block-query-pagination-previous a,
.wp-block-query-pagination-next a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border-radius: 10px;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	color: var(--wp--preset--color--dark);
	text-decoration: none;
	font-weight: 600;
	font-size: 0.85rem;
	transition: all 0.2s ease;
}

.wp-block-query-pagination .page-numbers:hover,
.wp-block-query-pagination-previous a:hover,
.wp-block-query-pagination-next a:hover {
	background: var(--wp--preset--color--primary-light);
	border-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--primary);
}

.wp-block-query-pagination .page-numbers.current {
	background: var(--wp--preset--color--primary);
	border-color: var(--wp--preset--color--primary);
	color: #fff;
}

/* --- Header Search --- */

.header-search .wp-block-search__inside-wrapper {
	border-radius: 10px !important;
	overflow: hidden;
}

.header-search .wp-block-search__input {
	font-size: 0.85rem;
}

.header-search .wp-block-search__button {
	background: var(--wp--preset--color--primary) !important;
	border: none;
	border-radius: 0 8px 8px 0 !important;
	padding: 8px 12px;
}

/* --- Footer --- */

.site-footer .wp-block-navigation-item a {
	color: var(--wp--preset--color--muted) !important;
	transition: color 0.2s ease;
}

.site-footer .wp-block-navigation-item a:hover {
	color: var(--wp--preset--color--surface) !important;
}

/* --- Animations on Scroll --- */

.fade-in-up {
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in-up.visible {
	opacity: 1;
	transform: translateY(0);
}

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

@media (max-width: 782px) {
	.hero-section {
		padding: var(--wp--preset--spacing--50) !important;
	}

	.category-card {
		text-align: center;
	}

	.wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column {
		flex-basis: 100% !important;
	}

	.product-highlight .wp-block-columns {
		flex-direction: column;
	}

	.product-highlight .wp-block-column {
		flex-basis: 100% !important;
	}

	.deal-badge-banner {
		flex-direction: column !important;
		text-align: center;
		gap: var(--wp--preset--spacing--30) !important;
	}

	.site-footer .wp-block-columns {
		gap: var(--wp--preset--spacing--50) !important;
	}
}

@media (max-width: 480px) {
	.category-bar .wp-block-group {
		justify-content: flex-start !important;
		flex-wrap: nowrap !important;
		overflow-x: auto;
		padding-bottom: var(--wp--preset--spacing--20);
	}

	.category-pill {
		white-space: nowrap;
		flex-shrink: 0;
	}
}

/* --- Selection Color --- */

::selection {
	background: var(--wp--preset--color--primary-light);
	color: var(--wp--preset--color--primary-dark);
}

/* --- Print Styles --- */

@media print {
	.site-header,
	.site-footer,
	.newsletter-section,
	.amazon-cta,
	.deal-badge-banner {
		display: none !important;
	}
}
