/**
 * Advent Calendar Frontend Styles
 */

/* Calendar Grid */
.acwc-calendar-wrapper {
	position: relative;
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
	font-family: inherit; /* Use site's default font */
}

.acwc-calendar-wrapper * {
	font-family: inherit; /* Ensure all child elements inherit site's default font */
}

.acwc-calendar-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 15px;
	margin: 20px 0;
}

/* Responsive Grid */
@media (max-width: 768px) {
	.acwc-calendar-grid {
		grid-template-columns: repeat(4, 1fr);
		gap: 8px;
	}
	
	.acwc-calendar-wrapper {
		padding: 15px;
	}
	
	/* Modal tablet styles */
	.acwc-modal-content {
		padding: 25px 20px;
		max-width: 92%;
	}
	
	.acwc-box-title {
		font-size: 24px;
		margin-bottom: 7px;
	}
	
	.acwc-box-message {
		font-size: 14px;
		margin-bottom: 14px;
	}
	
	.acwc-coupon-code {
		padding: 18px 15px;
		margin: 18px 0;
	}
	
	.acwc-coupon-code strong {
		font-size: 24px;
		margin-bottom: 11px;
	}
	
	.acwc-copy-button {
		padding: 9px 22px;
		font-size: 13px;
	}
	
	.acwc-product-info {
		margin: 14px 0;
		padding: 14px;
	}
	
	.acwc-product-info img {
		max-height: 180px;
	}
	
	.acwc-add-to-cart-button {
		padding: 11px 25px;
		font-size: 14px;
	}
}

@media (max-width: 480px) {
	.acwc-calendar-grid {
		grid-template-columns: repeat(4, 1fr);
		gap: 6px;
	}
	
	.acwc-calendar-wrapper {
		padding: 10px;
	}
	
	.acwc-box {
		border-width: 2px;
		border-radius: 6px;
	}
	
	.acwc-day-number {
		font-size: 18px;
	}
	
	.acwc-checkmark {
		width: 24px;
		height: 24px;
		font-size: 16px;
		top: 3px;
		right: 3px;
	}
	
	.acwc-lock {
		font-size: 24px;
	}
	
	/* Modal mobile styles */
	.acwc-modal-content {
		padding: 15px 12px;
		max-width: 96%;
		width: 96%;
		border-radius: 12px;
		max-height: 98vh;
		overflow-y: auto;
		overflow-x: hidden;
		box-sizing: border-box;
	}
	
	.acwc-modal-close {
		width: 28px;
		height: 28px;
		font-size: 16px;
		top: 8px;
		right: 8px;
	}
	
	#acwc-box-content {
		padding: 0;
		overflow: hidden;
	}
	
	.acwc-box-title {
		font-size: 18px;
		margin-bottom: 4px;
		line-height: 1.2;
	}
	
	.acwc-box-message {
		font-size: 11px;
		margin-bottom: 10px;
		line-height: 1.3;
		padding: 0 5px;
	}
	
	.acwc-coupon-code {
		padding: 12px 10px;
		margin: 10px 0;
		border-radius: 8px;
		box-sizing: border-box;
	}
	
	.acwc-coupon-code strong {
		font-size: 16px;
		margin-bottom: 8px;
		letter-spacing: 0.3px;
		word-break: break-all;
		line-height: 1.2;
	}
	
	.acwc-copy-button {
		padding: 6px 16px;
		font-size: 11px;
		margin-top: 6px;
		border-radius: 15px;
		white-space: nowrap;
	}
	
	.acwc-product-info {
		margin: 10px 0;
		padding: 10px;
		border-radius: 8px;
		box-sizing: border-box;
	}
	
	.acwc-product-info img {
		max-height: 120px;
		margin-bottom: 6px;
		width: 100%;
		height: auto;
		object-fit: contain;
	}
	
	.acwc-product-info h3 {
		font-size: 13px;
		margin-bottom: 4px;
		line-height: 1.3;
		word-wrap: break-word;
	}
	
	.acwc-product-info > div {
		font-size: 12px;
		margin-bottom: 4px;
	}
	
	.acwc-product-info p {
		font-size: 11px;
		margin-bottom: 6px;
		line-height: 1.3;
	}
	
	.acwc-add-to-cart-button {
		padding: 8px 18px;
		font-size: 11px;
		margin-top: 8px;
		border-radius: 18px;
		letter-spacing: 0.2px;
		white-space: normal;
		word-wrap: break-word;
		width: 100%;
		box-sizing: border-box;
	}
	
	/* Magic link form mobile */
	.acwc-magic-link-form {
		padding: 10px;
		margin-bottom: 12px;
	}
	
	.acwc-magic-link-form p {
		font-size: 12px;
		margin-bottom: 6px;
		line-height: 1.3;
	}
	
	.acwc-magic-link-form input[type="email"] {
		padding: 6px;
		width: 100%;
		max-width: 100%;
		margin-right: 0;
		margin-bottom: 6px;
		font-size: 12px;
		box-sizing: border-box;
	}
	
	.acwc-magic-link-form button {
		padding: 6px 12px;
		font-size: 12px;
		width: 100%;
		box-sizing: border-box;
	}
}

