/* ==========================================================================
   Johanna Shop Enhancer — Shop page
   All selectors are prefixed with "html body .jnse" so they win over theme
   styles (Elementor/Hello/Astra etc.) without relying on !important.
   Colors come from CSS variables printed by the plugin (settings page).
   ========================================================================== */

.jnse-main { display: block; width: 100%; }

html body .jnse {
	--jn-gap: clamp(14px, 2.2vw, 28px);
	--jn-ease: cubic-bezier(.2, .7, .2, 1);
	box-sizing: border-box;
	max-width: 1320px;
	margin: 0 auto;
	padding: clamp(24px, 4vw, 56px) 16px 72px;
	color: var(--jn-text);
	font-family: var(--jn-font-body);
	background: var(--jn-bg);
}
html body .jnse *,
html body .jnse *::before,
html body .jnse *::after { box-sizing: border-box; }

html body .jnse svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Header ---------- */
html body .jnse .jnse-head { text-align: center; margin: 0 0 clamp(18px, 3vw, 32px); }
html body .jnse .jnse-title {
	margin: 0; padding: 0;
	font-family: var(--jn-font-heading);
	font-size: clamp(28px, 4.4vw, 48px);
	line-height: 1.1; font-weight: 600; letter-spacing: -.01em;
	color: var(--jn-text);
}
html body .jnse .jnse-subtitle { margin: 10px auto 0; max-width: 620px; color: var(--jn-muted); font-size: 16px; line-height: 1.6; }

/* ---------- Toolbar: search + sort ---------- */
html body .jnse .jnse-toolbar {
	display: flex; gap: 12px; align-items: stretch;
	max-width: 760px; margin: 0 auto 18px;
}
html body .jnse .jnse-search { position: relative; flex: 1 1 auto; margin: 0; }
html body .jnse .jnse-search__icon {
	position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
	width: 18px; height: 18px; color: var(--jn-muted); pointer-events: none;
}
html body .jnse .jnse-search input[type="search"] {
	-webkit-appearance: none; appearance: none;
	width: 100%; height: 52px; margin: 0;
	padding: 0 48px 0 48px;
	font: inherit; font-size: 16px; /* 16px stops iOS zoom */
	color: var(--jn-text);
	background: var(--jn-surface);
	border: 1px solid var(--jn-border);
	border-radius: 999px;
	box-shadow: none; outline: none;
	transition: border-color .2s, box-shadow .2s, background .2s;
}
html body .jnse .jnse-search input[type="search"]::placeholder { color: var(--jn-muted); opacity: 1; }
html body .jnse .jnse-search input[type="search"]::-webkit-search-cancel-button { display: none; }
html body .jnse .jnse-search input[type="search"]:focus {
	background: var(--jn-bg);
	border-color: var(--jn-accent);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--jn-accent) 22%, transparent);
}
html body .jnse .jnse-search__clear {
	all: unset; cursor: pointer;
	position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
	width: 30px; height: 30px; border-radius: 50%;
	display: grid; place-items: center;
	font-size: 22px; line-height: 1; color: var(--jn-muted);
	background: transparent; transition: background .2s, color .2s;
}
html body .jnse .jnse-search__clear[hidden] { display: none; }
html body .jnse .jnse-search__clear:hover { background: var(--jn-border); color: var(--jn-text); }
html body .jnse .jnse-spinner {
	position: absolute; right: 48px; top: 50%; width: 16px; height: 16px; margin-top: -8px;
	border: 2px solid var(--jn-border); border-top-color: var(--jn-primary); border-radius: 50%;
	opacity: 0; animation: jnse-spin .7s linear infinite; transition: opacity .2s;
}
html body .jnse.is-loading .jnse-spinner { opacity: 1; }
@keyframes jnse-spin { to { transform: rotate(360deg); } }

html body .jnse .jnse-sort { position: relative; flex: 0 0 auto; }
html body .jnse .jnse-sort::after {
	content: ""; position: absolute; right: 18px; top: 50%; width: 7px; height: 7px; margin-top: -5px;
	border-right: 1.8px solid var(--jn-text); border-bottom: 1.8px solid var(--jn-text);
	transform: rotate(45deg); pointer-events: none;
}
html body .jnse .jnse-sort select {
	-webkit-appearance: none; appearance: none;
	height: 52px; min-width: 200px; margin: 0;
	padding: 0 44px 0 20px;
	font: inherit; font-size: 15px; color: var(--jn-text);
	background: var(--jn-bg); border: 1px solid var(--jn-border); border-radius: 999px;
	cursor: pointer; box-shadow: none; outline: none;
}
html body .jnse .jnse-sort select:focus { border-color: var(--jn-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--jn-accent) 22%, transparent); }

