/* Tickets System — frontend date picker (single product page) */

/* Trigger + status line above add-to-cart */

.tsdp-trigger-wrap {
	margin: 0 0 16px;
}

.tsdp-trigger {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 18px;
	font-weight: 600;
	font-size: 1em;
	cursor: pointer;
}

.tsdp-trigger__icon {
	font-size: 1.1em;
	line-height: 1;
}

.tsdp-status {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin: 10px 0 0;
	padding: 8px 12px;
	background: #f3f4f6;
	border-left: 3px solid #10b981;
	font-size: 0.95em;
}

.tsdp-status__prefix {
	color: #4b5563;
}

.tsdp-status__date {
	color: #111827;
}

.tsdp-status__change {
	margin-left: auto;
	background: none;
	border: 0;
	color: #2563eb;
	cursor: pointer;
	font-size: 0.9em;
	text-decoration: underline;
	padding: 0;
}

/* Native add-to-cart gate.
   Until the form has a picked date, the native submit button is muted
   and non-interactive. Quantity inputs stay editable so the customer
   can dial in their qty before opening the modal. */

form.cart:not(.tickets-system-has-date) .single_add_to_cart_button {
	opacity: 0.45;
	pointer-events: none;
	filter: grayscale(0.4);
}

/* Modal */

.tsdp-modal[hidden] {
	display: none !important;
}

.tsdp-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.tsdp-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(17, 24, 39, 0.55);
	backdrop-filter: blur(2px);
}

.tsdp-modal__panel {
	position: relative;
	background: #ffffff;
	color: #111827;
	border-radius: 12px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
	max-width: 420px;
	width: 100%;
	max-height: calc(100vh - 40px);
	overflow: auto;
	padding: 22px 22px 18px;
	font-family: inherit;
}

.tsdp-modal__close {
	position: absolute;
	top: 8px;
	right: 12px;
	background: transparent;
	border: 0;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: #6b7280;
	padding: 4px 10px;
	border-radius: 6px;
}

.tsdp-modal__close:hover {
	background: #f3f4f6;
	color: #111827;
}

.tsdp-modal__title {
	margin: 0 0 6px;
	font-size: 1.25em;
	font-weight: 600;
}

.tsdp-modal__hint {
	margin: 0 0 16px;
	color: #6b7280;
	font-size: 0.92em;
}

.tsdp-modal__nav {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
}

.tsdp-modal__label {
	flex: 1;
	text-align: center;
	font-weight: 600;
	font-size: 1.05em;
	text-transform: capitalize;
}

.tsdp-modal__prev,
.tsdp-modal__next {
	background: #fff;
	border: 1px solid #e5e7eb;
	width: 36px;
	height: 36px;
	border-radius: 8px;
	font-size: 18px;
	cursor: pointer;
	color: #111827;
	line-height: 1;
}

.tsdp-modal__prev:hover,
.tsdp-modal__next:hover {
	background: #f9fafb;
}

.tsdp-modal__prev:disabled,
.tsdp-modal__next:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.tsdp-modal__months {
	min-height: 230px;
	position: relative;
}

.tsdp-cal__weekdays,
.tsdp-cal__grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 4px;
}

.tsdp-cal__weekdays {
	margin-bottom: 4px;
}

.tsdp-cal__weekday {
	text-align: center;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	color: #6b7280;
	padding: 4px 0;
}

.tsdp-day {
	aspect-ratio: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	border-radius: 6px;
	background: #f3f4f6;
	color: #1f2937;
	cursor: pointer;
	transition: background-color 0.12s ease, transform 0.12s ease;
}

.tsdp-day:hover:not(.is-disabled) {
	background: #2563eb;
	color: #fff;
	transform: translateY(-1px);
}

.tsdp-day:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: 2px;
}

.tsdp-day--blank {
	background: transparent;
	cursor: default;
	pointer-events: none;
}

.tsdp-day.is-disabled {
	background: transparent;
	color: #d1d5db;
	cursor: not-allowed;
	pointer-events: none;
}

/* Explicit per-product blackout — clearly marked as "wykluczony" so the
   customer doesn't confuse it with the muted "too soon" range. */
.tsdp-day.is-blackout {
	background: #fee2e2;
	color: #b91c1c;
	text-decoration: line-through;
	text-decoration-thickness: 1.5px;
	font-weight: 500;
}

/* Park closed via calendar_system — striped + same red palette so the
   customer reads it as "place closed" rather than "manually excluded". */
.tsdp-day.is-park-closed {
	background:
		repeating-linear-gradient(
			45deg,
			#fee2e2,
			#fee2e2 4px,
			#fecaca 4px,
			#fecaca 8px
		);
	color: #991b1b;
}

.tsdp-day.is-picked {
	background: #10b981;
	color: #fff;
	font-weight: 600;
}

.tsdp-modal__loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 20px;
	color: #4b5563;
}

.tsdp-modal__spinner {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	border: 2px solid rgba(0, 0, 0, 0.15);
	border-top-color: #2563eb;
	animation: tsdp-spin 0.7s linear infinite;
}

@keyframes tsdp-spin {
	to { transform: rotate(360deg); }
}

.tsdp-modal__empty,
.tsdp-modal__error {
	margin-top: 12px;
	padding: 10px 12px;
	border-radius: 8px;
	font-size: 0.92em;
}

.tsdp-modal__empty {
	background: #fffbeb;
	color: #92400e;
	border: 1px solid #fde68a;
	text-align: center;
}

.tsdp-modal__error {
	background: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

/* Body scroll lock while modal is open */

body.tsdp-modal-open {
	overflow: hidden;
}

@media (max-width: 480px) {
	.tsdp-modal__panel {
		padding: 16px 14px;
	}
	.tsdp-day { font-size: 13px; }
}