/* Calendar Box */
.acwc-box {
	position: relative;
	aspect-ratio: 1;
	background: #fff;
	border: 3px solid #d32f2f;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.3s ease;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.acwc-box:hover:not(.acwc-locked):not(.acwc-disabled):not(.acwc-past) {
	transform: translateY(-5px);
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.acwc-box.acwc-past:hover {
	opacity: 0.6;
	cursor: pointer;
}

.acwc-box.acwc-locked {
	opacity: 0.6;
	cursor: not-allowed;
	background: #f5f5f5;
}

.acwc-box.acwc-disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.acwc-box.acwc-opened {
	background: #4caf50;
	border-color: #388e3c;
}

.acwc-box.acwc-past {
	opacity: 0.5;
	background: #e0e0e0;
	border-color: #9e9e9e;
	filter: grayscale(0.7);
}

.acwc-box.acwc-past .acwc-day-number {
	color: #757575;
}

.acwc-box.acwc-past.acwc-opened {
	background: #9e9e9e;
	border-color: #757575;
	opacity: 0.6;
}

.acwc-box.acwc-past.acwc-opened .acwc-day-number {
	color: #fff;
}

.acwc-box-inner {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 10px;
}

.acwc-day-number {
	font-size: 24px;
	font-weight: bold;
	color: #d32f2f;
	z-index: 2;
}

.acwc-box.acwc-opened .acwc-day-number {
	color: #fff;
}

.acwc-checkmark {
	position: absolute;
	top: 5px;
	right: 5px;
	font-size: 20px;
	color: #fff;
	background: #4caf50;
	border-radius: 50%;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.acwc-lock {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 32px;
	opacity: 0.5;
}

.acwc-box-icon {
	max-width: 80%;
	max-height: 80%;
	object-fit: contain;
}

/* Modal */
.acwc-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.acwc-modal.show {
	opacity: 1;
	pointer-events: all;
}

.acwc-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.75);
	backdrop-filter: blur(4px);
}

.acwc-modal-content {
	position: relative;
	background: #ffffff !important;
	border-radius: 20px;
	padding: 30px;
	max-width: 700px;
	width: 90%;
	max-height: 95vh;
	overflow-y: auto;
	overflow-x: hidden;
	z-index: 10001;
	box-shadow: 0 20px 60px rgba(68, 96, 132, 0.3);
	transform: scale(0.9) translateY(30px);
	opacity: 0;
	transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
	border: 2px solid #446084;
	box-sizing: border-box;
}

.acwc-modal.show .acwc-modal-content {
	transform: scale(1) translateY(0);
	opacity: 1;
}

/* Modal overlay animation */
.acwc-modal-overlay {
	opacity: 0;
	transition: opacity 0.3s ease;
}

.acwc-modal.show .acwc-modal-overlay {
	opacity: 1;
}


.acwc-modal-close {
	position: absolute;
	top: 15px;
	right: 15px;
	background: rgba(0, 0, 0, 0.05);
	border: none;
	font-size: 20px;
	cursor: pointer;
	color: #666;
	line-height: 1;
	padding: 0;
	margin: 0;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: all 0.3s ease;
	z-index: 10002;
	box-sizing: border-box;
	font-weight: 400;
	text-align: center;
}

.acwc-modal-close:hover {
	color: #000;
	background: rgba(0, 0, 0, 0.1);
	transform: rotate(90deg);
}

