/*
 * WooCommerce FOMO & Wishlist - base styles
 * Dynamic colors, font sizes, and animation selection are injected inline
 * (see wcfw_build_dynamic_css()) so they can be controlled from
 * WooCommerce > FOMO Settings without editing this file.
 */

/* ---------------------------------------------------------------
 * 1. Flash sale ticker - full-width scrolling bar at the top of the
 *    product page. Heading animates (independently of the scroll);
 *    sub heading never animates.
 * --------------------------------------------------------------- */

.wcfw-ticker-wrap {
	position: relative;
	left: 50%;
	right: 50%;
	width: 100vw;
	margin-left: -50vw;
	margin-right: -50vw;
	overflow: hidden;
	white-space: nowrap;
	padding: 10px 0;
}

.wcfw-ticker-track {
	display: inline-flex;
	animation-name: wcfwTickerScroll;
	animation-duration: 22s;
	animation-timing-function: linear;
	animation-iteration-count: infinite;
	will-change: transform;
}

.wcfw-ticker-item {
	display: inline-flex;
	align-items: baseline;
	padding: 0 36px;
	flex-shrink: 0;
}

.wcfw-ticker-heading {
	display: inline-block;
	font-weight: 700;
	letter-spacing: 0.02em;
	white-space: nowrap;
}

.wcfw-ticker-subheading {
	display: inline-block;
	font-size: 0.8em;
	font-weight: 500;
	opacity: 0.92;
	margin-left: 8px;
	white-space: nowrap;
}

@keyframes wcfwTickerScroll {
	from {
		transform: translateX(0);
	}
	to {
		transform: translateX(-50%);
	}
}

@keyframes fomoPulseLoop {
	0%,
	100% {
		opacity: 1;
	}
	50% {
		opacity: 0.55;
	}
}

@keyframes fomoGlowLoop {
	0%,
	100% {
		box-shadow: 0 0 4px rgba(255, 255, 255, 0.25);
	}
	50% {
		box-shadow: 0 0 14px rgba(255, 255, 255, 0.85);
	}
}

/* ---------------------------------------------------------------
 * 2. Countdown timer - unit label sits inline with its number
 * --------------------------------------------------------------- */
.wcfw-countdown {
	margin: 4px 0 16px;
}

.wcfw-countdown-label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.wcfw-countdown-timer {
	display: flex;
	gap: 10px;
}

.wcfw-countdown-block {
	display: inline-flex;
	flex-direction: row;
	align-items: baseline;
	gap: 5px;
	padding: 8px 12px;
	border-radius: 6px;
	color: #ffffff;
}

