/**
 * WC Modal Products Styles
 *
 * @package WC_Modal_Products
 */

/* Container */
.wcmp-container {
	margin: 20px 0;
}

/* Availability Title */
.wcmp-availability-title {
	margin: 0 0 20px 0;
	font-size: 1.8em;
	color: #333;
	font-weight: 600;
}

/* Error Message */
.wcmp-error-message {
	margin: 20px 0;
	padding: 15px;
	background: #ffebee;
	border-left: 4px solid #CC3333;
	border-radius: 4px;
}

.wcmp-error-message p {
	margin: 0;
	color: #CC3333;
	font-size: 1em;
}

/* Calendar Styles - jQuery UI Datepicker */
.wcmp-calendar-container {
	background: #fff;
	border: 1px solid #CC3333;
	border-radius: 8px;
	padding: 20px;
	margin-bottom: 20px;
	position: relative;
	min-height: 300px;
}

/* Loading State */
.wcmp-booking-loading {
	text-align: center;
	padding: 40px 20px;
	min-height: 200px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.wcmp-booking-loading .spinner {
	float: none;
	margin: 0 auto 15px;
	width: 50px;
	height: 50px;
	border: 4px solid #f3f3f3;
	border-top: 4px solid #CC3333;
	border-radius: 50%;
	animation: wcmp-spin 1s linear infinite;
}

@keyframes wcmp-spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

.wcmp-booking-loading p {
	margin: 0;
	color: #666;
	font-size: 14px;
	animation: wcmp-pulse 1.5s ease-in-out infinite;
}

@keyframes wcmp-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.5; }
}

.wcmp-booking-loading .loading-dots {
	display: inline-flex;
	gap: 5px;
	margin-top: 10px;
}

.wcmp-booking-loading .loading-dot {
	width: 8px;
	height: 8px;
	background-color: #CC3333;
	border-radius: 50%;
	animation: wcmp-bounce 1.4s ease-in-out infinite both;
}

.wcmp-booking-loading .loading-dot:nth-child(1) {
	animation-delay: -0.32s;
}

.wcmp-booking-loading .loading-dot:nth-child(2) {
	animation-delay: -0.16s;
}

@keyframes wcmp-bounce {
	0%, 80%, 100% {
		transform: scale(0);
		opacity: 0.5;
	}
	40% {
		transform: scale(1);
		opacity: 1;
	}
}

/* Flatpickr Calendar Styles */
.wcmp-booking-calendar-wrapper {
	display: none;
	opacity: 1 !important;
	visibility: visible !important;
}

.wcmp-booking-date-input {
	display: none !important;
}

.wcmp-booking-date-input.flatpickr-input {
	display: none !important;
}

/* Estilos para Flatpickr */
.flatpickr-calendar {
	font-family: inherit;
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	position: static !important;
	width: 100%;
	max-width: 100%;
}

.flatpickr-calendar.inline {
	position: static !important;
	display: block !important;
}

.flatpickr-innerContainer{
	justify-content: center;
}
.flatpickr-months{
	position: relative;
}

.flatpickr-day {
	cursor: pointer;
	transition: all 0.2s;
	position: relative;
	border-radius: 7px;
}

.flatpickr-day:hover:not(.disabled):not(.flatpickr-disabled) {
	background-color: #e3f2fd;
}

.flatpickr-day.disabled,
.flatpickr-day.flatpickr-disabled {
	color: #ccc !important;
	cursor: not-allowed;
	background-color: #f5f5f5 !important;
}

.flatpickr-day.nextMonthDay.disabled,
.flatpickr-day.nextMonthDay.flatpickr-disabled {
	opacity: 0.5;
}

/* Días con eventos disponibles - mostrar punto indicador */
.flatpickr-day.wmp-has-events {
	background-color: #ffffff;
	color: #CC3333;
	border-color: #CC3333 !important;
	font-weight: 500;
}

.flatpickr-day.wmp-has-events:hover {
	background-color: #c8e6c9;
}

.wmp-event-dot {
	position: absolute;
	bottom: 4px;
	left: 50%;
	transform: translateX(-50%);
	width: 6px;
	height: 6px;
	background-color: #4caf50;
	border-radius: 50%;
	pointer-events: none;
}

.flatpickr-day.selected {
	background-color: #CC3333 !important;
	color: #ffffff !important;
	border-color: #CC3333 !important;
	font-weight: bold;
}

.flatpickr-day.selected .wmp-event-dot {
	background-color: #fff;
}

.flatpickr-day.selected:hover {
	background-color: #ffffff !important;
	color: #CC3333 !important;
}

.flatpickr-day.today {
	border-color: #CC3333;
	font-weight: bold;
}

/* Time Slots */
.wcmp-time-slots {
	margin-top: 20px;
	padding: 15px;
	background: #f9f9f9;
	border-radius: 8px;
	animation: wcmp-slide-down 0.3s ease-out;
}