#acwc-box-content {
	padding: 10px 0;
	position: relative;
	overflow: hidden;
	box-sizing: border-box;
	width: 100%;
}

.acwc-box-title {
	font-size: 28px;
	font-weight: bold;
	margin-bottom: 8px;
	color: #446084;
	text-align: center;
	opacity: 0;
	transform: translateY(-10px);
	transition: all 0.4s ease 0.1s;
	word-wrap: break-word;
	overflow-wrap: break-word;
	max-width: 100%;
	box-sizing: border-box;
}

.acwc-modal.show .acwc-box-title {
	opacity: 1;
	transform: translateY(0);
}

.acwc-box-message {
	margin-bottom: 15px;
	font-size: 15px;
	line-height: 1.5;
	color: #555;
	text-align: center;
	opacity: 0;
	transform: translateY(-10px);
	transition: all 0.4s ease 0.15s;
	word-wrap: break-word;
	overflow-wrap: break-word;
	max-width: 100%;
	box-sizing: border-box;
}

.acwc-modal.show .acwc-box-message {
	opacity: 1;
	transform: translateY(0);
}

.acwc-coupon-code {
	background: #446084 !important;
	padding: 20px;
	border-radius: 12px;
	margin: 20px 0;
	text-align: center;
	position: relative;
	overflow: hidden;
	box-shadow: 0 8px 20px rgba(68, 96, 132, 0.3);
	opacity: 0;
	transform: translateY(20px);
	transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
}

.acwc-modal.show .acwc-coupon-code {
	opacity: 1;
	transform: translateY(0);
}


.acwc-coupon-code strong {
	font-size: 28px;
	color: #fff;
	display: block;
	margin-bottom: 12px;
	font-weight: 700;
	letter-spacing: 1px;
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	position: relative;
	z-index: 1;
	word-break: break-all;
	overflow-wrap: break-word;
	max-width: 100%;
}

