/**
 * Smart Delivery Slots Pro Public Styles
 *
 * @package Slotify\Pro\Public
 */

/* ============================================
   Reschedule Container
   ============================================ */
.slotify-pro-customer-reschedule-container {
	margin: 30px 0;
}

.slotify-pro-reschedule-box {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
	transition: box-shadow 0.3s ease;
}

.slotify-pro-reschedule-box:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ============================================
   Header & Badge
   ============================================ */
.slotify-pro-reschedule-header {
	position: relative;
}

.slotify-pro-reschedule-badge {
	animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: scale(0.9);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

/* ============================================
   Reschedule Button States
   ============================================ */
.slotify-pro-reschedule-toggle-btn {
	transition: all 0.3s ease;
	position: relative;
	overflow: hidden;
}

.slotify-pro-reschedule-toggle-btn::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.3);
	transform: translate(-50%, -50%);
	transition: width 0.6s, height 0.6s;
}

.slotify-pro-reschedule-toggle-btn:hover {
	background: #5568d3 !important;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.slotify-pro-reschedule-toggle-btn:hover::before {
	width: 300px;
	height: 300px;
}

.slotify-pro-reschedule-toggle-btn:active {
	background: #4c5bc4 !important;
	transform: translateY(0);
}

.slotify-pro-reschedule-toggle-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed !important;
	transform: none !important;
}

/* Button states: Available (green) */
.slotify-pro-reschedule-toggle-btn.button-primary {
	background: #667eea;
}

.slotify-pro-reschedule-toggle-btn.button-primary:hover {
	background: #5568d3;
}

/* Button states: Final reschedule (yellow) */
.slotify-pro-reschedule-toggle-btn.button-warning {
	background: #f59e0b;
}

.slotify-pro-reschedule-toggle-btn.button-warning:hover {
	background: #d97706;
}

/* Button states: Disabled (gray) */
.slotify-pro-reschedule-toggle-btn.button-disabled {
	background: #e5e7eb !important;
	color: #6b7280 !important;
	cursor: not-allowed !important;
}

/* Button states: Too late (red) */
.slotify-pro-reschedule-toggle-btn.button-danger {
	background: #ef4444 !important;
	color: #fff !important;
}

.slotify-pro-reschedule-toggle-btn.button-danger:hover {
	background: #dc2626 !important;
}

/* ============================================
   Form Elements
   ============================================ */
.slotify-pro-reschedule-form-container {
	animation: slideDown 0.3s ease-out;
	overflow: hidden;
}

@keyframes slideDown {
	from {
		opacity: 0;
		max-height: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		max-height: 1000px;
		transform: translateY(0);
	}
}

.slotify-pro-reschedule-form-container input[type="date"] {
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.slotify-pro-reschedule-form-container input[type="date"]:focus {
	border-color: #667eea;
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
	outline: none;
}

.slotify-pro-reschedule-form-container textarea {
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.slotify-pro-reschedule-form-container textarea:focus {
	border-color: #667eea;
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
	outline: none;
}

/* ============================================
   Slot Selection
   ============================================ */
.slotify-pro-slot-option {
	transition: all 0.2s ease;
	position: relative;
}

.slotify-pro-slot-option::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 0;
	background: #667eea;
	transition: width 0.2s ease;
}

.slotify-pro-slot-option:hover {
	background: #f0f4ff !important;
	border-color: #667eea !important;
	transform: translateX(2px);
}

.slotify-pro-slot-option:hover::before {
	width: 4px;
}

.slotify-pro-slot-option.selected {
	background: #f0f4ff !important;
	border-color: #667eea !important;
	border-width: 2px !important;
	box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.slotify-pro-slot-option.selected::before {
	width: 4px;
}

.slotify-pro-slot-option input[type="radio"] {
	cursor: pointer;
}

.slotify-pro-slot-option input[type="radio"]:checked {
	accent-color: #667eea;
}

/* Slot list container */
#slotify-pro-reschedule-slots-list {
	scrollbar-width: thin;
	scrollbar-color: #cbd5e1 #f1f5f9;
}

#slotify-pro-reschedule-slots-list::-webkit-scrollbar {
	width: 8px;
}

#slotify-pro-reschedule-slots-list::-webkit-scrollbar-track {
	background: #f1f5f9;
	border-radius: 4px;
}

#slotify-pro-reschedule-slots-list::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 4px;
}

#slotify-pro-reschedule-slots-list::-webkit-scrollbar-thumb:hover {
	background: #94a3b8;
}

/* ============================================
   Loading States
   ============================================ */
.slotify-pro-reschedule-loading {
	opacity: 0.6;
	pointer-events: none;
	position: relative;
}

