/* ==========================================================================
   Janele Hover Products — Shopify-style Best Sellers grid
   ========================================================================== */

.janele-bestsellers {
	--janele-fg: #111;
	--janele-bar: #000;
	--janele-bar-fg: #fff;
	--janele-gap: 22px;
	--janele-radius: 0px;
	max-width: 1600px;
	margin: 0 auto;
	padding: 20px 24px 40px;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
	color: var(--janele-fg);
}

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

/* Header row -------------------------------------------------------------- */
.janele-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 0 0 26px;
	position: relative;
}

.janele-title {
	flex: 1;
	text-align: center;
	margin: 0;
	font-size: clamp(22px, 2.4vw, 34px);
	font-weight: 500;
	letter-spacing: 0.5px;
}

.janele-viewall {
	position: absolute;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	text-decoration: underline;
	text-underline-offset: 4px;
	color: var(--janele-fg);
	font-size: 15px;
	letter-spacing: 0.5px;
}

.janele-demo-note {
	text-align: center;
	font-size: 13px;
	color: #888;
	margin: -14px 0 22px;
}

/* Slider ------------------------------------------------------------------ */
.janele-slider {
	position: relative;
	overflow: hidden;
}

.janele-track {
	display: flex;
	flex-wrap: nowrap;
	gap: var(--janele-gap);
	transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
	will-change: transform;
}

/* Card -------------------------------------------------------------------- */
.janele-card {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	/* CSS fallback width (JS overrides with an exact px value from per-view).
	   Keeps the layout horizontal even if JS is slow, cached, or blocked. */
	width: calc((100% - (var(--janele-gap) * 3)) / 4);
	min-width: 0;
}

@media (max-width: 1100px) {
	.janele-card { width: calc((100% - (var(--janele-gap) * 2)) / 3); }
}
@media (max-width: 800px) {
	.janele-card { width: calc((100% - var(--janele-gap)) / 2); }
}

/* Dots -------------------------------------------------------------------- */
.janele-dots {
	display: flex;
	justify-content: center;
	gap: 12px;
	margin-top: 34px;
}

.janele-bestsellers .janele-dot {
	width: 14px;
	height: 14px;
	border-radius: 50% !important;
	border: 1.5px solid #333 !important;   /* inactive: outlined ring */
	padding: 0 !important;
	margin: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	cursor: pointer;
	transition: background 0.25s ease, border-color 0.25s ease;
}

.janele-bestsellers .janele-dot:hover,
.janele-bestsellers .janele-dot:focus {
	border-color: #000 !important;
	outline: none;
}

.janele-bestsellers .janele-dot.is-active {
	background: #333 !important;           /* active: solid filled */
	border-color: #333 !important;
}

/* Media / image wrapper (the hover magic happens here) -------------------- */
.janele-bestsellers .janele-media {
	position: relative;
	overflow: hidden;
	border-radius: var(--janele-radius);
	aspect-ratio: 3 / 4;
	background: #f2f2f2;
	width: 100%;
}

.janele-bestsellers .janele-media-link {
	display: block;
	width: 100%;
	height: 100%;
}

.janele-bestsellers .janele-img {
	position: absolute !important;
	inset: 0;
	top: 0;
	left: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover !important;
	object-position: center top;
	margin: 0 !important;
	padding: 0 !important;
	display: block !important;
	transition: opacity 0.55s ease, transform 6s ease;
	backface-visibility: hidden;
}

.janele-bestsellers .janele-img--front {
	opacity: 1;
	z-index: 1;
}

.janele-bestsellers .janele-img--back {
	opacity: 0;
	z-index: 2;
}

/* On hover: swap to the back image + a subtle slow zoom */
.janele-media:hover .janele-img--front {
	opacity: 0;
}

.janele-media:hover .janele-img--back {
	opacity: 1;
	transform: scale(1.04);
}

/* "Quick ..." button ------------------------------------------------------ */
/* Card hover: black bg, white text. Direct hover: white bg, black text/border. */
.janele-bestsellers .janele-quick {
	position: absolute;
	z-index: 4;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) translateY(6px);
	background: #000000 !important;   /* black on card hover */
	color: #ffffff !important;        /* white text */
	border: 1px solid #000000 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	font-family: "Lato", Arial, sans-serif;
	font-size: 15px !important;
	font-weight: 500;
	letter-spacing: 3px;
	padding: 12px 26px;
	white-space: nowrap;
	opacity: 0;
	cursor: pointer;
	pointer-events: none;
	transition: opacity 0.35s ease, transform 0.35s ease,
	            background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.janele-bestsellers .janele-media:hover .janele-quick {
	opacity: 1;
	transform: translate(-50%, -50%);
	pointer-events: auto;
}