.wcfw-countdown-value {
	font-size: 18px;
	font-weight: 700;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.wcfw-countdown-unit {
	font-size: 11px;
	text-transform: uppercase;
	opacity: 0.85;
	line-height: 1;
}

/* ---------------------------------------------------------------
 * 3. Low stock alert (uses real stock data; color/size/animation dynamic)
 * --------------------------------------------------------------- */
.wcfw-low-stock {
	font-weight: 600;
	margin: 0 0 14px;
	display: inline-block;
}

/* ---------------------------------------------------------------
 * 3b. Compact countdown on listing/grid cards - overlays the
 *     bottom-right corner of the product image.
 * --------------------------------------------------------------- */
 /* FORCE FLEX LAYOUT ON PRODUCT CARD */
body li.product.type-product {
    display: flex !important;
    flex-direction: column !important;
}

/* FORCE SUMMARY TO GROW */
body li.product.type-product .astra-shop-summary-wrap {
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1 !important;
}

/* FORCE COUNTDOWN TO BOTTOM */
body li.product.type-product .wcfw-mini-countdown {
    position: static !important;
    inset: auto !important;
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
    margin-top: auto !important;
    margin-bottom: 0 !important;
    padding: 2px !important;
    background-color: #ff1e3c !important;
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    border-radius: 2px !important;
    z-index: 99 !important;
}

.wcfw-mini-countdown {
    margin-top: 10px !important;
    width: 100%;
    justify-content: center; /* or left depending on your design */
}

/* ---------------------------------------------------------------
 * 4. Wishlist button placement helpers
 * --------------------------------------------------------------- */
.add_to_wishlist {
	margin-left: 10px;
	vertical-align: middle;
}

/* On listing/grid cards, overlay the heart on the top-right corner of the
   product image instead of sitting below Add to Cart. */
ul.products li.product {
	position: relative;
}

li.product .add_to_wishlist {
	position: absolute;
	top: 10px;
	left: 10px;
	margin: 0;
	z-index: 5;
}

.wcfw-processing {
	opacity: 0.6;
	pointer-events: none;
}

/* ---------------------------------------------------------------
 * 5. [fomo_products] shortcode grid
 * --------------------------------------------------------------- */
.wc-fomo-products ul.products {
	display: grid;
	grid-template-columns: repeat(var(--wcfw-columns, 4), 1fr);
	gap: 20px;
	list-style: none;
	padding: 0;
	margin: 0;
}

.wc-fomo-products ul.products li.product {
	width: 100% !important;
	margin: 0 !important;
	float: none !important;
}

@media (max-width: 782px) {
	.wc-fomo-products ul.products {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* Force 2 columns on mobile everywhere products are listed - the shop
   page's own grid, the category-grouped view, and both shortcodes -
   instead of the theme's default of collapsing to a single column. */
@media (max-width: 600px) {
	ul.products {
		display: grid !important;
		grid-template-columns: repeat(2, 1fr) !important;
		gap: 14px !important;
	}
	ul.products li.product {
		width: 100% !important;
		margin: 0 !important;
		float: none !important;
	}
}

.wc-fomo-no-products {
	text-align: center;
	opacity: 0.7;
}

/* ---------------------------------------------------------------
 * 6. My Account > Wishlist page
 * --------------------------------------------------------------- */
.wcfw-wishlist-table {
	width: 100%;
	border-collapse: collapse;
}

.wcfw-wishlist-row td {
	vertical-align: middle;
	padding: 12px 10px;
	border-bottom: 1px solid #eee;
}

.wcfw-wishlist-row-image img {
	width: 64px;
	height: auto;
	border-radius: 4px;
	display: block;
}

.wcfw-wishlist-row-name a {
	font-weight: 600;
	text-decoration: none;
}

.wcfw-wishlist-row-action {
	display: flex;
	align-items: center;
	gap: 12px;
	white-space: nowrap;
}

.wcfw-out-of-stock {
	color: #999;
	font-size: 13px;
}

.wcfw-wishlist-empty {
	text-align: center;
	opacity: 0.75;
	padding: 20px 0;
}

/* ---------------------------------------------------------------
 * 7. Shop page: view-by-category toggle + grouped layout
 * --------------------------------------------------------------- */
.wcfw-shop-controls {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin: 0 0 22px;
}

.wcfw-shop-view-toggle {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.wcfw-view-btn {
	display: inline-block;
	padding: 8px 16px;
	border-radius: 4px;
	border: 1px solid #ddd;
	text-decoration: none;
	font-weight: 600;
	font-size: 13px;
	color: #333333;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.wcfw-view-btn-active {
	background-color: #1a1a1a;
	color: #ffffff;
	border-color: #1a1a1a;
}

.wcfw-category-filter {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	margin-left: auto;
}

.wcfw-category-filter select {
	padding: 6px 10px;
}

.wcfw-parent-category-title {
	font-size: 22px;
	margin: 0 0 22px;
	padding-bottom: 12px;
	border-bottom: 2px solid #1a1a1a;
}

.wcfw-category-group {
	margin-bottom: 44px;
}

.wcfw-category-group-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
	padding-bottom: 10px;
	border-bottom: 1px solid #e5e5e5;
}

.wcfw-category-group-title {
	margin: 0;
	font-size: 16px;
}

.wcfw-category-group-link {
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

/* ---------------------------------------------------------------
 * 8. [fomo_flash_banner] carousel - shows 3 banners at once on
 *    desktop (2 on tablet, 1 on mobile), swipeable, with nav arrows
 *    and gentle auto-advance.
 * --------------------------------------------------------------- */
.wcfw-banner-carousel {
	position: relative;
	width: 100%;
}

.wcfw-banner-track {
	display: flex;
	gap: 14px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 2px;
	line-height: 0;
}

.wcfw-banner-track::-webkit-scrollbar {
	display: none;
}

.wcfw-banner-slide {
	scroll-snap-align: start;
}

/* Per-device slide widths are generated dynamically - see wcfw_build_dynamic_css(). */

.wcfw-banner-slide img,
.wcfw-banner-img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 6px;
}

.wcfw-banner-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: none;
	background: rgba(0, 0, 0, 0.55);
	color: #ffffff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
}

.wcfw-banner-prev {
	left: -14px;
}

.wcfw-banner-next {
	right: -14px;
}

@media (max-width: 600px) {
	.wcfw-banner-prev {
		left: 4px;
	}
	.wcfw-banner-next {
		right: 4px;
	}
}

/* ---------------------------------------------------------------
 * 9. Admin: banner slot rows (WooCommerce > FOMO Settings)
 * --------------------------------------------------------------- */
.wcfw-banner-row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 10px;
	padding: 14px 0;
	border-bottom: 1px solid #eee;
	max-width: 640px;
}

.wcfw-banner-preview {
	min-width: 100px;
	min-height: 1px;
}

.wcfw-banner-preview img {
	border-radius: 4px;
	border: 1px solid #ddd;
}

.wcfw-banner-row input[type="url"] {
	width: 100%;
	margin-top: 6px;
}

/* ---------------------------------------------------------------
 * 10. New Launch / Bestseller product badge
 * --------------------------------------------------------------- */
.wcfw-product-badge {
	display: inline-block;
	vertical-align: middle;
	margin-right: 0px;
	padding: 2px 4px;
	border-radius: 2px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

/* Force WooCommerce's star rating onto the same line as the badge. */
.woocommerce ul.products li.product .star-rating,
ul.products li.product .star-rating {
	display: inline-block;
	vertical-align: middle;
	float: none;
}

.woocommerce-product-gallery {
    position: relative;
}

.wcfw-single-product-badge {
	position: absolute;
    /* Position it relative to the top of the gallery */
    /* 565px is the standard height of your featured image viewport */
    top: 50px !important; 
    bottom: auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 1 !important;
    padding: 6px 15px;
    border-radius: 4px;
}

@media (max-width: 600px) {
  .wcfw-product-badge.wcfw-single-product-badge {
    top: 15px !important;
    left: 15px !important;
    bottom: auto !important;
    transform: none !important;
  }
}

.wcfw-product-badge--new_launch {
	animation: wcfwNewLaunchFade 2.4s ease-in-out infinite !important;
}

.wcfw-product-badge--bestseller {
	animation: wcfwBestsellerFade 2.4s ease-in-out infinite !important;
}

@keyframes wcfwNewLaunchFade {
	0%,
	100% {
		background-color: #ffffff;
		color: #003314;
	}
	50% {
		background-color: #adebb3;
		color: #003314;
	}
}

@keyframes wcfwBestsellerFade {
	0%,
	100% {
		background-color: #ffffff;
		color: #c0392b;
	}
	50% {
		background-color: #ffcbd1;
		color: #c0392b;
	}
}

/* ---------------------------------------------------------------
 * 11. "You Might Also Like" (sibling categories) on category archives
 * --------------------------------------------------------------- */
.wcfw-related-products {
	margin-top: 50px;
	padding-top: 30px;
	border-top: 1px solid #e5e5e5;
}

.wcfw-related-products-title {
	font-size: 20px;
	margin: 0 0 20px;
}

/* ---------------------------------------------------------------
 * 12. [fomo_category_carousel] - clickable category tiles
 * --------------------------------------------------------------- */
.wcfw-cat-carousel {
	position: relative;
}

.wcfw-cat-carousel-track {
	display: flex;
	gap: 24px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	padding: 6px 4px 14px;
}

.wcfw-cat-carousel-track::-webkit-scrollbar {
	display: none;
}

.wcfw-cat-carousel-slide {
	flex: 0 0 140px;
	scroll-snap-align: start;
	text-align: center;
}

.wcfw-cat-carousel-link {
	display: block;
	text-decoration: none !important;
	color: inherit;
}

.wcfw-cat-carousel-img-wrap {
	display: block;
	width: 120px;
	height: 120px;
	margin: 0 auto 10px;
	border-radius: 50%;
	overflow: hidden;
}

.wcfw-cat-carousel-prev,
.wcfw-cat-carousel-next {
	top: 66px; /* vertically centers on the 120px image circle, not the whole tile */
}

.wcfw-cat-carousel-prev {
	left: 0;
}

.wcfw-cat-carousel-next {
	right: 0;
}

.wcfw-cat-carousel-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}

.wcfw-cat-carousel-link:hover .wcfw-cat-carousel-img {
	transform: scale(1.12);
}

.wcfw-cat-carousel-label {
	display: block;
	font-weight: 600;
	font-size: 15px;
	text-decoration: none !important;
}

@media (max-width: 600px) {
	.wcfw-cat-carousel-prev,
	.wcfw-cat-carousel-next {
		top: 51px; /* vertically centers on the 90px mobile image circle */
	}
	.wcfw-cat-carousel-slide {
		flex: 0 0 100px;
	}
	.wcfw-cat-carousel-img-wrap {
		width: 90px;
		height: 90px;
	}
}

/* ---------------------------------------------------------------
 * 13. Admin: tab panels (WooCommerce > FOMO Settings)
 * --------------------------------------------------------------- */
.wcfw-nav-tab-wrapper {
	margin-bottom: 0;
}

.wcfw-tab-panel .form-table {
	margin-top: 0;
}