.slotify-pro-reschedule-loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 20px;
	height: 20px;
	margin: -10px 0 0 -10px;
	border: 2px solid #667eea;
	border-top-color: transparent;
	border-radius: 50%;
	animation: spin 0.6s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

#slotify-pro-reschedule-slots-loading {
	position: relative;
}

#slotify-pro-reschedule-slots-loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 24px;
	height: 24px;
	margin: -12px 0 0 -12px;
	border: 3px solid #e5e7eb;
	border-top-color: #667eea;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

/* ============================================
   Messages
   ============================================ */
.slotify-pro-reschedule-message {
	transition: all 0.3s ease;
	cursor: pointer;
	position: relative;
	padding-right: 40px;
}

.slotify-pro-reschedule-message::after {
	content: '×';
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 20px;
	font-weight: bold;
	opacity: 0.6;
	transition: opacity 0.2s ease;
}

.slotify-pro-reschedule-message:hover::after {
	opacity: 1;
}

.slotify-pro-reschedule-message.success {
	background: #d1fae5;
	border: 1px solid #a7f3d0;
	color: #065f46;
}

.slotify-pro-reschedule-message.error {
	background: #fee2e2;
	border: 1px solid #fecaca;
	color: #991b1b;
}

.slotify-pro-reschedule-message.warning {
	background: #fffbeb;
	border: 1px solid #fde68a;
	color: #92400e;
}

.slotify-pro-reschedule-message ul {
	margin: 8px 0 0 20px;
	padding: 0;
	list-style: disc;
}

.slotify-pro-reschedule-message ul li {
	margin: 4px 0;
}

/* ============================================
   Info Boxes
   ============================================ */
.slotify-pro-reschedule-info {
	animation: slideIn 0.3s ease;
}

@keyframes slideIn {
	from {
		opacity: 0;
		transform: translateX(-10px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

/* ============================================
   Current Delivery Display
   ============================================ */
.slotify-pro-current-delivery {
	position: relative;
}

.slotify-pro-current-delivery::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 4px;
	background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
	border-radius: 0 2px 2px 0;
}

/* ============================================
   Form Buttons
   ============================================ */
#slotify-pro-reschedule-submit-btn,
#slotify-pro-reschedule-cancel-btn {
	transition: all 0.2s ease;
	position: relative;
	overflow: hidden;
}

#slotify-pro-reschedule-submit-btn:hover {
	background: #5568d3 !important;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

#slotify-pro-reschedule-submit-btn:active {
	transform: translateY(0);
}

#slotify-pro-reschedule-submit-btn:disabled {
	opacity: 0.7;
	cursor: not-allowed;
	transform: none !important;
}

#slotify-pro-reschedule-cancel-btn:hover {
	background: #d1d5db !important;
	transform: translateY(-1px);
}

#slotify-pro-reschedule-cancel-btn:active {
	transform: translateY(0);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 768px) {
	.slotify-pro-customer-reschedule-container {
		margin: 20px 0;
	}

	.slotify-pro-reschedule-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
	}

	.slotify-pro-reschedule-badge {
		align-self: flex-end;
	}

	.slotify-pro-reschedule-form-container {
		padding: 0 16px 16px !important;
	}

	#slotify-pro-reschedule-slots-list {
		max-height: 200px;
	}
}

/* ============================================
   Accessibility
   ============================================ */
.slotify-pro-slot-option:focus-within {
	outline: 2px solid #667eea;
	outline-offset: 2px;
}

.slotify-pro-reschedule-toggle-btn:focus,
#slotify-pro-reschedule-submit-btn:focus,
#slotify-pro-reschedule-cancel-btn:focus {
	outline: 2px solid #667eea;
	outline-offset: 2px;
}

/* Screen reader only text */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border-width: 0;
}

/* ============================================
   Cart Conflict Notice
   ============================================ */
.slotify-pro-cart-conflict-notice {
	margin-bottom: 2rem;
	margin-top: 0;
	border-left: 4px solid #dc2626;
	background: #fef2f2;
	padding: 1.5rem;
	border-radius: 4px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
	clear: both;
	display: block;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	position: relative;
	z-index: 1;
}

