/* Voucher Checkout Styles - Exact match to the image design */
.voucher-checkout-container {
	display: flex !important;
	flex-direction: row !important;
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
	gap: 40px;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	position: relative;
	/* Force layout with CSS Grid as fallback */
	display: grid !important;
	grid-template-columns: 1fr 250px !important;
	grid-template-areas: "main sidebar" !important;
	/* Ensure container contains all children */
	contain: layout !important;
	overflow: visible !important;
}

/* Force desktop layout on larger screens - More aggressive approach */
@media (min-width: 1025px) {
    .voucher-checkout-container .voucher-checkout-sidebar {
        display: block !important;
        width: 250px !important;
    }
	.voucher-checkout-container {
		display: flex !important;
		flex-direction: row !important;
		flex-wrap: nowrap !important;
	}
	
	.voucher-checkout-main {
		flex: 1 !important;
		max-width: 700px !important;
		order: 1 !important;
		width: auto !important;
		min-width: 0 !important;
	}
	
	.voucher-checkout-sidebar {
		width: 100% !important;
		min-width: 200px !important;
		order: 2 !important;
		flex-shrink: 0 !important;
		flex-grow: 0 !important;
		flex-basis: 450px !important;
	}
}

/* Base styles for main and sidebar */
.voucher-checkout-main {
	flex: 1;
	max-width: 700px;
	order: 1;
	grid-area: main;
}

 .voucher-checkout-sidebar{
	width: 450px !important;
	background: #f8f9fa !important;
	border-radius: 12px !important;
	padding: 24px !important;
	flex-shrink: 0 !important;
	order: 2 !important;
	flex-grow: 0 !important;
	flex-basis: 320px !important;
	grid-area: sidebar !important;
	min-height: 400px !important;
	border: 2px solid #ec982b !important;
	position: relative !important;
	z-index: 10 !important;
	overflow-y: hidden !important;
}

.voucher-checkout-sidebar #order_review .shipping {
	display: none !important;
}


/* Additional overrides to prevent theme conflicts */
.voucher-checkout-container * {
	box-sizing: border-box;
}

/* Override any theme CSS that might interfere */
body .voucher-checkout-container {
	display: grid !important;
	grid-template-columns: 1fr 320px !important;
	grid-template-areas: "main sidebar" !important;
	/* Prevent WooCommerce from breaking the layout */
	position: relative !important;
	z-index: 1 !important;
}

body .voucher-checkout-main {
	order: 1 !important;
	grid-area: main !important;
	/* Ensure main content stays in place */
	position: relative !important;
}

body .voucher-checkout-sidebar {
	order: 2 !important;
	grid-area: sidebar !important;
	/* Force sidebar to stay within container */
	position: relative !important;
	/* Prevent any external CSS from moving it */
	float: none !important;
	clear: none !important;
}

/* Force the layout with additional CSS */
.voucher-checkout-container {
	display: grid !important;
	grid-template-columns: 1fr 320px !important;
	grid-template-areas: "main sidebar" !important;
	align-items: start !important;
}

.voucher-checkout-main {
	grid-area: main !important;
}

.voucher-checkout-sidebar {
	grid-area: sidebar !important;
}

/* Emergency fix: If sidebar gets moved outside container, force it back */
body .voucher-checkout-sidebar:not(.voucher-checkout-container .voucher-checkout-sidebar) {
	display: none !important;
}

/* Ensure the sidebar is always visible when inside the container */
.voucher-checkout-container .voucher-checkout-sidebar {
	display: block !important;
	width: 450px !important;
}

/* Section Styling */
.voucher-section {
	margin-bottom: 40px;
}

.section-title {
	    font-size: 20px !important;
	font-weight: 600  !important;
	color: #2d3748  !important;
	margin-bottom: 20px  !important;
}


.section-description {
	font-size: 14px;
	color: #718096;
	margin-bottom: 20px;
	line-height: 1.5;
}

/* Option Grid */
.option-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

/* Option Cards */
.option-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 24px 20px;
	border: 2px solid #e2e8f0;
	border-radius: 12px;
	background: white;
	cursor: pointer;
	transition: all 0.3s ease;
	position: relative;
}

.option-card:hover {
	border-color: #cbd5e0;
	transform: translateY(-2px);
}

.option-card.selected {
	border-color: #ec982b !important;
	background: #fef7ed !important;
	box-shadow: 0 4px 12px rgba(236, 152, 43, 0.2) !important;
	transform: translateY(-2px);
}

/* Ensure only one card can be selected per section */
.voucher-section .option-card:not(.selected) {
	border-color: #e2e8f0;
	background: white;
	box-shadow: none;
	transform: none;
}

