/* ==========================================================================
   Phase 7 — Feature 10: Luxury Product Catalog Layout, Image Carousel & Cards
   (Tamannaah & Swarovski Style — Mobile Luxury Pack)
   IMPORTANT: Desktop view (screens >= 1025px) is 100% UNTOUCHED!
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESKTOP VIEW GUARDS (screens >= 1025px) — ZERO DESKTOP INTERFERENCE
   -------------------------------------------------------------------------- */
@media (min-width: 1025px) {
	/* Hide mobile luxury toolbar completely on desktop */
	.spf-catalog-toolbar {
		display: none !important;
	}

	/* Hide mobile interactive carousel completely on desktop */
	.spf-lux-carousel {
		display: none !important;
	}

	/* Desktop pointer hover: second gallery image (optional) */
	.spf-p7-card-second-wrap {
		display: block;
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		overflow: hidden;
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.28s ease;
		z-index: 2;
	}

	.spf-p7-card-second-img {
		width: 100%;
		height: 100%;
		object-fit: cover;
		display: block;
		transform: scale(1.01);
		transition: transform 0.35s ease;
	}

	ul.products li.product:hover .spf-p7-card-second-wrap,
	.products > .product:hover .spf-p7-card-second-wrap {
		opacity: 1;
	}

	ul.products li.product:hover .spf-p7-card-second-img,
	.products > .product:hover .spf-p7-card-second-img {
		transform: scale(1.04);
	}

	/* Desktop hover quick-add */
	.spf-p7-card-qa-wrap {
		position: relative;
		z-index: 5;
		margin: -40px 10px 10px;
		opacity: 0;
		transform: translateY(6px);
		transition: opacity 0.2s ease, transform 0.2s ease;
		pointer-events: none;
	}

	ul.products li.product:hover .spf-p7-card-qa-wrap,
	.products > .product:hover .spf-p7-card-qa-wrap {
		opacity: 1;
		transform: translateY(0);
		pointer-events: auto;
	}
}