/* ---------- Category pills ---------- */
html body .jnse .jnse-cats { position: relative; margin: 0 0 10px; }
html body .jnse .jnse-cats__track {
	display: flex; gap: 10px; overflow-x: auto; scroll-behavior: smooth;
	padding: 6px 2px 12px;
	scrollbar-width: none; -ms-overflow-style: none;
	scroll-snap-type: x proximity;
	-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
	        mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
}
html body .jnse .jnse-cats__track::-webkit-scrollbar { display: none; }
@media (min-width: 1100px) {
	/* Wrap into centered rows on wide screens so all 18 categories are visible at once. */
	html body .jnse .jnse-cats__track { flex-wrap: wrap; justify-content: center; overflow: visible; -webkit-mask-image: none; mask-image: none; }
	html body .jnse .jnse-cats__arrow { display: none !important; }
}
html body .jnse .jnse-pill {
	all: unset; box-sizing: border-box; cursor: pointer;
	flex: 0 0 auto; scroll-snap-align: start;
	display: inline-flex; align-items: center; gap: 8px;
	height: 44px; padding: 0 16px;
	font-family: var(--jn-font-body); font-size: 14px; font-weight: 500; line-height: 1; white-space: nowrap;
	color: var(--jn-text); background: var(--jn-bg);
	border: 1px solid var(--jn-border); border-radius: 999px;
	transition: background .2s var(--jn-ease), color .2s, border-color .2s, transform .2s var(--jn-ease), box-shadow .2s;
}
html body .jnse .jnse-pill:hover { border-color: var(--jn-text); transform: translateY(-1px); }
html body .jnse .jnse-pill:focus-visible { outline: 2px solid var(--jn-accent); outline-offset: 2px; }
html body .jnse .jnse-pill.is-active {
	color: var(--jn-on-primary); background: var(--jn-primary); border-color: var(--jn-primary);
	box-shadow: 0 6px 18px -8px var(--jn-primary);
}
html body .jnse .jnse-pill__img { width: 28px; height: 28px; margin-left: -10px; border-radius: 50%; object-fit: cover; }
html body .jnse .jnse-pill__count {
	min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px;
	display: inline-grid; place-items: center;
	font-size: 11.5px; font-weight: 600;
	color: var(--jn-muted); background: var(--jn-surface);
}
html body .jnse .jnse-pill.is-active .jnse-pill__count { color: var(--jn-primary); background: var(--jn-on-primary); }

html body .jnse .jnse-cats__arrow {
	all: unset; cursor: pointer; z-index: 2;
	position: absolute; top: 6px; width: 44px; height: 44px; border-radius: 50%;
	display: grid; place-items: center;
	font-size: 26px; line-height: 1; color: var(--jn-text);
	background: var(--jn-bg); border: 1px solid var(--jn-border);
	box-shadow: 0 4px 14px rgba(0,0,0,.08);
}
html body .jnse .jnse-cats__arrow[hidden] { display: none; }
html body .jnse .jnse-cats__arrow.is-prev { left: -6px; }
html body .jnse .jnse-cats__arrow.is-next { right: -6px; }
@media (hover: none) { html body .jnse .jnse-cats__arrow { display: none !important; } }

html body .jnse .jnse-count { margin: 4px 0 18px; text-align: center; font-size: 13.5px; color: var(--jn-muted); min-height: 1.4em; }

/* ---------- Grid ---------- */
html body .jnse .jnse-grid {
	display: grid; gap: var(--jn-gap) calc(var(--jn-gap) * .8);
	grid-template-columns: repeat(var(--jn-cols-m), minmax(0, 1fr));
	transition: opacity .25s;
}
@media (min-width: 700px)  { html body .jnse .jnse-grid { grid-template-columns: repeat(var(--jn-cols-t), minmax(0, 1fr)); } }
@media (min-width: 1100px) { html body .jnse .jnse-grid { grid-template-columns: repeat(var(--jn-cols), minmax(0, 1fr)); } }
html body .jnse.is-replacing .jnse-grid { opacity: .35; pointer-events: none; }

/* ---------- Card ---------- */
html body .jnse .jnse-card {
	display: flex; flex-direction: column; min-width: 0;
	animation: jnse-in .45s var(--jn-ease) both;
}
@keyframes jnse-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