.slotify-pro-conflict-header {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.slotify-pro-conflict-icon {
	font-size: 1.5rem;
	line-height: 1;
}

.slotify-pro-conflict-title {
	font-size: 1.125rem;
	color: #991b1b;
	margin: 0;
}

.slotify-pro-conflict-message {
	margin: 0 0 1rem 0;
	color: #7f1d1d;
	font-size: 0.9375rem;
	line-height: 1.5;
}

.slotify-pro-conflict-products {
	margin: 1rem 0;
}

.slotify-pro-conflict-product {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	padding: 1rem;
	margin-bottom: 0.75rem;
	background: #fff;
	border: 1px solid #fecaca;
	border-radius: 4px;
	transition: all 0.2s ease;
}

.slotify-pro-conflict-product:hover {
	border-color: #f87171;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.slotify-pro-conflict-product:last-child {
	margin-bottom: 0;
}

.slotify-pro-conflict-product-info {
	flex: 1;
}

.slotify-pro-conflict-product-name {
	display: block;
	font-size: 1rem;
	font-weight: 600;
	color: #1f2937;
	margin-bottom: 0.5rem;
}

.slotify-pro-conflict-product-details {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
	font-size: 0.875rem;
	color: #6b7280;
}

.slotify-pro-conflict-prep-time {
	color: #dc2626;
	font-weight: 500;
}

.slotify-pro-conflict-availability {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

.slotify-pro-conflict-label {
	font-weight: 500;
	color: #4b5563;
}

.slotify-pro-conflict-days,
.slotify-pro-conflict-slots {
	padding: 0.25rem 0.5rem;
	background: #f3f4f6;
	border-radius: 3px;
	color: #374151;
	font-size: 0.8125rem;
}

.slotify-pro-conflict-remove-button {
	padding: 0.5rem 1rem;
	font-size: 0.875rem;
	white-space: nowrap;
	transition: all 0.2s ease;
}

.slotify-pro-conflict-remove-button:hover {
	background: #dc2626 !important;
	color: #fff !important;
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(220, 38, 38, 0.3);
}

.slotify-pro-conflict-remove-button:active {
	transform: translateY(0);
}

.slotify-pro-conflict-remove-button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none !important;
}

.slotify-pro-conflict-suggestion {
	margin: 1rem 0 0 0;
	padding-top: 1rem;
	border-top: 1px solid #fecaca;
	color: #7f1d1d;
	font-size: 0.9375rem;
	font-style: italic;
}

/* ============================================
   Checkout Conflict Banner
   ============================================ */
.slotify-pro-checkout-conflict-banner {
	margin-bottom: 2rem;
	margin-top: 0;
	border-left: 4px solid #dc2626;
	background: #fef2f2;
	padding: 1.25rem 1.5rem;
	border-radius: 4px;
	box-shadow: 0 2px 8px rgba(220, 38, 38, 0.15);
	position: relative;
	clear: both;
	display: block;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	z-index: 1;
}

.slotify-pro-conflict-banner-content {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
}

.slotify-pro-conflict-banner-text {
	flex: 1;
	min-width: 200px;
}

.slotify-pro-conflict-banner-title {
	display: block;
	font-size: 1.125rem;
	color: #991b1b;
	margin-bottom: 0.5rem;
}

.slotify-pro-conflict-banner-message {
	margin: 0;
	color: #7f1d1d;
	font-size: 0.9375rem;
	line-height: 1.5;
}

.slotify-pro-conflict-banner-link {
	padding: 0.625rem 1.25rem;
	font-size: 0.9375rem;
	font-weight: 600;
	white-space: nowrap;
	transition: all 0.2s ease;
	text-decoration: none;
}

.slotify-pro-conflict-banner-link:hover {
	background: #dc2626 !important;
	color: #fff !important;
	transform: translateY(-1px);
	box-shadow: 0 2px 4px rgba(220, 38, 38, 0.3);
}

.slotify-pro-checkout-conflict-banner .slotify-pro-conflict-icon {
	font-size: 1.5rem;
	line-height: 1;
	flex-shrink: 0;
}

/* Place Order Button - Disabled State */
#place_order.disabled,
#place_order[disabled] {
	opacity: 0.5 !important;
	cursor: not-allowed !important;
	pointer-events: none;
}

/* ============================================
   Responsive Design for Conflict Notices
   ============================================ */