/* --------------------------------------------------------------------------
   2. MOBILE & TABLET LUXURY LAYOUT (screens <= 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {

	/* Hide desktop second-image wrapper on touch screens */
	.spf-p7-card-second-wrap {
		display: none !important;
	}

	/* -----------------------------------------------------------------------
	   2.1 Catalog Toolbar: "View : Two | One" + "Filter & Sort"
	   ----------------------------------------------------------------------- */
	.spf-catalog-toolbar {
		display: flex !important;
		align-items: center !important;
		justify-content: space-between !important;
		padding: 12px 4px 14px !important;
		margin-bottom: 14px !important;
		border-bottom: 1px solid #f1f5f9 !important;
		font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
		box-sizing: border-box !important;
	}

	.spf-view-control {
		display: inline-flex !important;
		align-items: center !important;
		gap: 10px !important;
		font-size: 13px !important;
	}

	.spf-view-label {
		color: #64748b !important;
		font-weight: 500 !important;
		letter-spacing: 0.01em !important;
	}

	.spf-view-opt {
		appearance: none !important;
		-webkit-appearance: none !important;
		background: transparent !important;
		border: 0 !important;
		border-bottom: 2px solid transparent !important;
		padding: 0 2px 2px !important;
		font-family: inherit !important;
		font-size: 13px !important;
		font-weight: 500 !important;
		color: #94a3b8 !important;
		cursor: pointer !important;
		line-height: 1.2 !important;
		transition: all 0.15s ease !important;
		-webkit-tap-highlight-color: transparent !important;
	}

	.spf-view-opt.is-active {
		color: #0f172a !important;
		font-weight: 700 !important;
		border-bottom-color: #0f172a !important;
	}

	.spf-toolbar-filter-btn {
		appearance: none !important;
		-webkit-appearance: none !important;
		background: transparent !important;
		border: 0 !important;
		padding: 0 !important;
		font-family: inherit !important;
		font-size: 13px !important;
		font-weight: 600 !important;
		color: #0f172a !important;
		cursor: pointer !important;
		display: inline-flex !important;
		align-items: center !important;
		gap: 6px !important;
		transition: opacity 0.15s ease !important;
		-webkit-tap-highlight-color: transparent !important;
	}

	.spf-toolbar-filter-btn:hover {
		opacity: 0.8 !important;
	}

	/* Suppress redundant filter bar when luxury toolbar is active */
	body.spf-has-lux-grid .mfx-shop-bar {
		display: none !important;
	}

	/* -----------------------------------------------------------------------
	   2.2 Mobile Grid Engine (Default 2 Columns, Switchable to 1 Column)
	   ----------------------------------------------------------------------- */
	body.spf-has-lux-grid ul.products,
	body.spf-has-lux-grid .products,
	body.spf-has-lux-grid .ct-products-container {
		display: grid !important;
		list-style: none !important;
		padding: 0 !important;
		margin: 0 0 32px 0 !important;
		box-sizing: border-box !important;
	}

	/* Default 2-column mobile layout (Tamannaah & Swarovski standard) */
	body.spf-grid-2 ul.products,
	body.spf-grid-2 .products,
	body.spf-grid-2 .ct-products-container,
	body.spf-has-lux-grid:not(.spf-grid-1) ul.products,
	body.spf-has-lux-grid:not(.spf-grid-1) .products,
	body.spf-has-lux-grid:not(.spf-grid-1) .ct-products-container {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 16px 10px !important;
	}

	/* 1-column editorial layout ("One" clicked) */
	body.spf-grid-1 ul.products,
	body.spf-grid-1 .products,
	body.spf-grid-1 .ct-products-container {
		grid-template-columns: minmax(0, 1fr) !important;
		gap: 26px 0 !important;
	}

	/* -----------------------------------------------------------------------
	   2.3 Mobile Luxury Product Card (Borderless, Clutter-Free)
	   ----------------------------------------------------------------------- */
	.spf-lux-card,
	ul.products li.product.spf-lux-card,
	.products > .product.spf-lux-card {
		position: relative !important;
		display: flex !important;
		flex-direction: column !important;
		background: #ffffff !important;
		border: 0 !important;
		border-radius: 0 !important;
		box-shadow: none !important;
		padding: 0 !important;
		margin: 0 !important;
		text-align: left !important;
		overflow: visible !important;
		width: 100% !important;
		box-sizing: border-box !important;
	}

	/* Hide Blocksy default thumbnail and theme elements on mobile cards */
	.spf-lux-card .ct-image-container,
	.spf-lux-card > .woocommerce-LoopProduct-link,
	.spf-lux-card > a:first-child:not(.spf-lux-slide-link) {
		display: none !important;
	}

	/* Hide mobile button clutter & star ratings on card */
	.spf-lux-card .button.add_to_cart_button,
	.spf-lux-card .ct-product-actions,
	.spf-lux-card .star-rating {
		display: none !important;
	}

	/* -----------------------------------------------------------------------
	   2.4 Mobile Image Carousel & Media Container (Tamannaah & Swarovski)
	   ----------------------------------------------------------------------- */
	.spf-lux-card .spf-lux-carousel {
		display: block !important;
		position: relative !important;
		width: 100% !important;
		aspect-ratio: 1 / 1 !important;
		background: #f8fafc !important;
		border-radius: 4px !important;
		overflow: hidden !important;
		box-sizing: border-box !important;
		border: 1px solid rgba(15, 23, 42, 0.04) !important;
		user-select: none !important;
		-webkit-user-select: none !important;
		touch-action: pan-y !important;
	}

	/* Optional 4:5 aspect ratio in 1-column editorial mode */
	body.spf-grid-1 .spf-lux-card .spf-lux-carousel {
		aspect-ratio: 1 / 1.05 !important;
	}

	.spf-lux-slides {
		position: relative !important;
		width: 100% !important;
		height: 100% !important;
	}

	.spf-lux-slide {
		position: absolute !important;
		inset: 0 !important;
		width: 100% !important;
		height: 100% !important;
		opacity: 0 !important;
		pointer-events: none !important;
		transition: opacity 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
	}

	.spf-lux-slide.is-active {
		opacity: 1 !important;
		pointer-events: auto !important;
	}

	.spf-lux-slide[hidden] {
		display: none !important;
	}

	.spf-lux-slide-link {
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
		width: 100% !important;
		height: 100% !important;
		text-decoration: none !important;
		-webkit-tap-highlight-color: transparent !important;
	}

	.spf-lux-slide img,
	.spf-lux-slide .spf-lux-img {
		width: 100% !important;
		height: 100% !important;
		object-fit: cover !important;
		display: block !important;
	}

	/* Swarovski style: Contain uncropped jewelry */
	.spf-lux-carousel.is-fit-contain .spf-lux-slide img,
	.spf-lux-carousel.is-fit-contain .spf-lux-slide .spf-lux-img {
		object-fit: contain !important;
		padding: 6px !important;
		box-sizing: border-box !important;
	}

	/* -----------------------------------------------------------------------
	   2.5 Sleek Minimalist Chevrons (< and >)
	   ----------------------------------------------------------------------- */
	.spf-lux-arrow {
		appearance: none !important;
		-webkit-appearance: none !important;
		position: absolute !important;
		top: 50% !important;
		transform: translateY(-50%) !important;
		z-index: 5 !important;
		width: 24px !important;
		height: 24px !important;
		border-radius: 50% !important;
		background: rgba(255, 255, 255, 0.85) !important;
		-webkit-backdrop-filter: blur(4px) !important;
		backdrop-filter: blur(4px) !important;
		border: 0 !important;
		color: #0f172a !important;
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
		cursor: pointer !important;
		padding: 0 !important;
		box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
		transition: all 0.15s ease !important;
		-webkit-tap-highlight-color: transparent !important;
	}

	.spf-lux-arrow:active {
		transform: translateY(-50%) scale(0.92) !important;
	}

	.spf-lux-prev {
		left: 6px !important;
	}

	.spf-lux-next {
		right: 6px !important;
	}

	/* -----------------------------------------------------------------------
	   2.6 Subtle Pagination Dots / Pill Indicator (Tamannaah Style)
	   ----------------------------------------------------------------------- */
	.spf-lux-dots {
		position: absolute !important;
		bottom: 7px !important;
		left: 50% !important;
		transform: translateX(-50%) !important;
		display: flex !important;
		align-items: center !important;
		gap: 4px !important;
		z-index: 6 !important;
		pointer-events: none !important;
	}

	.spf-lux-dot {
		display: block !important;
		width: 4.5px !important;
		height: 4.5px !important;
		border-radius: 50% !important;
		background: rgba(0, 0, 0, 0.24) !important;
		transition: all 0.2s ease !important;
	}

	.spf-lux-dot.is-active {
		width: 13px !important;
		border-radius: 3px !important;
		background: #0f172a !important;
	}

	/* -----------------------------------------------------------------------
	   2.7 Floating Wishlist Heart (Top-Right)
	   ----------------------------------------------------------------------- */
	.spf-lux-card .spf-wl-btn {
		position: absolute !important;
		top: 8px !important;
		right: 8px !important;
		z-index: 8 !important;
		width: 30px !important;
		height: 30px !important;
		border-radius: 50% !important;
		background: rgba(255, 255, 255, 0.88) !important;
		-webkit-backdrop-filter: blur(4px) !important;
		backdrop-filter: blur(4px) !important;
		border: 0 !important;
		color: #0f172a !important;
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
		cursor: pointer !important;
		padding: 0 !important;
		box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06) !important;
		transition: transform 0.15s ease, color 0.15s ease !important;
		-webkit-tap-highlight-color: transparent !important;
	}

	.spf-lux-card .spf-wl-btn:active {
		transform: scale(0.9) !important;
	}

	.spf-lux-card .spf-wl-btn.is-on {
		color: #e11d48 !important;
	}

	.spf-lux-card .spf-wl-btn.is-on svg {
		fill: #e11d48 !important;
		stroke: #e11d48 !important;
	}

	/* -----------------------------------------------------------------------
	   2.8 Floating Badges (Top-Left)
	   ----------------------------------------------------------------------- */
	.spf-lux-badge {
		position: absolute !important;
		top: 8px !important;
		left: 8px !important;
		z-index: 7 !important;
		font-size: 9.5px !important;
		font-weight: 700 !important;
		line-height: 1 !important;
		letter-spacing: 0.06em !important;
		text-transform: uppercase !important;
		padding: 3px 6px !important;
		border-radius: 2px !important;
		pointer-events: none !important;
	}

	.spf-lux-badge--sale {
		background: #0f172a !important;
		color: #ffffff !important;
	}

	.spf-lux-badge--featured {
		background: #ffffff !important;
		color: #0f172a !important;
		box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
	}

	.spf-lux-badge--soldout {
		background: #475569 !important;
		color: #ffffff !important;
	}

	/* -----------------------------------------------------------------------
	   2.9 Mobile Card Typography & Pricing (Tamannaah & Swarovski)
	   ----------------------------------------------------------------------- */
	.spf-lux-card .woocommerce-loop-product__title,
	.spf-lux-card .product_title,
	.spf-lux-card h2,
	.spf-lux-card h3 {
		font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
		font-size: 12.5px !important;
		font-weight: 600 !important;
		letter-spacing: 0.02em !important;
		text-transform: uppercase !important;
		color: #0f172a !important;
		margin: 9px 0 3px !important;
		line-height: 1.35 !important;
		text-align: left !important;
		display: -webkit-box !important;
		-webkit-line-clamp: 2 !important;
		-webkit-box-orient: vertical !important;
		overflow: hidden !important;
	}

	.spf-lux-card .price {
		font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
		font-size: 13px !important;
		font-weight: 600 !important;
		color: #0f172a !important;
		margin: 0 !important;
		text-align: left !important;
		line-height: 1.3 !important;
		display: flex !important;
		align-items: baseline !important;
		flex-wrap: wrap !important;
		flex-direction: row-reverse !important;
		justify-content: flex-end !important;
		gap: 5px !important;
	}

	.spf-lux-card .price ins {
		text-decoration: none !important;
		color: #0f172a !important;
		font-weight: 700 !important;
	}

	.spf-lux-card .price del {
		color: #94a3b8 !important;
		font-size: 11.5px !important;
		font-weight: 400 !important;
		margin-right: 3px !important;
	}

	/* -----------------------------------------------------------------------
	   2.10 Mobile Circular Pagination (Tamannaah & Shopify Style)
	   ----------------------------------------------------------------------- */
	body.spf-has-lux-grid nav.woocommerce-pagination {
		margin: 20px 0 32px !important;
		text-align: center !important;
		border: 0 !important;
	}

	body.spf-has-lux-grid nav.woocommerce-pagination ul {
		display: inline-flex !important;
		align-items: center !important;
		gap: 6px !important;
		border: 0 !important;
		padding: 0 !important;
		list-style: none !important;
	}

	body.spf-has-lux-grid nav.woocommerce-pagination ul li {
		border: 0 !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	body.spf-has-lux-grid nav.woocommerce-pagination ul li a,
	body.spf-has-lux-grid nav.woocommerce-pagination ul li span {
		min-width: 36px !important;
		height: 36px !important;
		border-radius: 50% !important;
		display: inline-flex !important;
		align-items: center !important;
		justify-content: center !important;
		font-size: 13px !important;
		font-weight: 600 !important;
		border: 1px solid #e2e8f0 !important;
		background: #ffffff !important;
		color: #0f172a !important;
		line-height: 1 !important;
		padding: 0 !important;
		text-decoration: none !important;
	}

	body.spf-has-lux-grid nav.woocommerce-pagination ul li span.current {
		background: #0f172a !important;
		color: #ffffff !important;
		border-color: #0f172a !important;
	}
}

/* --------------------------------------------------------------------------
   3. Quick-Add Overlay Button (Optional)
   -------------------------------------------------------------------------- */
.spf-p7-card-qa-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 8px 12px;
	border-radius: 4px;
	border: 1px solid rgba(15, 23, 42, 0.12);
	background: rgba(255, 255, 255, 0.95);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	color: #0f172a !important;
	font-size: 12px;
	font-weight: 700;
	text-decoration: none !important;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
	transition: all 0.18s ease;
}

.spf-p7-card-qa-btn:hover {
	background: #0f172a;
	color: #ffffff !important;
	border-color: #0f172a;
}

.spf-p7-card-qa-btn.is-loading {
	opacity: 0.75;
	pointer-events: none;
}
