/**
 * PrintUnicorn Campaigns - Frontend Styles
 *
 * @package PrintUnicorn_Campaigns
 * @since 1.0.0
 */

/* ==========================================================================
   Campaign Badge
   ========================================================================== */

.puc-campaign-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 10;
	padding: 5px 12px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border-radius: 3px;
	line-height: 1.4;
}

/* Badge Sizes */
.puc-badge-small {
	padding: 3px 8px;
	font-size: 10px;
}

.puc-badge-large {
	padding: 8px 16px;
	font-size: 14px;
	letter-spacing: 1px;
}

/* Animated pulse effect for urgency */
.puc-badge-urgent {
	animation: puc-pulse 2s infinite;
}

@keyframes puc-pulse {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.05); }
}

/* Ensure product container has relative positioning */
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product,
.single-product .woocommerce-product-gallery {
	position: relative;
}

/* ==========================================================================
   Shop/Archive Page Badge
   ========================================================================== */

.puc-shop-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	background: #dc2626;
	color: #fff;
	padding: 5px 10px;
	font-size: 12px;
	font-weight: 700;
	border-radius: 4px;
	z-index: 10;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	line-height: 1.3;
	box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
}

.puc-shop-badge.puc-badge-urgent {
	animation: puc-pulse 2s infinite;
}

/* ==========================================================================
   Mini Countdown for Shop Pages
   ========================================================================== */

.puc-mini-countdown {
	font-size: 11px;
	color: #dc2626;
	margin-top: 5px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
}

.puc-mini-countdown-icon {
	font-size: 12px;
}

.puc-mini-countdown-text {
	opacity: 0.8;
}

.puc-mini-countdown-timer {
	font-weight: 600;
}

/* Inline countdown for banners */
.puc-mini-countdown-inline {
	display: inline;
	font-weight: 600;
}

/* ==========================================================================
   Category Banner
   ========================================================================== */