/* Direct hover on the Quick button: white bg, black text, black border */
.janele-bestsellers .janele-quick:hover,
.janele-bestsellers .janele-quick:focus {
	background: #ffffff !important;
	color: #000000 !important;
	border-color: #000000 !important;
	outline: none;
}

/* Sliding "ADD TO CART" bar ----------------------------------------------- */
/* Specs from the reference store:
   font: Lato, Arial, sans-serif · 12px · weight 500 · text-transform none
   text-align center · button height ~36px
   State 1 (default): hidden below the image
   State 2 (card hover): black background, white text
   State (card hover): black background, white text
   State (direct button hover): white background, black border, black text */
.janele-bestsellers .janele-atc {
	position: absolute;
	z-index: 5;
	left: 0;
	right: 0;
	bottom: 0;
	height: 36px;
	transform: translateY(100%);
	transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
	            background-color 0.25s ease,
	            color 0.25s ease,
	            border-color 0.25s ease;
	background: #000000 !important;   /* black on card hover */
	color: #ffffff !important;        /* white text */
	border: 1px solid #000000 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	text-shadow: none !important;
	box-sizing: border-box;
	cursor: pointer;
	padding: 0 10px;
	margin: 0;
	width: auto;
	font-family: "Lato", Arial, sans-serif;
	font-size: 12px !important;
	font-weight: 500;
	letter-spacing: 0.6px;
	line-height: 1;
	text-align: center;
	text-transform: none !important;
}

/* Reveal on card hover */
.janele-bestsellers .janele-media:hover .janele-atc {
	transform: translateY(0);
}

/* Direct hover on the button itself: white bg, black border, black text.
   Force over any theme :hover / :focus styles. */
.janele-bestsellers .janele-atc:hover,
.janele-bestsellers .janele-atc:focus,
.janele-bestsellers .janele-atc:active {
	background: #ffffff !important;
	color: #000000 !important;
	border-color: #000000 !important;
	box-shadow: none !important;
	outline: none;
}

.janele-bestsellers .janele-atc:disabled {
	cursor: default;
	opacity: 0.9;
}

.janele-bestsellers .janele-atc.is-added {
	background: #1f7a3d !important;
	border-color: #1f7a3d !important;
	color: #fff !important;
}

/* Below-image info -------------------------------------------------------- */
.janele-name {
	margin: 16px 0 6px;
	font-size: 17px;
	font-weight: 500;
	letter-spacing: 0.5px;
}

.janele-name a {
	color: var(--janele-fg);
	text-decoration: none;
}

.janele-price {
	font-size: 16px;
	color: #333;
}

.janele-price .janele-amount,
.janele-price .amount,
.janele-price .woocommerce-Price-amount {
	color: var(--janele-fg);
	font-weight: 500;
}

/* Colour swatches (revealed on hover, like the product image/CTA) --------- */
.janele-swatches {
	display: flex;
	gap: 10px;
	margin-top: 14px;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 0.35s ease, transform 0.35s ease;
	pointer-events: none;
}

.janele-card:hover .janele-swatches {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.janele-swatch {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, 0.2);
	box-shadow: inset 0 0 0 2px #fff;
	cursor: pointer;
}

/* Touch devices: no hover, so reveal the bar/badge on tap-focus ----------- */
@media (hover: none) {
	.janele-atc {
		transform: translateY(0);
	}
	.janele-quick {
		display: none;
	}
	/* No hover on touch: always show swatches */
	.janele-swatches {
		opacity: 1;
		transform: none;
		pointer-events: auto;
	}
}

/* Responsive -------------------------------------------------------------- */
/* per-view is set by JS via the data-per-view attribute and these breakpoints. */
@media (max-width: 800px) {
	.janele-title { text-align: left; }
	.janele-head { flex-wrap: wrap; }
	.janele-viewall { position: static; transform: none; }
}

@media (max-width: 480px) {
	.janele-atc { font-size: 12px; letter-spacing: 0.5px; height: 46px; }
	.janele-dots { margin-top: 24px; }
}

/* ==========================================================================
   Quick View modal
   ========================================================================== */
.janele-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	font-family: "Lato", Arial, sans-serif;
}
.janele-modal.is-open { display: block; }

.janele-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