.acwc-copy-button {
	background: #fff;
	color: #446084;
	border: 2px solid #fff;
	padding: 10px 25px;
	border-radius: 20px;
	cursor: pointer;
	margin-top: 10px;
	font-size: 14px;
	font-weight: 600;
	transition: all 0.3s ease;
	position: relative;
	z-index: 1;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.acwc-copy-button:hover {
	background: rgba(255, 255, 255, 0.95);
	color: #d26e4b;
	transform: translateY(-2px);
	box-shadow: 0 5px 15px rgba(68, 96, 132, 0.3);
}

.acwc-copy-button:active {
	transform: translateY(0);
}

.acwc-product-info {
	margin: 15px 0;
	padding: 15px;
	background: #f8f9fa !important;
	border-radius: 12px;
	border: 1px solid rgba(68, 96, 132, 0.15);
	opacity: 0;
	transform: translateY(20px);
	transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s, box-shadow 0.3s ease, border-color 0.3s ease;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	overflow: hidden;
}

.acwc-modal.show .acwc-product-info {
	opacity: 1;
	transform: translateY(0);
}

.acwc-product-info:hover {
	border-color: rgba(68, 96, 132, 0.3);
	box-shadow: 0 5px 20px rgba(68, 96, 132, 0.1);
}

.acwc-product-info img {
	max-width: 100%;
	max-height: 200px;
	height: auto;
	object-fit: contain;
	border-radius: 5px;
	margin-bottom: 10px;
}

.acwc-add-to-cart-button {
	background: #7a9c59 !important;
	color: #fff !important;
	border: none;
	padding: 12px 28px;
	border-radius: 25px;
	cursor: pointer;
	font-size: 15px;
	font-weight: 600;
	margin-top: 15px;
	display: inline-block;
	box-shadow: 0 4px 15px rgba(122, 156, 89, 0.3);
	transition: all 0.3s ease;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.acwc-add-to-cart-button:hover {
	background: #627D47 !important;
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(122, 156, 89, 0.4);
}

/* Animations */
@keyframes acwc-flip {
	0% {
		transform: rotateY(0);
	}
	50% {
		transform: rotateY(90deg);
	}
	100% {
		transform: rotateY(0);
	}
}

@keyframes acwc-scale {
	0% {
		transform: scale(1);
	}
	50% {
		transform: scale(1.1);
	}
	100% {
		transform: scale(1);
	}
}

@keyframes acwc-fade {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.acwc-box.opening {
	animation: acwc-flip 0.6s ease;
}

.acwc-box.opened-animation {
	animation: acwc-scale 0.3s ease;
}

/* Snow Effect */
.acwc-snow-effect {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	overflow: hidden;
	z-index: 1;
}

.acwc-snowflake {
	position: absolute;
	color: #fff;
	font-size: 20px;
	animation: acwc-fall linear infinite;
}

@keyframes acwc-fall {
	to {
		transform: translateY(100vh);
	}
}

/* Themes */
.acwc-calendar-wrapper[data-theme="christmas"] .acwc-box {
	border-color: #c62828;
	background: linear-gradient(135deg, #fff 0%, #ffebee 100%);
}

.acwc-calendar-wrapper[data-theme="christmas"] .acwc-box.acwc-opened {
	background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
}

.acwc-calendar-wrapper[data-theme="elegant"] .acwc-box {
	border-color: #424242;
	background: #fff;
}

.acwc-calendar-wrapper[data-theme="elegant"] .acwc-box.acwc-opened {
	background: #424242;
	border-color: #212121;
}

.acwc-calendar-wrapper[data-theme="playful"] .acwc-box {
	border-color: #ff9800;
	background: #fff3e0;
}

.acwc-calendar-wrapper[data-theme="playful"] .acwc-box.acwc-opened {
	background: #ff9800;
	border-color: #f57c00;
}

/* Magic Link Form */
.acwc-magic-link-form {
	background: #f5f5f5;
	padding: 15px;
	border-radius: 5px;
	margin-bottom: 20px;
}

.acwc-magic-link-form input[type="email"] {
	padding: 8px;
	width: 250px;
	margin-right: 10px;
	border: 1px solid #ddd;
	border-radius: 4px;
}

.acwc-magic-link-form button {
	padding: 8px 16px;
	background: #2271b1;
	color: #fff;
	border: none;
	border-radius: 4px;
	cursor: pointer;
}

.acwc-magic-link-form button:hover {
	background: #135e96;
}

#acwc-magic-link-message {
	margin-top: 10px;
	padding: 10px;
	border-radius: 4px;
}

#acwc-magic-link-message.success {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

#acwc-magic-link-message.error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

/* Canvas Confetti - ensure it appears above modal */
canvas[style*="position: fixed"] {
	z-index: 10010 !important;
	pointer-events: none !important;
}

/* Product Info Improvements */
.acwc-product-info {
	margin: 15px 0;
	padding: 15px;
	background: #f8f9fa;
	border-radius: 12px;
	border: 1px solid rgba(68, 96, 132, 0.15);
	transition: all 0.3s ease;
}

.acwc-product-info:hover {
	transform: translateY(-5px);
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.acwc-add-to-cart-button {
	background: #7a9c59;
	color: #fff;
	border: none;
	padding: 12px 28px;
	border-radius: 25px;
	cursor: pointer;
	font-size: 15px;
	font-weight: 600;
	margin-top: 15px;
	display: inline-block;
	transition: all 0.3s ease;
	box-shadow: 0 4px 15px rgba(122, 156, 89, 0.3);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.acwc-add-to-cart-button:hover {
	background: #627D47;
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(122, 156, 89, 0.4);
}

.acwc-add-to-cart-button:active {
	transform: translateY(-1px);
}

/* Teaser Message Styles */
.acwc-teaser-content {
	text-align: center;
	padding: 30px 20px;
}

.acwc-teaser-icon {
	font-size: 64px;
	margin-bottom: 20px;
	animation: acwc-pulse 2s ease-in-out infinite;
}

.acwc-teaser-message {
	font-size: 18px;
	line-height: 1.6;
	color: #333;
	margin: 0;
}

@media (max-width: 480px) {
	.acwc-teaser-content {
		padding: 20px 15px;
	}
	
	.acwc-teaser-icon {
		font-size: 48px;
		margin-bottom: 15px;
	}
	
	.acwc-teaser-message {
		font-size: 16px;
	}
}

/* Pulse animation for teaser icon */
@keyframes acwc-pulse {
	0%, 100% {
		transform: scale(1);
		opacity: 1;
	}
	50% {
		transform: scale(1.1);
		opacity: 0.8;
	}
}

