@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

:root {
	--bg-color: #FFF8F6;
	--text-color: #4A4A4A;
	--primary-pink: #FFC0CB;
	--accent-magenta: #D81B60;
	--card-bg: #FFFFFF;
	--border-color: #F0F0F0;
	--header-height: 80px; /* height reserved for fixed header */
	--footer-height: 120px; /* approximate footer height to keep layout consistent */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
	font-family: 'Poppins', sans-serif;
	background-color: var(--bg-color);
	color: var(--text-color);
	line-height: 1.7;
    padding-top: var(--header-height); /* Room for fixed header */
    overflow-x: hidden; /* prevent horizontal scroll that pushes content right */
}

main {
    padding-top: 30px;
    padding-bottom: 30px;
    min-height: calc(100vh - var(--header-height) - var(--footer-height)); /* Ensure footer is pushed down on short pages */
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
a { color: var(--accent-magenta); text-decoration: none; }
.hidden { display: none !important; }

/* --- HEADER --- */
header {
	padding: 20px 0;
	border-bottom: 2px solid var(--border-color);
	background-color: rgba(255, 255, 255, 0.7);
	backdrop-filter: blur(10px);
	position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}
.header-content { display: flex; justify-content: space-between; align-items: center; }

/* UPDATED: Styles for the new logo image */
.logo-link {
	display: block;
	height: 40px;
	width: auto;
}
.logo-img {
	height: 100%;
	width: auto;
	display: block;
}

nav a { margin-left: 25px; font-weight: 600; transition: color 0.3s ease; }
nav a:hover, nav a.active { color: var(--accent-magenta); }

/* --- NEW: Mobile Navigation --- */
#mobile-menu-btn {
	display: none; /* Hidden by default */
	background: none;
	border: none;
	cursor: pointer;
	font-size: 2rem;
	/* UPDATED: Z-index bumped to ensure it's on top */
	z-index: 1101; 
}