.puc-category-banner {
	background: linear-gradient(90deg, #dc2626, #b91c1c);
	color: #fff;
	padding: 15px 20px;
	text-align: center;
	margin-bottom: 20px;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

.puc-category-banner-content {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 15px;
	flex-wrap: wrap;
}

.puc-category-banner-text {
	font-size: 16px;
	font-weight: 600;
	letter-spacing: 0.3px;
}

.puc-category-banner-countdown {
	font-size: 14px;
	opacity: 0.95;
	display: flex;
	align-items: center;
	gap: 5px;
}

.puc-category-banner-countdown::before {
	content: '⏰';
}

/* ==========================================================================
   Discount Badge (on price)
   ========================================================================== */

.puc-discount-badge {
	display: inline-block;
	background-color: #e74c3c;
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 6px;
	border-radius: 3px;
	margin-left: 5px;
	vertical-align: middle;
}

/* ==========================================================================
   Price Display
   ========================================================================== */

.woocommerce .puc-sale-price del {
	color: #999;
	font-size: 0.9em;
	margin-right: 5px;
}

.woocommerce .puc-sale-price ins {
	color: #e74c3c;
	font-weight: 600;
	text-decoration: none;
}

/* ==========================================================================
   Countdown Timer
   ========================================================================== */

.puc-countdown-timer {
	background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
	color: #fff;
	padding: 15px 20px;
	border-radius: 8px;
	margin: 15px 0;
	text-align: center;
}

.puc-countdown-label {
	display: block;
	font-size: 14px;
	font-weight: 500;
	margin-bottom: 10px;
	opacity: 0.9;
}

.puc-countdown-display {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 5px;
}

.puc-countdown-days,
.puc-countdown-hours,
.puc-countdown-minutes,
.puc-countdown-seconds {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 50px;
	padding: 8px;
	background: rgba(255, 255, 255, 0.15);
	border-radius: 5px;
}

.puc-countdown-number {
	font-size: 24px;
	font-weight: 700;
	line-height: 1;
}

.puc-countdown-unit {
	font-size: 10px;
	text-transform: uppercase;
	opacity: 0.8;
	margin-top: 4px;
}

.puc-countdown-separator {
	font-size: 24px;
	font-weight: 700;
	opacity: 0.6;
}

.puc-countdown-expired {
	background: #95a5a6;
}

.puc-countdown-expired .puc-countdown-display {
	display: none;
}

.puc-countdown-expired-message {
	font-size: 14px;
	font-weight: 500;
}

/* ==========================================================================
   Bulk Discount Notice
   ========================================================================== */

.puc-bulk-discount-notice {
	background-color: #f0f7ff;
	border: 1px solid #2271b1;
	border-left-width: 4px;
	color: #1d4ed8;
	padding: 12px 15px;
	margin: 15px 0;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 500;
}

.puc-bogo-notice {
	background-color: #ecfdf5;
	border: 1px solid #059669;
	border-left-width: 4px;
	color: #047857;
	padding: 12px 15px;
	margin: 15px 0;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 500;
}

/* ==========================================================================
   Cart Styles
   ========================================================================== */

.puc-free-item {
	display: inline-block;
	background-color: #27ae60;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 3px;
	text-transform: uppercase;
}

.puc-bogo-tag {
	display: inline-block;
	color: #27ae60;
	font-size: 12px;
	font-weight: 600;
	margin-left: 5px;
}

.puc-bulk-tag {
	display: inline-block;
	color: #2271b1;
	font-size: 12px;
	font-weight: 600;
	margin-left: 5px;
}

/* Cart Savings Row */
.puc-cart-savings th,
.puc-cart-savings td {
	background-color: #f0fff4 !important;
	border-top: 2px solid #27ae60 !important;
}

.puc-cart-savings th {
	display: flex;
	align-items: center;
	gap: 8px;
}

.puc-savings-icon {
	font-size: 18px;
	line-height: 1;
}

.puc-savings-amount {
	color: #27ae60;
	font-weight: 700;
	font-size: 1.1em;
	display: block;
}

.puc-savings-message {
	display: block;
	font-size: 12px;
	color: #666;
	font-weight: 400;
	margin-top: 3px;
}

/* Cart Savings Notice */
.puc-cart-savings-notice {
	background-color: #f0fff4;
	border: 1px solid #27ae60;
	border-left-width: 4px;
	padding: 12px 15px;
	margin: 15px 0;
	border-radius: 4px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.puc-cart-savings-notice .puc-savings-icon {
	font-size: 24px;
}

.puc-cart-savings-notice .puc-savings-text {
	font-size: 14px;
	color: #1a7f37;
	font-weight: 500;
}

/* Campaign Tags in Cart */
.puc-bogo-tag,
.puc-bulk-tag,
.puc-flash-tag,
.puc-seasonal-tag,
.puc-clearance-tag {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	padding: 3px 8px;
	border-radius: 3px;
	margin-left: 5px;
	vertical-align: middle;
}

.puc-bogo-tag {
	background-color: #ecfdf5;
	color: #059669;
	border: 1px solid #a7f3d0;
}

.puc-bulk-tag {
	background-color: #eff6ff;
	color: #2563eb;
	border: 1px solid #bfdbfe;
}

.puc-flash-tag {
	background-color: #fef3c7;
	color: #d97706;
	border: 1px solid #fcd34d;
}

.puc-seasonal-tag {
	background-color: #fce7f3;
	color: #db2777;
	border: 1px solid #fbcfe8;
}

.puc-clearance-tag {
	background-color: #fef2f2;
	color: #dc2626;
	border: 1px solid #fecaca;
}

/* BOGO Quantity (readonly) */
.puc-bogo-quantity {
	display: inline-block;
	background-color: #f3f4f6;
	color: #6b7280;
	font-weight: 600;
	padding: 8px 16px;
	border-radius: 4px;
	text-align: center;
}

/* Free Item Badge */
.puc-free-item {
	display: inline-block;
	background-color: #27ae60;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 3px;
	text-transform: uppercase;
}

/* ==========================================================================
   Cart Item Price with Discount
   ========================================================================== */

.woocommerce-cart-form .cart_item .product-price del,
.woocommerce-checkout-review-order-table .cart_item .product-price del {
	color: #999;
	font-size: 0.85em;
	display: block;
}

.woocommerce-cart-form .cart_item .product-price ins,
.woocommerce-checkout-review-order-table .cart_item .product-price ins {
	color: #e74c3c;
	font-weight: 600;
	text-decoration: none;
}

/* Cart Subtotal with Discount */
.woocommerce-cart-form .cart_item .product-subtotal del,
.woocommerce-checkout-review-order-table .cart_item .product-total del {
	color: #999;
	font-size: 0.85em;
	display: block;
}

.woocommerce-cart-form .cart_item .product-subtotal ins,
.woocommerce-checkout-review-order-table .cart_item .product-total ins {
	color: #e74c3c;
	font-weight: 600;
	text-decoration: none;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media screen and (max-width: 600px) {
	.puc-countdown-display {
		gap: 3px;
	}

	.puc-countdown-days,
	.puc-countdown-hours,
	.puc-countdown-minutes,
	.puc-countdown-seconds {
		min-width: 40px;
		padding: 6px;
	}

	.puc-countdown-number {
		font-size: 18px;
	}

	.puc-countdown-separator {
		font-size: 18px;
	}

	.puc-campaign-badge {
		font-size: 10px;
		padding: 4px 8px;
	}
}

/* ==========================================================================
   Animation
   ========================================================================== */

@keyframes puc-pulse {
	0% {
		transform: scale(1);
	}
	50% {
		transform: scale(1.05);
	}
	100% {
		transform: scale(1);
	}
}

.puc-countdown-timer.puc-countdown-urgent {
	animation: puc-pulse 1s ease-in-out infinite;
}

/* Flash sale badge animation */
@keyframes puc-flash {
	0%, 100% {
		opacity: 1;
	}
	50% {
		opacity: 0.7;
	}
}

.puc-campaign-badge.puc-flash-sale {
	animation: puc-flash 1.5s ease-in-out infinite;
}

/* ==========================================================================
   Top Sticky Banner
   ========================================================================== */

/* Base banner styles */
.puc-top-banner {
	padding: 12px 50px 12px 20px;
	display: flex;
	justify-content: center;
	align-items: center;
	font-weight: 600;
	font-size: 14px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Sticky Banner (default) */
.puc-top-banner.puc-banner-sticky {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 99999;
}

.admin-bar .puc-top-banner.puc-banner-sticky {
	top: 32px;
}

@media screen and (max-width: 782px) {
	.admin-bar .puc-top-banner.puc-banner-sticky {
		top: 46px;
	}
}

/* Body padding for sticky banner */
body.puc-has-sticky-banner {
	padding-top: 50px !important;
}

.admin-bar.puc-has-sticky-banner {
	padding-top: 50px !important;
}

/* Static Banner (scrolls with page) */
.puc-top-banner.puc-banner-static {
	position: relative;
	z-index: 100;
}

/* No extra body padding needed for static */
body.puc-has-static-banner {
	padding-top: 0;
}

.puc-banner-content {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 10px;
	max-width: 1200px;
	margin: 0 auto;
	padding-right: 40px;
}

.puc-banner-text {
	text-align: center;
}

.puc-banner-countdown {
	display: flex;
	align-items: center;
	gap: 5px;
}

.puc-banner-countdown .puc-countdown-timer {
	background: rgba(255, 255, 255, 0.2);
	padding: 4px 10px;
	border-radius: 4px;
	font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
	font-size: 13px;
	font-weight: 700;
	margin: 0;
}

.puc-banner-cta {
	display: inline-block;
	background: #fff;
	padding: 6px 16px;
	border-radius: 4px;
	text-decoration: none;
	font-weight: 700;
	font-size: 13px;
	transition: transform 0.2s, box-shadow 0.2s;
}

.puc-banner-cta:hover {
	transform: translateY(-1px);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	text-decoration: none;
}

.puc-banner-close {
	position: absolute;
	right: 15px;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.2);
	border: none;
	color: #fff;
	font-size: 18px;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	padding: 0;
	transition: background 0.2s;
}

.puc-banner-close:hover {
	background: rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   Popup Overlay & Content
   ========================================================================== */

.puc-popup-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.75);
	z-index: 999999;
	justify-content: center;
	align-items: center;
	padding: 20px;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.puc-popup-overlay.active {
	display: flex;
	opacity: 1;
}

.puc-popup-content {
	background: #fff;
	padding: 50px 40px 40px;
	border-radius: 16px;
	max-width: 480px;
	width: 100%;
	text-align: center;
	position: relative;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	animation: puc-popup-slide-in 0.3s ease;
}

@keyframes puc-popup-slide-in {
	from {
		opacity: 0;
		transform: translateY(-20px) scale(0.95);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.puc-popup-close {
	position: absolute;
	top: 12px;
	right: 15px;
	background: none;
	border: none;
	font-size: 32px;
	cursor: pointer;
	color: #666;
	line-height: 1;
	padding: 5px;
	transition: color 0.2s;
}

.puc-popup-close:hover {
	color: #000;
}

.puc-popup-icon {
	font-size: 48px;
	margin-bottom: 15px;
}

.puc-popup-title {
	font-size: 28px;
	font-weight: 700;
	margin: 0 0 15px;
	color: #1a1a1a;
}

.puc-popup-message {
	font-size: 18px;
	color: #4a5568;
	margin: 0 0 20px;
	line-height: 1.5;
}

.puc-popup-countdown {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin-bottom: 25px;
	font-size: 14px;
	color: #666;
}

.puc-popup-countdown .puc-countdown-timer {
	background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
	color: #fff;
	padding: 6px 12px;
	border-radius: 6px;
	font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
	font-weight: 700;
	margin: 0;
}

.puc-popup-cta {
	display: inline-block;
	background: #dc2626;
	color: #fff !important;
	padding: 16px 48px;
	border-radius: 8px;
	text-decoration: none;
	font-weight: 700;
	font-size: 16px;
	transition: transform 0.2s, box-shadow 0.2s;
	margin-bottom: 15px;
}

.puc-popup-cta:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 25px rgba(220, 38, 38, 0.35);
	color: #fff !important;
	text-decoration: none;
}

.puc-popup-no-thanks {
	margin: 0;
	font-size: 13px;
}

.puc-popup-no-thanks a,
.puc-popup-dismiss {
	color: #888;
	text-decoration: none;
	cursor: pointer;
	transition: color 0.2s;
}

.puc-popup-no-thanks a:hover,
.puc-popup-dismiss:hover {
	color: #333;
}

/* ==========================================================================
   Popup Email Form
   ========================================================================== */

.puc-popup-email-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-bottom: 20px;
}

.puc-popup-email-input {
	width: 100%;
	padding: 14px 18px;
	font-size: 16px;
	border: 2px solid #e5e7eb;
	border-radius: 8px;
	text-align: center;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.puc-popup-email-input:focus {
	outline: none;
	border-color: #dc2626;
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.puc-popup-email-submit {
	width: 100%;
	padding: 14px 24px;
	font-size: 16px;
	font-weight: 700;
	color: #fff;
	background: #dc2626;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: transform 0.2s, box-shadow 0.2s;
}

.puc-popup-email-submit:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 25px rgba(220, 38, 38, 0.35);
}

.puc-popup-email-submit:disabled {
	opacity: 0.7;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

/* ==========================================================================
   Popup Responsive Styles
   ========================================================================== */

@media screen and (max-width: 600px) {
	.puc-top-banner {
		padding: 10px 15px;
		font-size: 12px;
	}

	.puc-banner-content {
		padding-right: 30px;
	}

	.puc-banner-cta {
		padding: 5px 12px;
		font-size: 11px;
	}

	.puc-popup-content {
		padding: 40px 25px 30px;
	}

	.puc-popup-title {
		font-size: 22px;
	}

	.puc-popup-message {
		font-size: 15px;
	}

	.puc-popup-cta {
		padding: 14px 30px;
		font-size: 14px;
	}

	.puc-popup-icon {
		font-size: 36px;
	}
}