.option-card--gift,
.option-card--evoucher {
	border-color: #ec982b;
	background: #fef7ed;
}

.option-card--gift.selected,
.option-card--evoucher.selected {
	background: #fef7ed !important;
	box-shadow: 0 4px 12px rgba(236, 152, 43, 0.3) !important;
}

.option-card--gift .option-icon,
.option-card--evoucher .option-icon {
	font-size: 32px;
	margin-bottom: 16px;
}

.option-card--self .option-icon {
	font-size: 32px;
	margin-bottom: 16px;
}

.option-card--evoucher,
.option-card--mail {
	flex-direction: row;
	text-align: left;
	align-items: flex-start;
}

.option-card--evoucher .option-media,
.option-card--mail .option-media {
	margin-right: 16px;
	flex-shrink: 0;
}

.media-placeholder {
	width: 60px;
	height: 60px;
	background: #e2e8f0;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
}

.option-content {
	flex: 1;
}

.option-title {
	font-size: 16px;
	font-weight: 600;
	color: #2d3748;
	margin-bottom: 8px;
}

.option-description {
	font-size: 14px;
	color: #718096;
	line-height: 1.4;
	margin-bottom: 12px;
}



/* Delivery Options */
.option-card--delivery {
	flex-direction: row;
	text-align: left;
	align-items: flex-start;
	padding: 20px;
}

.option-card--delivery .option-radio {
	width: 20px;
	height: 20px;
	border: 2px solid #e2e8f0;
	border-radius: 50%;
	margin-right: 16px;
	margin-top: 2px;
	flex-shrink: 0;
	position: relative;
	background: white;
}

.option-card--delivery.selected .option-radio {
	border-color: #ec982b;
	background: #ec982b;
}

.option-card--delivery.selected .option-radio::after {
	content: '';
	position: absolute;
	width: 8px;
	height: 8px;
	background: white;
	border-radius: 50%;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}

/* Hidden Radio Buttons */
.voucher-radio {
	display: none;
}

/* Sidebar Styling */

/* Ship to Different Address */
.ship-to-different-section {
	margin-bottom: 24px;
}

.ship-to-different-wrapper {
	padding: 16px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
}

.ship-to-different-checkbox {
	display: flex;
	align-items: center;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	color: #2d3748;
}

.ship-to-different-checkbox input[type="checkbox"] {
	margin-right: 8px;
	width: 16px;
	height: 16px;
}

.checkbox-text {
	user-select: none;
}

/* Features */
.sidebar-features {
	margin-bottom: 32px;
}


.feature-item {
	display: flex;
	align-items: flex-start;
	margin-bottom: 20px;
}

.feature-icon {
	font-size: 20px;
	margin-right: 12px;
	margin-top: 2px;
}

.feature-content strong {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: #2d3748;
	margin-bottom: 4px;
}

.feature-content p {
	font-size: 13px;
	color: #718096;
	line-height: 1.4;
	margin: 0;
}

/* Redeem Voucher Section */
.redeem-voucher-section {
	border-top: 1px solid #e2e8f0;
	padding-top: 24px;
	margin-bottom: 24px;
}

.redeem-voucher-section h3 {
	font-size: 18px;
	font-weight: 600;
	color: #2d3748;
	margin-bottom: 16px;
}

.redeem-voucher-form {
	display: flex;
	gap: 8px;
}

.voucher-code-input {
	flex: 1;
	padding: 10px 12px;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	font-size: 14px;
	background: white;
}

.voucher-code-input:focus {
	outline: none;
	border-color: #ec982b;
	box-shadow: 0 0 0 3px rgba(236, 152, 43, 0.1);
}

.redeem-voucher-form .apply-voucher-btn {
	padding: 10px 16px;
	background-color: #EC982B !important;
	color: white !important;
	border: none;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.2s;
}


/* Coupon Section */
.coupon-section {
	margin-top: 24px;
	padding-top: 24px;
	border-top: 1px solid #e2e8f0;
}

.coupon-section h3 {
	font-size: 18px;
	font-weight: 600;
	color: #2d3748;
	margin-bottom: 16px;
}

.coupon-form {
	display: flex;
	gap: 8px;
}

.coupon-code-input {
	flex: 1;
	padding: 10px 12px;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	font-size: 14px;
	background: white;
}

.coupon-code-input:focus {
	outline: none;
	border-color: #ec982b;
	box-shadow: 0 0 0 3px rgba(236, 152, 43, 0.1);
}

.coupon-form .apply-coupon-btn {
	padding: 10px 16px;
	background-color: #EC982B !important;
	color: white !important;
	border: none;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.2s;
}



/* Order Review */
.order-review-section {
	border-top: 1px solid #e2e8f0;
	padding-top: 24px;
}