@keyframes wcmp-slide-down {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.wcmp-time-slots h4 {
	margin: 0 0 15px 0;
	font-size: 1.2em;
	color: #333;
	font-weight: 600;
}

.wcmp-time-slots-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.wcmp-time-slot {
	padding: 10px 15px;
	background: #fff;
	border: 2px solid #CC3333;
	border-radius: 4px;
	color: #CC3333;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	transition: all 0.2s ease;
}

.wcmp-time-slot:hover {
	background-color: #CC3333;
	color: #fff;
}

.wcmp-time-slot.selected {
	background-color: #CC3333;
	color: #fff;
	border-color: #CC3333;
}

.wcmp-available-qty {
	font-size: 12px;
	font-weight: normal;
	opacity: 0.8;
}

.wcmp-loading,
.wcmp-no-slots,
.wcmp-error,
.wcmp-no-availability {
	padding: 20px;
	text-align: center;
	color: #666;
	font-style: italic;
}

.wcmp-error {
	color: #c62828;
}

.wcmp-no-availability {
	color: #666;
}

/* Modal Styles */
.wcmp-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 10000;
}

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

.wcmp-modal-content {
	position: relative;
	background: #fff;
	margin: 50px auto;
	max-width: 800px;
	max-height: 90vh;
	overflow-y: auto;
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
	z-index: 10001;
}

.wcmp-modal-close {
	position: absolute;
	top: 15px;
	right: 15px;
	background: transparent;
	border: none;
	font-size: 2em;
	color: #666;
	cursor: pointer;
	line-height: 1;
	padding: 0;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: all 0.2s ease;
	z-index: 10002;
}

.wcmp-modal-close:hover {
	background: #f5f5f5;
	color: #333;
}

.wcmp-modal-body {
	padding: 30px;
}

.wcmp-product-title {
	margin: 0 0 15px 0;
	font-size: 1.8em;
	color: #333;
}

.wcmp-product-description {
	margin-bottom: 25px;
	color: #666;
	line-height: 1.6;
	display: none;
}

.wcmp-product-description.show {
	display: block;
}

/* Persons Selector */
.wcmp-persons-selector,
.wcmp-linked-persons-selector {
	margin: 25px 0;
}

.wcmp-person-field,
.wcmp-person-type-field {
	margin-bottom: 20px;
}

.wcmp-person-field label,
.wcmp-person-type-field label {
	display: block;
	margin-bottom: 8px;
	font-weight: bold;
	color: #333;
	font-size: 1em;
}

.wcmp-person-type-description {
	display: block;
	font-size: 0.9em;
	color: #666;
	margin-bottom: 8px;
}

.wcmp-person-select {
	width: 100%;
	padding: 10px 15px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 1em;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.2s ease;
}

.wcmp-person-select:hover {
	border-color: #2196f3;
}

.wcmp-person-select:focus {
	outline: none;
	border-color: #2196f3;
	box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

/* Linked Product */
.wcmp-linked-product {
	margin: 30px 0;
	padding: 20px;
	background: #f9f9f9;
	border-radius: 8px;
	border: 1px solid #e0e0e0;
}

.wcmp-linked-product-title {
	margin: 0 0 15px 0;
	font-size: 1.3em;
	color: #333;
}

.wcmp-linked-product-actions {
	display: flex;
	gap: 15px;
	margin-top: 15px;
}

/* Buttons */
.wcmp-btn {
	padding: 12px 24px;
	border: none;
	border-radius: 4px;
	font-size: 1em;
	cursor: pointer;
	transition: all 0.2s ease;
	font-weight: 500;
	text-decoration: none;
	display: inline-block;
}

.wcmp-btn-primary {
	background: #2196f3;
	color: #fff;
}

.wcmp-btn-primary:hover {
	background: #1976d2;
}

.wcmp-btn-secondary {
	background: #757575;
	color: #fff;
}

.wcmp-btn-secondary:hover {
	background: #616161;
}

.wcmp-finalize-reservation {
	margin-top: 30px;
	text-align: center;
	display: none !important;
}

.wcmp-finalize-btn,
.wcmp-finalize-linked-btn {
	width: 100%;
	padding: 15px;
	font-size: 1.1em;
}

/* Linked Calendar */
.wcmp-linked-calendar {
	margin: 20px 0;
}

/* Cross-sells - Oculto por defecto, se muestra cuando hay tickets seleccionados */
.wcmp-cross-sells {
	display: none;
}

.wcmp-cross-sells.show {
	display: block;
}

/* Linked Product Persons Info */
.wcmp-linked-persons-info {
	margin-top: 10px;
	padding: 10px;
	background: #e3f2fd;
	border-radius: 4px;
	color: #1976d2;
	font-size: 0.9em;
}

.wcmp-linked-persons-warning {
	margin-top: 10px;
	padding: 10px;
	background: #ffebee;
	border-radius: 4px;
	color: #c62828;
	font-size: 0.9em;
	font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
	.wcmp-modal-content {
		margin: 20px;
		max-width: calc(100% - 40px);
	}

	.wcmp-modal-body {
		padding: 20px;
	}

	.wcmp-linked-product-actions {
		flex-direction: column;
	}

	.wcmp-btn {
		width: 100%;
	}

	.flatpickr-calendar {
		width: 100%;
		max-width: 100%;
	}
}

@media (max-width: 480px) {
	.wcmp-time-slot {
		padding: 8px 15px;
		font-size: 0.9em;
	}

	.flatpickr-calendar {
		font-size: 14px;
	}
}