@media (max-width: 768px) {
	.slotify-pro-cart-conflict-notice,
	.slotify-pro-checkout-conflict-banner {
		padding: 1rem;
		margin-bottom: 1.5rem;
	}

	.slotify-pro-conflict-product {
		flex-direction: column;
		align-items: stretch;
	}

	.slotify-pro-conflict-remove-button {
		width: 100%;
		text-align: center;
	}

	.slotify-pro-conflict-banner-content {
		flex-direction: column;
		align-items: stretch;
	}

	.slotify-pro-conflict-banner-link {
		width: 100%;
		text-align: center;
	}

	.slotify-pro-conflict-availability {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* ============================================
   Block Checkout/Cart Compatibility
   ============================================ */
/* Block checkout - place banner at the very top */
.wp-block-woocommerce-checkout {
	position: relative;
}

.wp-block-woocommerce-checkout .slotify-pro-checkout-conflict-banner {
	margin-top: 0 !important;
	margin-bottom: 2rem !important;
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box;
	position: relative !important;
	z-index: 10;
	clear: both;
	order: -999 !important; /* Place at very top */
}

/* Block checkout wrapper - ensure banner is first child */
.wp-block-woocommerce-checkout > .slotify-pro-checkout-conflict-banner:first-child {
	margin-top: 0 !important;
}

/* Block checkout main container */
.wc-block-checkout__main {
	position: relative;
}

.wc-block-checkout__main .slotify-pro-checkout-conflict-banner {
	order: -999 !important;
	margin-top: 0 !important;
	margin-bottom: 2rem !important;
}

/* Block cart - place notice at the very top */
.wp-block-woocommerce-cart {
	position: relative;
}

.wp-block-woocommerce-cart .slotify-pro-cart-conflict-notice {
	margin-top: 0 !important;
	margin-bottom: 2rem !important;
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box;
	position: relative !important;
	z-index: 10;
	clear: both;
	order: -999 !important; /* Place at very top */
}

/* Block cart wrapper - ensure notice is first child */
.wp-block-woocommerce-cart > .slotify-pro-cart-conflict-notice:first-child {
	margin-top: 0 !important;
}

/* Block cart main container */
.wc-block-cart__main {
	position: relative;
}

.wc-block-cart__main .slotify-pro-cart-conflict-notice {
	order: -999 !important;
	margin-top: 0 !important;
	margin-bottom: 2rem !important;
}

/* Block cart items section */
.wc-block-cart-items {
	position: relative;
}

.wc-block-cart-items .slotify-pro-cart-conflict-notice {
	order: -999 !important;
	margin-top: 0 !important;
	margin-bottom: 1.5rem !important;
}

/* ============================================
   Classic Checkout/Cart Compatibility
   ============================================ */
/* Classic checkout - place banner at top, full width, don't break layout */
.woocommerce-checkout .slotify-pro-checkout-conflict-banner {
	margin-bottom: 2rem !important;
	margin-top: 0 !important;
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box;
	clear: both !important;
	display: block !important;
	float: none !important;
	position: relative;
	z-index: 1;
}

/* Classic checkout form - ensure banner doesn't break two-column layout */
.woocommerce-checkout form.checkout {
	position: relative;
	overflow: visible;
	display: block;
	width: 100%;
}

/* Ensure banner appears before the form, not inside col2-set */
.woocommerce-checkout .slotify-pro-checkout-conflict-banner {
	grid-column: 1 / -1; /* Span all columns if in grid */
}

/* Classic cart page */
.woocommerce-cart .slotify-pro-cart-conflict-notice {
	margin-bottom: 2rem !important;
	margin-top: 0 !important;
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box;
	clear: both !important;
	display: block !important;
	float: none !important;
	position: relative;
	z-index: 1;
}

/* Ensure cart table layout is not broken */
.woocommerce-cart table.cart {
	position: relative;
	overflow: visible;
	width: 100%;
}

.woocommerce-cart .slotify-pro-cart-conflict-notice {
	grid-column: 1 / -1; /* Span all columns if in grid */
}

/* Prevent layout breaks in classic WooCommerce */
.woocommerce .slotify-pro-cart-conflict-notice,
.woocommerce .slotify-pro-checkout-conflict-banner {
	float: none !important;
	display: block !important;
	overflow: visible;
	position: relative;
}

/* Fix for classic checkout form wrapper - ensure banner is outside col2-set */
.woocommerce-checkout .col2-set {
	position: relative;
	overflow: visible;
	display: block;
	width: 100%;
	clear: both;
}

/* Ensure banner is before col2-set, not inside */
body.woocommerce-checkout .slotify-pro-checkout-conflict-banner {
	display: block !important;
	width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	visibility: visible !important;
	opacity: 1 !important;
	height: auto !important;
	min-height: auto !important;
}

/* Classic checkout - ensure banner is visible inside form */
.woocommerce-checkout form.checkout .slotify-pro-checkout-conflict-banner {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	margin-bottom: 2rem !important;
	margin-top: 1rem !important;
}

/* Classic checkout - banner before customer details */
.woocommerce-checkout #customer_details ~ .slotify-pro-checkout-conflict-banner,
.woocommerce-checkout .slotify-pro-checkout-conflict-banner:first-child {
	display: block !important;
	visibility: visible !important;
}

/* Fix for classic cart wrapper */
.woocommerce-cart-form {
	position: relative;
	overflow: visible;
	display: block;
	width: 100%;
	clear: both;
}

/* Ensure cart notice is before cart form, not inside */
body.woocommerce-cart .slotify-pro-cart-conflict-notice {
	display: block !important;
	width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}