/* --- UNIVERSAL PAGE STYLES --- */
.page-title { text-align: center; font-size: 2.8rem; margin-bottom: 10px; }
.page-subtitle { text-align:center; max-width: 600px; margin: 0 auto 40px auto; color: #777; }
.back-button { display: inline-block; margin-bottom: 20px; font-weight: 600; }

/* --- HOME PAGE --- */
.hero { text-align: center; padding: 60px 20px; }
.hero h1 { font-size: 3.5rem; }
.hero p { font-size: 1.2rem; max-width: 600px; margin: 20px auto 30px auto; }
.hero-buttons a {
	display: inline-block;
	background-color: var(--accent-magenta);
	color: white;
	padding: 15px 30px;
	border-radius: 30px;
	font-weight: 600;
	margin: 0 10px;
	transition: transform 0.2s ease;
}
.hero-buttons a:hover { transform: scale(1.05); }
.home-section { padding: 60px 0; }
.section-title { text-align: center; font-size: 2.5rem; margin-bottom: 40px; display: flex; justify-content: center; align-items: baseline; gap: 12px; }

/* --- CATALOG & SEARCH --- */
.catalog-header {
	background: var(--card-bg);
	padding: 24px;
	border-radius: 16px;
	box-shadow: 0 4px 15px rgba(0,0,0,0.05);
	margin-bottom: 40px;
}
.search-container { 
    text-align: center; 
    position: relative; 
}
#search-bar { width: 100%; max-width: 500px; padding: 15px 20px; font-size: 1.1rem; border-radius: 30px; border: 2px solid var(--border-color); font-family: 'Poppins', sans-serif; }
#search-results { position: absolute; width: 100%; max-width: 500px; left: 50%; transform: translateX(-50%); background: var(--card-bg); border-radius: 15px; box-shadow: 0 8px 25px rgba(0,0,0,0.1); margin-top: 5px; text-align: left; overflow: hidden; z-index: 50; }
.result-item { display: flex; align-items: center; padding: 10px; cursor: pointer; transition: background-color 0.2s ease; }
.result-item:hover { background-color: var(--bg-color); }
.result-item:not(:last-child) { border-bottom: 1px solid var(--border-color); }
.result-item img { width: 50px; height: 50px; object-fit: cover; border-radius: 8px; margin-right: 15px; }

.gallery-section { padding: 0 0 60px 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.card {
	background-color: var(--card-bg);
	border-radius: 12px;
	box-shadow: 0 4px 15px rgba(0,0,0,0.05);
	overflow: hidden;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	position: relative; /* For wishlist button positioning */
}
.card:hover { box-shadow: 0 8px 25px rgba(0,0,0,0.1); }
.card .card-img-wrap {
	overflow: hidden;
	border-bottom: 1px solid var(--border-color);
	background-color: #f9f9f9; /* Light background for contain */
}
.card .card-img-wrap img {
	width: 100%;
	height: 200px;
	object-fit: contain; /* Changed from cover to contain */
	display: block;
	transition: transform 0.25s ease;
}
.card:hover .card-img-wrap img { transform: scale(1.04); }
.about-card { padding: 40px; }
.card .card-desc { color: #666; font-size: 0.95rem; margin-top: 8px; }

/* --- Wishlist button on cards --- */
.wishlist-btn {
	position: absolute;
	top: 12px;
	right: 12px;
	background: rgba(255, 255, 255, 0.8);
	border: none;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	cursor: pointer;
	display: flex;
	justify-content: center;
	align-items: center;
	font-size: 1.5rem;
	color: #ccc;
	transition: color 0.2s ease, transform 0.2s ease;
	z-index: 10;
}
.wishlist-btn:hover {
	transform: scale(1.1);
}
.wishlist-btn.active {
	color: var(--accent-magenta);
}


/* --- DETAIL PAGES (Plushie & Article) --- */
.detail-grid, .article-detail-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 32px;
	align-items: start;
}
@media (min-width: 900px) {
	.detail-grid { grid-template-columns: 1.3fr 1fr; }
	.article-detail-grid { grid-template-columns: 2.5fr 1fr; }
}

#main-image {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

#plushie-detail-view #main-image {
	max-height: 55vh;
	max-width: 95%;
	object-fit: contain;
}

.gallery-controls { display: flex; align-items: center; gap: 10px; margin-top: 15px; }
.thumbnail-container { display: flex; gap: 10px; overflow-x: auto; flex-grow: 1; padding: 5px 0; }
.nav-arrow { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 50%; width: 40px; height: 40px; font-size: 1.5rem; cursor: pointer; }
.thumbnail { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid transparent; transition: border-color 0.2s ease; }
.thumbnail.active { border-color: var(--accent-magenta); }

.detail-info h1 { font-size: 2.2rem; margin-bottom: 14px; line-height: 1.15; }
.detail-info p { font-size: 1.05rem; color: #555; }
.buy-links, .collectors-card, .related-articles { margin-top: 25px; }
.buy-links h3, .collectors-card h3, .related-articles h3 { margin-bottom: 10px; border-bottom: 2px solid var(--border-color); padding-bottom: 8px;}
#detail-buy-links { display: flex; flex-wrap: wrap; gap: 10px; }
.buy-button { background-color: var(--accent-magenta); color: white; padding: 10px 20px; border-radius: 20px; font-weight: 600; transition: transform 0.2s ease; display: inline-block; }
.buy-button:hover { transform: scale(1.05); }
.card-fact { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border-color); }
.card-fact:last-child { border-bottom: none; }
#related-articles-list a { display: block; margin-bottom: 10px; }

/* --- Wishlist button on detail page --- */
.detail-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 16px;
}
.detail-header .wishlist-btn {
	position: static; /* Override absolute positioning */
	flex-shrink: 0;
}

/* --- Wishlist Empty State --- */
.wishlist-empty-container {
	text-align: center;
	padding: 80px 20px;
	background: var(--card-bg);
	border-radius: 16px;
	margin-top: 40px;
}
.wishlist-empty-container p {
	font-size: 1.2rem;
	margin-bottom: 24px;
}
.wishlist-empty-container .hero-buttons {
	/* The class is from home, but we can reuse it */
	display: inline-block;
	background-color: var(--accent-magenta);
	color: white;
	padding: 15px 30px;
	border-radius: 30px;
	font-weight: 600;
	margin: 0 10px;
	transition: transform 0.2s ease;
}
.wishlist-empty-container .hero-buttons:hover {
	transform: scale(1.05);
}

