/**
 * Warren Cat Promo Layout Styles
 * 
 * Styles for Advanced Ads promo layout group type.
 * Replicates the promo slider styling from the Warren Cat theme.
 * 
 * @package WcatOffers
 * @since 1.0.0
 */

/* ==========================================================================
   Base Layout Styles
   ========================================================================== */

.wcat-promo-layout {
	position: relative;
	overflow: hidden;
	margin: 0;
	padding: 0;
}

.wcat-promo-layout .container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
}

/* ==========================================================================
   Promo Cards Grid
   ========================================================================== */

.wcat-promo-layout .promo-cards {
	display: flex;
	flex-direction: column;
	gap: 20px;
	margin-bottom: 40px;
}

.wcat-promo-layout .promo-row {
	display: flex;
	gap: 20px;
	justify-content: center;
	align-items: stretch;
}

/* Row configurations based on promo slider logic */
.wcat-promo-layout .promo-row.row-1 {
	justify-content: center;
}

.wcat-promo-layout .promo-row.row-1 .promo {
	flex: 0 0 100%;
	max-width: 600px;
}

.wcat-promo-layout .promo-row.row-2 {
	justify-content: center;
}

.wcat-promo-layout .promo-row.row-2 .promo {
	flex: 0 0 calc(50% - 10px);
}

.wcat-promo-layout .promo-row.row-3 {
	justify-content: center;
}

.wcat-promo-layout .promo-row.row-3 .promo {
	flex: 0 0 calc(33.333% - 14px);
}

/* ==========================================================================
   Individual Promo Cards
   ========================================================================== */

.wcat-promo-layout .promo {
	position: relative;
	display: block;
	min-height: 300px;
	background-size: cover !important;
	background-position: center !important;
	background-repeat: no-repeat !important;
	border-radius: 8px;
	overflow: hidden;
	text-decoration: none;
	color: white;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	cursor: pointer;
}

.wcat-promo-layout .promo:hover {
	transform: translateY(-5px);
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
	text-decoration: none;
	color: white;
}

.wcat-promo-layout .promo:focus {
	outline: 3px solid #007cba;
	outline-offset: 2px;
}

/* Overlay for better text readability */
.wcat-promo-layout .promo::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(45deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.1) 100%);
	z-index: 1;
}

.wcat-promo-layout .promo > * {
	position: relative;
	z-index: 2;
}

/* ==========================================================================
   Promo Flag/Label
   ========================================================================== */

.wcat-promo-layout .promo .flag {
	position: absolute;
	top: 20px;
	left: 20px;
	background: #ff6b35;
	color: white;
	padding: 6px 12px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: bold;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	z-index: 3;
}

.wcat-promo-layout .promo .flag.offer {
	background: #ff6b35;
}

.wcat-promo-layout .promo .flag.sale {
	background: #e74c3c;
}

.wcat-promo-layout .promo .flag.new {
	background: #27ae60;
}

.wcat-promo-layout .promo .flag.featured {
	background: #f39c12;
}

.wcat-promo-layout .promo .flag.limited {
	background: #8e44ad;
}

/* ==========================================================================
   Promo Content
   ========================================================================== */