.order-review-section h3 {
	font-size: 18px;
	font-weight: 600;
	color: #2d3748;
	margin-bottom: 16px;
}

/* Fallback Payment Section */
#payment_fallback {
	background: #f8f9fa;
	border-radius: 12px;
	padding: 20px;
	margin-top: 20px;
	border: 1px solid #e2e8f0;
}

#payment_fallback .wc_payment_methods {
	list-style: none;
	padding: 0;
	margin: 0 0 20px 0;
}

#payment_fallback .wc_payment_methods li {
	margin: 0 0 10px 0;
	padding: 15px;
	background: white;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
}

#payment_fallback .place-order {
	margin-top: 20px;
}

#payment_fallback #place_order {
	background: #ec982b !important;
	color: white !important;
	border: none !important;
	padding: 12px 24px !important;
	border-radius: 8px !important;
	font-size: 16px !important;
	font-weight: 600 !important;
	cursor: pointer !important;
	width: 100% !important;
	transition: background-color 0.2s ease !important;
}

#payment_fallback #place_order:hover {
	background: #d4841f !important;
}

/* Responsive Design - Only for smaller screens */
@media (max-width: 1024px) {
    
    .voucher-checkout-container .voucher-checkout-sidebar {
        display: block !important;
        width: 100% !important;
    }


	.voucher-checkout-container {
		display: grid !important;
		grid-template-columns: 1fr !important;
		grid-template-areas: "main" "sidebar" !important;
		padding: 16px;
		gap: 20px;
	}

	.voucher-checkout-main {
		max-width: 100% !important;
		order: 1 !important;
		grid-area: main;
	}

	.voucher-checkout-sidebar {
		width: 100% !important;
		order: 2 !important; /* Ensure sidebar comes after main content */
		flex-basis: auto !important;
		grid-area: sidebar;
	}
}

@media (max-width: 768px) {
	.option-grid {
		grid-template-columns: 1fr;
	}
	
	body .voucher-checkout-container {
        grid-template-columns: none !important;
        grid-template-areas: none !important;
        display: block !important; /* optional: switch back to normal block flow */
    }
}

/* Form Fields Styling */
.recipient-fields,
.billing-fields,
.shipping-fields,
.additional-fields {
	background: #f8f9fa;
	border-radius: 12px;
	padding: 24px;
	margin-top: 16px;
}

.form-row {
	margin-bottom: 20px;
}

.form-row:last-child {
	margin-bottom: 0;
}

.form-row label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: #2d3748;
	margin-bottom: 8px;
}

.form-row input,
.form-row textarea,
.form-row select {
	width: 100%;
	padding: 12px 16px;
	border: 2px solid #e2e8f0;
	border-radius: 8px;
	font-size: 14px;
	transition: border-color 0.2s ease;
	background: white;
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
	outline: none;
	border-color: #ec982b;
	box-shadow: 0 0 0 3px rgba(236, 152, 43, 0.1);
}

.form-row textarea {
	resize: vertical;
	min-height: 80px;
}

/* Schedule Options */
.schedule-options .option-card {
	padding: 20px;
}

.schedule-options .option-icon {
	font-size: 24px;
	margin-bottom: 12px;
}

/* Delivery Options Visibility */
.delivery-options {
	transition: all 0.3s ease;
}

/* Ensure delivery section is always visible */
.delivery-section {
	display: block !important;
}

/* Physical delivery options styling */
.physical-delivery-options {
	background: #f8f9fa;
	border: 2px solid #e2e8f0;
	border-radius: 8px;
	padding: 16px;
	margin-top: 16px;
}

/* WooCommerce form compatibility */
.woocommerce-billing-fields,
.woocommerce-shipping-fields,
.woocommerce-additional-fields {
	display: block !important;
}