/* --- LIGHTBOX --- */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    cursor: pointer;
    backdrop-filter: blur(5px);
    /* NEW: Animation properties */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

#lightbox.visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0s 0s;
}

#lightbox.visible .lightbox-content {
    transform: scale(1);
}

.lightbox-content-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: grab;
}
.lightbox-content {
    max-width: 90vw;
    max-height: calc(100vh - 100px); /* Ensure space for controls */
    /* NEW: Animation properties */
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.close-btn { position: absolute; top: 20px; right: 35px; font-size: 40px; color: white; cursor: pointer; z-index: 2001; }
.lightbox-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2100;
    display: flex;
    gap: 8px;
    background: rgba(0,0,0,0.5);
    padding: 8px 15px;
    border-radius: 30px;
}
.zoom-btn { background: none; color: white; border: none; width: 40px; height: 40px; border-radius: 50%; font-size: 1.5rem; cursor: pointer; transition: background-color 0.2s; }
.zoom-btn:hover { background-color: rgba(255,255,255,0.2); }

/* --- FOOTER --- */
footer {
	padding: 50px 0 30px 0;
	margin-top: 40px;
	border-top: 2px solid var(--border-color);
	background-color: #fff;
}
.footer-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 30px;
	margin-bottom: 40px;
}
.footer-column h4 {
	margin-bottom: 15px;
	font-size: 1.1rem;
}
.footer-column ul {
	list-style: none;
	padding: 0;
	margin: 0;
}
.footer-column ul li a {
	display: block;
	padding: 5px 0;
	color: var(--text-color);
}
.footer-column ul li a:hover {
	color: var(--accent-magenta);
}
.footer-bottom {
	text-align: center;
	padding-top: 20px;
	border-top: 1px solid var(--border-color);
	font-size: 0.9rem;
	color: #777;
}

/* --- SCROLLING PLUSHIE SHOWCASE --- */
.scrolling-wrapper {
    width: 100%;
    overflow: hidden;
    padding: 20px 0;
    background: rgba(0,0,0,0.02);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}
.scrolling-content {
    display: flex;
    width: fit-content; /* Let the content determine the width */
    animation: scroll 60s linear infinite;
}
.scrolling-wrapper:hover .scrolling-content {
    animation-play-state: paused;
}

/* NEW: Style the link wrapper for the scrolling plushies */
.scrolling-content a {
    display: inline-block;
    margin: 0 20px;
    transition: transform 0.2s ease-in-out;
    line-height: 0; /* Prevents extra space from text rendering */
}

.scrolling-content a:hover {
    transform: scale(1.1);
}

.scrolling-content img {
    height: 120px;
    width: 120px;
    object-fit: contain;
    background-color: white;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}


@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%); /* Scroll by half the width (since content is duplicated) */
    }
}

/* --- RESPONSIVE TWEAKS --- */
@media (max-width: 900px) {
    .article-detail-grid { grid-template-columns: 1fr; }
    .article-sidebar { position: static; margin-top: 40px; }
}
@media (max-width: 800px) {
    .detail-grid, .featured-article { grid-template-columns: 1fr; }

	/* --- MOBILE NAVIGATION STYLES (REWRITTEN) --- */
	#mobile-menu-btn {
		display: block; /* Show the button on mobile */
		position: relative;
	}
	nav {
		position: fixed;
		top: 0;
		left: -100%;
		width: 100%;
		height: 100vh;
		background: rgba(255, 248, 246, 0.98);
		backdrop-filter: blur(10px);
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		transition: left 0.35s cubic-bezier(0.25, 1, 0.5, 1);
		z-index: 1100;
	}
	nav.active {
		left: 0;
	}
	nav a {
		display: block;
		margin: 0;
		padding: 20px 0;
		font-size: 1.5rem;
		color: var(--text-color);
	}
}
@media (max-width: 600px) {
    body { padding-top: 68px; }
    .hero h1 { font-size: 2.5rem; }
    .detail-info h1 { font-size: 1.8rem; }
	:root { --header-height: 68px; }
}