html body .jnse .jnse-card__media {
	position: relative; display: block; overflow: hidden;
	aspect-ratio: var(--jn-ratio);
	border-radius: var(--jn-radius);
	background: var(--jn-surface);
	text-decoration: none;
}
html body .jnse .jnse-card__media img.jnse-card__img,
html body .jnse .jnse-card__media img {
	position: absolute; inset: 0;
	width: 100%; height: 100%; max-width: none; margin: 0;
	object-fit: cover; border-radius: 0; box-shadow: none;
	transition: transform .7s var(--jn-ease), opacity .45s var(--jn-ease);
}
html body .jnse .jnse-card:hover .jnse-card__img { transform: scale(1.05); }
html body .jnse .jnse-card__img--hover { opacity: 0; }
@media (hover: hover) {
	html body .jnse .jnse-card.has-hover:hover .jnse-card__img--hover { opacity: 1; }
}
html body .jnse .jnse-card.is-out .jnse-card__img { filter: grayscale(.4); opacity: .75; }

html body .jnse .jnse-badges { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 1; }
html body .jnse .jnse-badge {
	display: inline-block; padding: 5px 10px; border-radius: 999px;
	font-size: 11.5px; font-weight: 700; letter-spacing: .02em; line-height: 1.1; text-transform: uppercase;
	color: #fff; background: var(--jn-sale);
}
html body .jnse .jnse-badge--out { background: var(--jn-text); }
html body .jnse .jnse-badge--hot { background: var(--jn-accent); color: var(--jn-on-primary); }