.woocommerce-billing-fields__field-wrapper,
.woocommerce-shipping-fields__field-wrapper {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.woocommerce-billing-fields__field-wrapper .form-row,
.woocommerce-shipping-fields__field-wrapper .form-row {
	margin-bottom: 16px;
}

.woocommerce-billing-fields__field-wrapper .form-row:last-child,
.woocommerce-shipping-fields__field-wrapper .form-row:last-child {
	margin-bottom: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.woocommerce-billing-fields__field-wrapper,
	.woocommerce-shipping-fields__field-wrapper {
		grid-template-columns: 1fr;
	}
	
	.recipient-fields,
	.billing-fields,
	.shipping-fields,
	.additional-fields {
		padding: 16px;
	}
	
	.form-row input,
	.form-row textarea,
	.form-row select {
		padding: 10px 12px;
	}
}

/* Newsletter Field Styling */
#mailchimp_woocommerce_newsletter_field label,
.woocommerce-form-newsletter label,
.newsletter-form-row label {
	display: flex !important;
	flex-direction: row !important;
	align-items: center !important;
	font-weight: 500 !important;
	font-size: 14px !important;
	cursor: pointer !important;
}

#mailchimp_woocommerce_newsletter_field input[type="checkbox"],
.woocommerce-form-newsletter input[type="checkbox"],
.newsletter-form-row input[type="checkbox"] {
	width: 18px !important;
	height: 18px !important;
	margin-right: 12px !important;
	margin-bottom: 0 !important;
	flex-shrink: 0 !important;
}

#mailchimp_woocommerce_newsletter_field,
.woocommerce-form-newsletter,
.newsletter-form-row {
	margin-top: 16px !important;
	padding-top: 16px !important;
	border-top: 1px solid #e2e8f0 !important;
}
.voucher-notification {
	position: fixed;
	top: 20px;
	right: 20px;
	padding: 16px 20px;
	border-radius: 8px;
	color: white;
	font-weight: 500;
	z-index: 9999;
	transform: translateX(100%);
	transition: transform 0.3s ease;
	max-width: 400px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.voucher-notification.show {
	transform: translateX(0);
}

.voucher-notification-success {
	background: #10b981;
	border-left: 4px solid #059669;
}

.voucher-notification-error {
	background: #ec982b;
	border-left: 4px solid #d4841f;
	color: white;
}

.voucher-notification-info {
	background: #3b82f6;
	border-left: 4px solid #2563eb;
}

@media (max-width: 768px) {
	.voucher-notification {
		right: 10px;
		left: 10px;
		max-width: none;
	}
}

/* Logged In Status */
.logged-in-status {
	display: flex;
	align-items: center;
	background: #d1fae5;
	border: 2px solid #10b981;
	border-radius: 12px;
	padding: 16px 20px;
	margin-bottom: 24px;
}

.logged-in-status .status-icon {
	font-size: 20px;
	margin-right: 12px;
}

.logged-in-status .status-text {
	display: flex;
	flex-direction: column;
}

.logged-in-status .status-text strong {
	font-size: 14px;
	color: #065f46;
	margin-bottom: 2px;
}

.logged-in-status .status-text span {
	font-size: 12px;
	color: #047857;
}

/* Account Section Styling */
.account-section {
	border: 2px solid #e2e8f0;
	border-radius: 12px;
	padding: 24px;
	background: #f8f9fa;
}

.account-options {
	margin-bottom: 24px;
}

.option-card--account {
	flex-direction: row;
	text-align: left;
	align-items: flex-start;
	padding: 20px;
	min-height: auto;
}

.option-card--account .option-content {
	flex: 1;
}

.account-form {
	background: white;
	border-radius: 8px;
	padding: 24px;
	margin-top: 16px;
	transition: all 0.3s ease;
}

.form-row-wide {
	width: 100%;
}

.form-row .login-btn, .register-btn {
	background-color: #EC982B !important;
	color: white !important;
	border: none;
	border-radius: 8px;
	padding: 12px 24px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s;
	margin-right: 16px;
}

.login-btn:hover, .register-btn:hover {
	background: #d4841f;
}

.forgot-password-row {
	text-align: center;
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid #e2e8f0;
}

.forgot-password-link {
	color: #ec982b;
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	display: block;
	margin-bottom: 4px;
}

.forgot-password-link:hover {
	color: #d4841f;
	text-decoration: underline;
}

.forgot-password-help {
	color: #6b7280;
	font-size: 12px;
	display: block;
	line-height: 1.4;
}

.account-form .form-row {
	margin-bottom: 20px;
}

.account-form .form-row:last-child {
	margin-bottom: 0;
	display: flex;
	align-items: center;
	gap: 16px;
}

/* Loading states */
.login-btn:disabled, .register-btn:disabled {
	background: #9ca3af;
	cursor: not-allowed;
	position: relative;
}

.login-btn.loading:disabled::after, .register-btn.loading:disabled::after {
	content: '';
	position: absolute;
	width: 16px;
	height: 16px;
	margin: auto;
	border: 2px solid transparent;
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: button-loading-spinner 1s ease infinite;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
}

@keyframes button-loading-spinner {
	from {
		transform: translateY(-50%) rotate(0turn);
	}
	to {
		transform: translateY(-50%) rotate(1turn);
	}
}

/* Form field validation states */
.input-text.error {
	border-color: #ec982b !important;
	box-shadow: 0 0 0 3px rgba(236, 152, 43, 0.1) !important;
}

.input-text.success {
	border-color: #10b981 !important;
	box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

@media (max-width: 768px) {
	.account-form .form-row:last-child {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}
	
	.login-btn, .register-btn {
		width: 100%;
		margin-right: 0;
	}
}