/* ARTICLE / FEATURED LAYOUT IMPROVEMENTS */
.featured-article {
	display: flex;
	flex-direction: column;
	gap: 16px;
	align-items: stretch;
	margin-bottom: 30px;
}
@media (min-width: 900px) {
	.featured-article {
		flex-direction: row;
		align-items: center;
		gap: 24px;
	}
	.featured-article img { max-width: 50%; height: auto; object-fit: cover; border-radius: 12px; }
	.featured-article > div { flex: 1; }
}

.article-card {
	display: flex;
	gap: 16px;
	background: var(--card-bg);
	border-radius: 12px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.05);
	overflow: hidden;
	padding: 12px;
	margin-bottom: 16px;
	align-items: center;
}
.article-card img {
	width: 120px;
	height: 80px;
	object-fit: cover;
	border-radius: 8px;
	flex-shrink: 0;
}
.article-card-content {
	padding: 6px 0;
}
.article-card-content h3 { margin-bottom: 8px; font-size: 1.05rem; }
.article-card-content p { color: #666; font-size: 0.97rem; }
.read-more-btn {
	display: inline-block;
	margin-top: 8px;
	font-weight: 600;
	color: var(--accent-magenta);
}
html {
	scroll-padding-top: var(--header-height);
}
.view,
.article-body h1,
.detail-info h1,
.featured-product-card,
#plushie-detail-view,
#article-detail-view {
	scroll-margin-top: calc(var(--header-height) + 12px);
}
.article-body {
	max-width: 900px;
	font-size: 1rem;
	color: var(--text-color);
}
.article-body img.inline-image,
.article-body img {
	max-width: 100%;
	height: auto;
	border-radius: 10px;
	margin: 18px 0;
}
.featured-product-card {
	background: var(--card-bg);
	padding: 12px;
	border-radius: 10px;
	box-shadow: 0 6px 18px rgba(0,0,0,0.05);
	margin-bottom: 18px;
	text-align: center;
}
.featured-product-card img { width: 100%; height: auto; border-radius: 8px; margin-bottom: 8px; }

.you-might-like { margin-top: 18px; }
.you-might-like .suggestions-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-top: 12px;
}
@media (max-width: 700px) {
	.you-might-like .suggestions-grid { grid-template-columns: 1fr; }
}