html body .jnse .jnse-card__body { display: flex; flex-direction: column; flex: 1; padding: 14px 4px 0; text-align: left; }
html body .jnse .jnse-card__cat {
	margin: 0 0 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
	color: var(--jn-muted);
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html body .jnse .jnse-card__title {
	margin: 0 0 8px; padding: 0;
	font-family: var(--jn-font-heading);
	font-size: clamp(14.5px, 1.3vw, 16.5px); font-weight: 600; line-height: 1.35; letter-spacing: 0;
	text-transform: none;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
	min-height: 2.7em;
}
html body .jnse .jnse-card__title a { color: var(--jn-text); text-decoration: none; background: none; box-shadow: none; }
html body .jnse .jnse-card__title a:hover { color: var(--jn-primary); text-decoration: underline; text-underline-offset: 3px; }
html body .jnse .jnse-card__rating { margin: 0 0 6px; font-size: 12px; }
html body .jnse .jnse-card__rating .star-rating { float: none; margin: 0; color: var(--jn-accent); }

html body .jnse .jnse-card__price { margin: 0 0 14px; font-size: 17px; font-weight: 700; color: var(--jn-text); line-height: 1.3; }
html body .jnse .jnse-card__price .price,
html body .jnse .jnse-card__price .amount,
html body .jnse .jnse-card__price bdi { color: inherit; font-size: inherit; font-weight: inherit; }
html body .jnse .jnse-card__price del { margin-right: 6px; font-size: .82em; font-weight: 400; color: var(--jn-muted); opacity: 1; }
html body .jnse .jnse-card__price del .amount { color: var(--jn-muted); }
html body .jnse .jnse-card__price ins { text-decoration: none; color: var(--jn-sale); background: none; }
html body .jnse .jnse-card__price ins .amount { color: var(--jn-sale); }

html body .jnse .jnse-card__actions { margin-top: auto; }
html body .jnse .jnse-card__actions .added_to_cart { display: none !important; } /* we open the mini-cart instead */

/* ---------- Buttons ---------- */
html body .jnse .jnse-btn,
html body .jnse a.jnse-btn.button {
	-webkit-appearance: none; appearance: none;
	position: relative;
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 46px; margin: 0; padding: 0 22px;
	font-family: var(--jn-font-body); font-size: 14px; font-weight: 600; line-height: 1.1; letter-spacing: .01em;
	text-transform: none; text-decoration: none; text-align: center; white-space: nowrap;
	color: var(--jn-on-primary); background: var(--jn-primary);
	border: 1px solid var(--jn-primary); border-radius: 999px;
	box-shadow: none; cursor: pointer;
	transition: background .2s, color .2s, border-color .2s, transform .15s, box-shadow .2s;
}
html body .jnse .jnse-btn:hover,
html body .jnse a.jnse-btn.button:hover { color: var(--jn-on-primary); background: var(--jn-primary-hover); border-color: var(--jn-primary-hover); }
html body .jnse .jnse-btn:active { transform: scale(.97); }
html body .jnse .jnse-btn:focus-visible { outline: 2px solid var(--jn-accent); outline-offset: 2px; }
html body .jnse .jnse-btn svg { width: 18px; height: 18px; }
html body .jnse .jnse-btn--cart,
html body .jnse a.jnse-btn--cart.button { width: 100%; }

html body .jnse .jnse-btn--ghost,
html body .jnse a.jnse-btn--ghost { color: var(--jn-text); background: transparent; border-color: var(--jn-border); }
html body .jnse .jnse-btn--ghost:hover,
html body .jnse a.jnse-btn--ghost:hover { color: var(--jn-on-primary); background: var(--jn-primary); border-color: var(--jn-primary); }

/* WooCommerce adds .loading / .added to the button during AJAX add-to-cart */
html body .jnse a.jnse-btn.loading { color: transparent; pointer-events: none; opacity: 1; }
html body .jnse a.jnse-btn.loading::after {
	content: ""; position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
	border: 2px solid color-mix(in srgb, var(--jn-on-primary) 35%, transparent); border-top-color: var(--jn-on-primary); border-radius: 50%;
	animation: jnse-spin .7s linear infinite;
	font-family: inherit; vertical-align: baseline; /* reset WC icon-font spinner */
}
html body .jnse a.jnse-btn.added::after { content: none; display: none; }
html body .jnse a.jnse-btn.added { background: var(--jn-primary-hover); }

@media (max-width: 480px) {
	html body .jnse .jnse-btn--cart { min-height: 42px; padding: 0 10px; font-size: 13px; }
	html body .jnse .jnse-btn--cart svg { display: none; }
	html body .jnse .jnse-card__body { padding-top: 10px; }
	html body .jnse .jnse-card__price { font-size: 15.5px; margin-bottom: 10px; }
}

/* ---------- Empty / load more ---------- */
html body .jnse .jnse-empty { text-align: center; padding: 60px 16px; color: var(--jn-muted); }
html body .jnse .jnse-empty[hidden] { display: none; }
html body .jnse .jnse-empty svg { width: 44px; height: 44px; margin-bottom: 10px; }
html body .jnse .jnse-empty p { margin: 0 0 6px; }
html body .jnse .jnse-empty__title { font-family: var(--jn-font-heading); font-size: 20px; font-weight: 600; color: var(--jn-text); }
html body .jnse .jnse-empty .jnse-btn { margin-top: 16px; }

html body .jnse .jnse-more { display: flex; flex-direction: column; align-items: center; margin-top: 40px; }
html body .jnse .jnse-more .jnse-btn { min-width: 240px; }
html body .jnse .jnse-more .jnse-btn[hidden] { display: none; }
html body .jnse .jnse-sentinel { width: 100%; height: 1px; }
html body .jnse.is-appending .jnse-more .jnse-btn { color: transparent; pointer-events: none; }
html body .jnse.is-appending .jnse-more .jnse-btn::after {
	content: ""; position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
	border: 2px solid var(--jn-border); border-top-color: var(--jn-primary); border-radius: 50%;
	animation: jnse-spin .7s linear infinite;
}

/* Skeleton cards while loading a new filter on an empty grid */
html body .jnse .jnse-skel { border-radius: var(--jn-radius); }
html body .jnse .jnse-skel__img { aspect-ratio: var(--jn-ratio); border-radius: var(--jn-radius); }
html body .jnse .jnse-skel__line { height: 12px; margin-top: 12px; border-radius: 6px; width: 70%; }
html body .jnse .jnse-skel__line.is-short { width: 40%; }
html body .jnse .jnse-skel__img,
html body .jnse .jnse-skel__line {
	background: linear-gradient(90deg, var(--jn-surface) 25%, var(--jn-border) 50%, var(--jn-surface) 75%);
	background-size: 200% 100%; animation: jnse-shimmer 1.2s infinite;
}
@keyframes jnse-shimmer { to { background-position: -200% 0; } }

@media (max-width: 640px) {
	html body .jnse .jnse-toolbar { flex-direction: column; gap: 10px; }
	html body .jnse .jnse-sort select { width: 100%; height: 46px; }
	html body .jnse .jnse-search input[type="search"] { height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
	html body .jnse *, html body .jnse *::before, html body .jnse *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Hide theme's own WooCommerce shop chrome if a builder still prints it on this page */
body.jnse-shop-page .woocommerce-products-header,
body.jnse-shop-page .woocommerce-result-count,
body.jnse-shop-page .woocommerce-ordering { display: none; }