.janele-modal-box {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: min(1100px, 92vw);
	max-height: 88vh;
	overflow: auto;
	background: #fff;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.janele-modal-close {
	position: absolute;
	top: 14px;
	right: 16px;
	z-index: 3;
	width: 38px;
	height: 38px;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	border-radius: 0 !important;
	font-size: 30px;
	line-height: 1;
	color: #333 !important;
	cursor: pointer;
	transition: color 0.2s ease;
}
.janele-modal-close:hover,
.janele-modal-close:focus,
.janele-modal-close:active {
	background: transparent !important;
	color: #000 !important;
	box-shadow: none !important;
	outline: none !important;
}

.janele-modal-loading {
	padding: 80px 20px;
	text-align: center;
	color: #888;
}

/* Quick View content ------------------------------------------------------ */
.janele-qv {
	display: grid;
	grid-template-columns: 1.1fr 1fr;
	gap: 34px;
	padding: 40px;
}

.janele-qv-gallery {
	display: grid;
	grid-template-columns: 72px 1fr;
	gap: 16px;
	align-items: start;
}

.janele-qv-thumbs {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.janele-qv-thumb {
	width: 72px;
	height: 92px;
	padding: 0;
	border: 1px solid #e2e2e2;
	background: #f6f6f6;
	cursor: pointer;
	overflow: hidden;
}
.janele-qv-thumb.is-active { border-color: #111; }
.janele-qv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.janele-qv-main {
	background: #f6f6f6;
	aspect-ratio: 3 / 4;
	overflow: hidden;
}
.janele-qv-mainimg { width: 100%; height: 100%; object-fit: cover; display: block; }

.janele-qv-title {
	margin: 0 0 10px;
	font-size: 24px;
	font-weight: 500;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: #111;
}
.janele-qv-price {
	font-size: 20px;
	color: #111;
	margin-bottom: 18px;
}
.janele-qv-desc {
	font-size: 14px;
	line-height: 1.6;
	color: #555;
	margin-bottom: 22px;
}

.janele-qv-attr { margin-bottom: 20px; }
.janele-qv-attr-name {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.5px;
	margin-bottom: 10px;
	color: #111;
}
.janele-qv-options { display: flex; flex-wrap: wrap; gap: 10px; }

.janele-qv-swatch {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 1px solid rgba(0,0,0,0.25);
	box-shadow: inset 0 0 0 3px #fff;
	cursor: pointer;
	padding: 0;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.janele-qv-swatch:hover,
.janele-qv-swatch.is-selected {
	box-shadow: inset 0 0 0 3px #fff, 0 0 0 2px #111;
	transform: scale(1.05);
}

.janele-qv-pill {
	min-width: 46px;
	padding: 10px 16px;
	border: 1px solid #ccc;
	background: #fff;
	border-radius: 30px;
	font-size: 13px;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.janele-qv-pill:hover,
.janele-qv-pill.is-selected {
	border-color: #111;
	background: #111;
	color: #fff;
}

.janele-qv-atc {
	width: 100%;
	margin-top: 8px;
	height: 52px;
	background: #000 !important;
	color: #fff !important;
	border: 1px solid #000 !important;
	border-radius: 0 !important;
	font-family: "Lato", Arial, sans-serif;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 2px;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}
.janele-qv-atc:hover {
	background: #fff !important;
	color: #000 !important;
}
.janele-qv-atc.is-added { background: #1f7a3d !important; border-color:#1f7a3d !important; color:#fff !important; }

.janele-qv-viewfull {
	display: inline-block;
	margin-top: 16px;
	font-size: 13px;
	color: #666;
	text-decoration: underline;
	text-underline-offset: 3px;
}

@media (max-width: 780px) {
	.janele-qv { grid-template-columns: 1fr; gap: 22px; padding: 46px 20px 24px; }
	.janele-qv-gallery { grid-template-columns: 60px 1fr; }
	.janele-qv-thumb { width: 60px; height: 76px; }
}

/* Grab cursor while dragging the slider */
.janele-slider.is-dragging { cursor: grabbing; }
.janele-slider.is-dragging .janele-track { transition: none; }
.janele-track {
	cursor: grab;
	-webkit-user-select: none;
	-moz-user-select: none;
	user-select: none;
	touch-action: pan-y;
}
.janele-track img {
	-webkit-user-drag: none;
	user-select: none;
}
/* Keep the interactive overlays clickable */
.janele-track .janele-quick,
.janele-track .janele-atc {
	pointer-events: auto;
}