.wcat-promo-layout .promo h3 {
	position: absolute;
	top: 60px;
	left: 20px;
	right: 20px;
	margin: 0;
	font-size: 24px;
	font-weight: bold;
	line-height: 1.2;
	color: white;
	text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.wcat-promo-layout .promo > p {
	position: absolute;
	top: 110px;
	left: 20px;
	right: 20px;
	margin: 0;
	font-size: 16px;
	line-height: 1.4;
	color: rgba(255, 255, 255, 0.9);
	text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

/* ==========================================================================
   Promo Details (Bottom Section)
   ========================================================================== */

.wcat-promo-layout .promo .details {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 20px;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

.wcat-promo-layout .promo .details > div {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.wcat-promo-layout .promo .details p {
	margin: 0;
	font-size: 14px;
	line-height: 1.4;
	color: rgba(255, 255, 255, 0.8);
}

.wcat-promo-layout .promo .details > div > span {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	color: white;
}

.wcat-promo-layout .promo .details .btn-text {
	font-size: 14px;
}

.wcat-promo-layout .promo .details .arrow-right {
	display: inline-flex;
	align-items: center;
	transition: transform 0.3s ease;
}

.wcat-promo-layout .promo:hover .details .arrow-right {
	transform: translateX(5px);
}

.wcat-promo-layout .promo .details .arrow-right svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

/* ==========================================================================
   Mobile Layout
   ========================================================================== */

.wcat-promo-layout .mobile-promos {
	display: none;
	overflow: hidden;
}

.wcat-promo-layout .promotions-slider {
	display: flex;
	gap: 20px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	padding: 0 20px;
	margin: 0 -20px;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.wcat-promo-layout .promotions-slider::-webkit-scrollbar {
	display: none;
}

.wcat-promo-layout .promotions-slider .promo {
	flex: 0 0 320px;
	scroll-snap-align: start;
	min-height: 200px;
}

.wcat-promo-layout .promotions-slider .promo > span {
	position: absolute;
	bottom: 20px;
	left: 20px;
	right: 20px;
}

.wcat-promo-layout .promotions-slider .promo h3 {
	position: static;
	margin: 0 0 8px 0;
	font-size: 18px;
}

.wcat-promo-layout .promotions-slider .promo p {
	position: static;
	margin: 0;
	font-size: 14px;
}

/* Mobile stack layout */
.wcat-promo-layout .mobile-promos-stack {
	display: flex;
	flex-direction: column;
	gap: 15px;
}

.wcat-promo-layout .mobile-promos-stack .promo {
	min-height: 180px;
}

/* Mobile grid layout */
.wcat-promo-layout .mobile-promos-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 15px;
}

.wcat-promo-layout .mobile-promos-grid .promo {
	min-height: 150px;
}

/* Slider indicators */
.wcat-promo-layout .slider-indicators {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 20px;
	padding: 0;
}

.wcat-promo-layout .slider-indicator {
	width: 12px;
	height: 12px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.4);
	cursor: pointer;
	transition: background-color 0.3s ease, transform 0.2s ease;
	padding: 0;
}

.wcat-promo-layout .slider-indicator:hover {
	background: rgba(255, 255, 255, 0.7);
	transform: scale(1.1);
}

.wcat-promo-layout .slider-indicator.active {
	background: #ff6b35;
	transform: scale(1.2);
}

.wcat-promo-layout .slider-indicator:focus {
	outline: 2px solid #007cba;
	outline-offset: 2px;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 768px) {
	.wcat-promo-layout .promo-cards {
		display: none;
	}
	
	.wcat-promo-layout .mobile-promos {
		display: block;
	}
	
	.wcat-promo-layout .container {
		padding: 0 15px;
	}
}

@media (max-width: 992px) {
	.wcat-promo-layout .promo-row.row-3 .promo {
		flex: 0 0 calc(50% - 10px);
	}
	
	.wcat-promo-layout .promo-row.row-3 .promo:nth-child(3) {
		flex: 0 0 100%;
		margin-top: 20px;
	}
}

@media (max-width: 576px) {
	.wcat-promo-layout .promotions-slider .promo {
		flex: 0 0 280px;
	}
	
	.wcat-promo-layout .mobile-promos-grid {
		grid-template-columns: 1fr;
	}
	
	.wcat-promo-layout .promo h3 {
		font-size: 20px;
	}
	
	.wcat-promo-layout .promo > p {
		font-size: 14px;
	}
}

/* ==========================================================================
   Accessibility Enhancements
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	.wcat-promo-layout .promo {
		transition: none;
	}
	
	.wcat-promo-layout .promo:hover {
		transform: none;
	}
	
	.wcat-promo-layout .promo:hover .details .arrow-right {
		transform: none;
	}
}

/* High contrast mode support */
@media (prefers-contrast: high) {
	.wcat-promo-layout .promo::before {
		background: linear-gradient(45deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.6) 50%, rgba(0, 0, 0, 0.4) 100%);
	}
	
	.wcat-promo-layout .promo .flag {
		border: 2px solid white;
	}
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
	.wcat-promo-layout .mobile-promos {
		display: none !important;
	}
	
	.wcat-promo-layout .promo-cards {
		display: block !important;
	}
	
	.wcat-promo-layout .promo {
		break-inside: avoid;
		background: #f5f5f5 !important;
		color: #333 !important;
		border: 1px solid #ddd;
		min-height: auto !important;
		padding: 20px;
	}
	
	.wcat-promo-layout .promo::before {
		display: none !important;
	}
	
	.wcat-promo-layout .promo h3,
	.wcat-promo-layout .promo p {
		position: static !important;
		color: #333 !important;
		text-shadow: none !important;
	}
	
	.wcat-promo-layout .promo .details {
		position: static !important;
		background: none !important;
		padding: 10px 0 0 0 !important;
	}
}

/* ==========================================================================
   Custom Layout Variations
   ========================================================================== */

/* Single row layout */
.wcat-promo-layout.layout-single-row .promo-cards {
	flex-direction: row;
	flex-wrap: nowrap;
	overflow-x: auto;
}

.wcat-promo-layout.layout-single-row .promo-row {
	flex: 0 0 auto;
}

/* Two rows layout */
.wcat-promo-layout.layout-two-rows .promo-cards {
	max-height: 640px;
}

/* Custom grid layout */
.wcat-promo-layout.layout-custom-grid .promo-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	grid-gap: 20px;
}

.wcat-promo-layout.layout-custom-grid .promo-row {
	display: contents;
}

/* Mobile behavior variations */
.wcat-promo-layout.mobile-slider .mobile-promos {
	/* Default slider behavior - already defined above */
}

.wcat-promo-layout.mobile-stack .promotions-slider {
	display: none;
}

.wcat-promo-layout.mobile-stack .mobile-promos-stack {
	display: flex;
}

.wcat-promo-layout.mobile-grid .promotions-slider {
	display: none;
}

.wcat-promo-layout.mobile-grid .mobile-promos-grid {
	display: grid;
}

/* ==========================================================================
   Debug Mode (for development)
   ========================================================================== */

.wcat-promo-layout.debug-mode .promo {
	border: 2px dashed #ff0000;
}

.wcat-promo-layout.debug-mode .promo-row {
	border: 1px solid #00ff00;
}

.wcat-promo-layout.debug-mode .promo::after {
	content: attr(data-ad-id);
	position: absolute;
	top: 5px;
	right: 5px;
	background: rgba(255, 255, 255, 0.8);
	color: #000;
	padding: 2px 6px;
	font-size: 10px;
	border-radius: 3px;
	z-index: 10;
} 