/**
 * SayWOW Promotions - Frontend Styles
 * 
 * Handles display of Level 1 (2x1 Featured) and Level 2 (Corner Flash) promotions
 * Compatible with WooCommerce product grids and WOOF filters
 */

/* ===================================
   LEVEL 1 FEATURED PROMOTIONS (2x1)
   =================================== */

.saywow-promo-level-1 {
	position: relative;
	/* Grid spanning handled by inline styles for theme compatibility */
}

.saywow-promo-level-1 .woocommerce-loop-product__link {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.saywow-promo-level-1 .woocommerce-loop-product__title {
	font-size: 1.3em !important;
	font-weight: 600;
	line-height: 1.3;
	margin-bottom: 0.5em;
}

.saywow-promo-level-1 .woocommerce-loop-product__image {
	margin-bottom: 1em;
}

/* Level 1 Badge */
.saywow-promo-badge-level-1 {
	display: inline-block;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
	padding: 6px 12px;
	border-radius: 4px;
	font-size: 0.85em;
	font-weight: 700;
	margin-bottom: 10px;
	text-transform: uppercase;
	letter-spacing: 1px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ===================================
   LEVEL 2 CORNER FLASH PROMOTIONS
   =================================== */

.saywow-promo-level-2 {
	position: relative;
}

/* Corner Flash Triangle */
.saywow-promo-flash {
	position: absolute;
	top: 0;
	right: 0;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 0 70px 70px 0;
	border-color: transparent #e74c3c transparent transparent;
	z-index: 10;
	pointer-events: none;
}

.saywow-promo-flash-text {
	position: absolute;
	top: 10px;
	right: -58px;
	transform: rotate(45deg);
	color: white;
	font-size: 9px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	white-space: nowrap;
	text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* ===================================
   PRICING DISPLAY
   =================================== */

/* Savings Badge */
.saywow-savings-badge {
	display: inline-block;
	background: #27ae60;
	color: white;
	padding: 3px 8px;
	border-radius: 3px;
	font-size: 0.8em;
	font-weight: 600;
	margin-left: 6px;
	vertical-align: middle;
}

/* Strikethrough Original Price */
.has-saywow-promotion .price del {
	opacity: 0.6;
	font-size: 0.9em;
}

.has-saywow-promotion .price ins {
	text-decoration: none;
	font-weight: 600;
	color: #e74c3c;
}

/* ===================================
   GENERAL PROMOTIONAL BADGE
   =================================== */

.saywow-promo-badge {
	display: inline-block;
	background: #3498db;
	color: white;
	padding: 5px 12px;
	border-radius: 4px;
	font-size: 0.85em;
	font-weight: 600;
	margin-bottom: 10px;
	text-transform: uppercase;
	letter-spacing: 0.8px;
	box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* ===================================
   WOOCOMMERCE GRID COMPATIBILITY
   =================================== */

/* Ensure promotional products work with standard WooCommerce grids */
.woocommerce ul.products li.product.saywow-promo-level-1,
.woocommerce-page ul.products li.product.saywow-promo-level-1 {
	margin-bottom: 2.5em;
}

/* Ensure proper aspect ratio for images */
.saywow-promo-level-1 img {
	width: 100%;
	height: auto;
}

/* ===================================
   WOOF FILTER COMPATIBILITY
   =================================== */

/* Maintain promotional display after AJAX filtering */
.woof_container_inner .saywow-promo-level-1 {
	grid-column: span 2;
}

/* Loading state */
.woof_ajax_loader .has-saywow-promotion {
	opacity: 0.6;
	transition: opacity 0.3s ease;
}

/* ===================================
   RESPONSIVE BREAKPOINTS
   =================================== */

/* Tablets */
@media (max-width: 1024px) {
	.saywow-promo-level-1 .woocommerce-loop-product__title {
		font-size: 1.2em !important;
	}
	
	.saywow-promo-flash {
		border-width: 0 60px 60px 0;
	}
	
	.saywow-promo-flash-text {
		font-size: 8px;
		right: -50px;
	}
}

/* Mobile Landscape */
@media (max-width: 768px) {
	.saywow-promo-level-1 {
		grid-column: span 2 !important;
	}
	
	.saywow-promo-badge-level-1 {
		font-size: 0.75em;
		padding: 4px 10px;
	}
}

/* Mobile Portrait */
@media (max-width: 480px) {
	.saywow-promo-level-1 {
		grid-column: span 1 !important;
	}
	
	.saywow-promo-level-1 .woocommerce-loop-product__title {
		font-size: 1.1em !important;
	}
	
	.saywow-promo-flash {
		border-width: 0 50px 50px 0;
	}
	
	.saywow-promo-flash-text {
		font-size: 7px;
		right: -42px;
		top: 8px;
	}
	
	.saywow-savings-badge {
		font-size: 0.75em;
		padding: 2px 6px;
	}
}

/* ===================================
   THEME COMPATIBILITY HELPERS
   =================================== */

/* Ensure relative positioning on product containers */
.has-saywow-promotion {
	position: relative;
}

/* Prevent flash from affecting layout */
.has-saywow-promotion .saywow-promo-flash {
	position: absolute;
}

/* Ensure z-index hierarchy */
.has-saywow-promotion .saywow-promo-flash {
	z-index: 10;
}

.has-saywow-promotion .woocommerce-loop-product__link {
	z-index: 1;
}

/* ===================================
   ACCESSIBILITY
   =================================== */

.saywow-promo-flash-text,
.saywow-savings-badge,
.saywow-promo-badge {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Focus states for keyboard navigation */
.has-saywow-promotion:focus-within {
	outline: 2px solid #3498db;
	outline-offset: 2px;
}

/* ===================================
   PRINT STYLES
   =================================== */

@media print {
	.saywow-promo-flash,
	.saywow-promo-badge {
		display: none;
	}
}