.you-might-like .suggestion-card,
.you-might-like > .suggestion-card {
	background: var(--card-bg);
	border-radius: 10px;
	padding: 10px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.04);
	display: flex;
	gap: 10px;
	align-items: center;
}
.suggestion-card img { width: 76px; height: 76px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.suggestion-card h4 { margin: 0 0 6px 0; font-size: 0.98rem; }
.suggestion-card p { margin: 0; color: #666; font-size: 0.9rem; }

.card .card-meta { margin-top: 8px; color: #777; font-size: 0.95rem; }
.card .card-content { padding: 16px; }

.card:hover .card-content h3 { color: var(--accent-magenta); transition: color 0.2s; }

.skip-link {
	position: absolute;
	left: -9999px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
.skip-link:focus {
	position: fixed;
	left: 12px;
	top: calc(var(--header-height) + 8px);
	background: var(--accent-magenta);
	color: white;
	padding: 8px 12px;
	border-radius: 6px;
	z-index: 1100;
	width: auto;
	height: auto;
	clip: auto;
}

.section-title { scroll-margin-top: calc(var(--header-height) + 12px); }

.filter-bar {
	display: flex;
	gap: 16px;
	align-items: center;
	margin-top: 24px;
	flex-wrap: wrap;
	justify-content: space-between;
}
.filter-controls {
	display: flex;
	gap: 12px;
	align-items: center;
	flex-wrap: wrap;
}
.result-count-display {
	font-weight: 600;
	color: #777;
	font-size: 0.95rem;
}
.filter-bar select {
	padding: 10px 12px;
	border-radius: 10px;
	border: 1px solid var(--border-color);
	background: white;
	font-family: inherit;
}
.clear-filters {
	background: transparent;
	border: 1px solid var(--border-color);
	padding: 8px 12px;
	border-radius: 10px;
	cursor: pointer;
}

@media (max-width: 700px) {
	.filter-bar { gap: 8px; }
	.filter-bar .searchable-select,
	.filter-bar select { flex: 1 1 auto; min-width: 140px; }
}

/* --- NEW: Pagination --- */
.pagination-controls {
	text-align: center;
	margin-top: 40px;
}
.pagination-controls button {
	background: var(--card-bg);
	border: 1px solid var(--border-color);
	padding: 10px 20px;
	border-radius: 20px;
	cursor: pointer;
	transition: background-color 0.2s;
	font-weight: 600;
}
.pagination-controls button:hover:not(:disabled) {
	background-color: var(--primary-pink);
	color: white;
}
.pagination-controls button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}
.pagination-controls span {
	margin: 0 15px;
	font-weight: 600;
}

/* --- NEW: Back to Top Button --- */
.back-to-top-btn {
	position: fixed;
	bottom: 20px;
	right: 20px;
	background-color: var(--accent-magenta);
	color: white;
	border: none;
	border-radius: 50%;
	width: 50px;
	height: 50px;
	font-size: 1.5rem;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
	z-index: 1001;
	transition: opacity 0.3s, transform 0.3s;
}
.back-to-top-btn:hover {
	transform: scale(1.1);
}

/* --- NEW: Loading Overlay --- */
.loading-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(255, 255, 255, 0.7);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 9999;
}
.spinner {
	border: 8px solid var(--border-color);
	border-top: 8px solid var(--accent-magenta);
	border-radius: 50%;
	width: 60px;
	height: 60px;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* --- UPDATED: Searchable Select Component --- */
.searchable-select {
	position: relative;
	min-width: 180px;
}
.ss-button {
	width: 100%;
	background: white;
	border: 1px solid var(--border-color);
	border-radius: 10px;
	padding: 10px 12px;
	text-align: left;
	font-family: inherit;
	cursor: pointer;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.ss-button::after {
	content: '▼';
	font-size: 0.7em;
	color: #999;
	margin-left: 8px;
}
.ss-dropdown {
	position: absolute;
	top: calc(100% + 5px);
	left: 0;
	width: 100%;
	max-height: 250px;
	background: white;
	border: 1px solid var(--border-color);
	border-radius: 10px;
	box-shadow: 0 8px 20px rgba(0,0,0,0.08);
	z-index: 100;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-10px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s 0.2s;
	display: flex;
    flex-direction: column;
}
.searchable-select.open .ss-dropdown {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s 0s;
}
.ss-search {
	padding: 8px;
	border-bottom: 1px solid var(--border-color);
}
.ss-search input {
	width: 100%;
	padding: 8px;
	border: 1px solid var(--border-color);
	border-radius: 6px;
	font-family: inherit;
}
.ss-options {
	list-style: none;
	margin: 0;
	padding: 0;
	overflow-y: auto;
    flex-grow: 1;
}
.ss-option {
	padding: 10px 12px;
	cursor: pointer;
	transition: background-color 0.15s ease;
}
.ss-option:hover {
	background-color: var(--bg-color);
}
.ss-option.selected {
	background-color: var(--primary-pink);
	color: var(--accent-magenta);
	font-weight: 600;
}
.ss-option.hidden {
	display: none;
}

/* Area to display selected tags as pills below the filters */
.selected-tags-container {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--border-color);
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.selected-tag-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background-color: var(--primary-pink);
	color: var(--accent-magenta);
	padding: 4px 10px;
	border-radius: 15px;
	font-size: 0.9rem;
	font-weight: 600;
}
.remove-tag-btn {
	background: none;
	border: none;
	color: inherit;
	cursor: pointer;
	font-weight: bold;
	font-size: 1.1rem;
	line-height: 1;
	padding: 0 0 0 4px;
}