/* BookFlow — Item availability calendar.
 * A large month calendar shown beside a single rental item. Palette tracks the
 * active niche via --wdz-ic-primary / --wdz-ic-accent (set inline on the root). */

.wdz-itemcal {
	--wdz-ic-primary: #0F3460;
	--wdz-ic-accent: #C9A227;
	--wdz-ic-ink: #1f2733;
	--wdz-ic-muted: #6b7280;
	--wdz-ic-line: #e6e9f0;
	--wdz-ic-open: #ecfdf3;
	--wdz-ic-open-bd: #b6ebc9;
	box-sizing: border-box;
	width: 100%;
	padding: 40px 20px;
	font-family: inherit;
}
.wdz-itemcal *, .wdz-itemcal *::before, .wdz-itemcal *::after { box-sizing: border-box; }
.wdz-itemcal__inner { max-width: 1140px; margin: 0 auto; }

/* One cohesive white card (matches a typical product card) — floats on any page
   background, so the heading is always readable and it never looks pasted-in. */
.wdz-itemcal__card {
	background: #fff;
	border-radius: 22px;
	padding: 34px 36px 30px;
	box-shadow: 0 40px 80px -40px rgba(15, 23, 42, .5);
}

.wdz-itemcal__head { text-align: center; margin-bottom: 26px; }
.wdz-itemcal__title { font-size: clamp(1.45rem, 2.8vw, 2rem); font-weight: 800; color: var(--wdz-ic-primary); margin: 0 0 8px; line-height: 1.15; }
.wdz-itemcal__sub { color: var(--wdz-ic-muted); font-size: 1rem; margin: 0; }

.wdz-itemcal__body {
	display: grid;
	grid-template-columns: 1.5fr 1fr;
	gap: 26px;
	align-items: stretch;
}

/* ---- calendar (sits inside the card) ---- */
.wdz-itemcal__calwrap { }
.wdz-itemcal__calwrap.is-loading { opacity: .6; pointer-events: none; }
.wdz-itemcal__cal { user-select: none; }
.wdz-itemcal__calhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.wdz-itemcal__month { font-weight: 800; font-size: 1.25rem; color: var(--wdz-ic-primary); }
.wdz-itemcal__nav {
	width: 42px; height: 42px; border: 1px solid var(--wdz-ic-line); background: #fff;
	border-radius: 12px; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--wdz-ic-primary);
	transition: background .15s, color .15s, border-color .15s;
}
.wdz-itemcal__nav:hover:not(:disabled) { background: var(--wdz-ic-primary); color: #fff; border-color: var(--wdz-ic-primary); }
.wdz-itemcal__nav:disabled { opacity: .3; cursor: default; }

.wdz-itemcal__wd { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 8px; }
.wdz-itemcal__wd span { text-align: center; font-size: .74rem; font-weight: 700; color: #9aa3b2; text-transform: uppercase; letter-spacing: .04em; }

.wdz-itemcal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.wdz-itemcal__cell {
	position: relative; aspect-ratio: 1 / 1; min-height: 52px;
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	border: 1.5px solid transparent; border-radius: 12px; background: #f5f7fb;
	font-size: 1rem; font-weight: 600; color: var(--wdz-ic-ink); cursor: pointer;
	transition: background .12s, color .12s, border-color .12s, transform .06s, box-shadow .12s;
}
.wdz-itemcal__cell.is-empty { background: transparent; cursor: default; }
.wdz-itemcal__cell.is-open { background: var(--wdz-ic-open); border-color: var(--wdz-ic-open-bd); color: #14663a; }
.wdz-itemcal__cell.is-open:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -8px rgba(20,102,58,.4); border-color: #34c77a; }
.wdz-itemcal__cell.is-past { background: #f3f4f6; color: #c2c7d0; cursor: default; }
.wdz-itemcal__cell.is-booked {
	background: repeating-linear-gradient(-45deg, #f4f0f0, #f4f0f0 5px, #efe8e8 5px, #efe8e8 10px);
	color: #b0959a; cursor: not-allowed;
}
.wdz-itemcal__cell.is-booked .wdz-itemcal__dnum { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.wdz-itemcal__cell.is-selected {
	background: var(--wdz-ic-primary) !important; border-color: var(--wdz-ic-primary) !important; color: #fff !important;
	box-shadow: 0 10px 24px -8px rgba(15, 52, 96, .5);
	box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--wdz-ic-primary) 60%, transparent);
}
.wdz-itemcal__cell:focus-visible { outline: 3px solid var(--wdz-ic-accent); outline-offset: 2px; }
.wdz-itemcal__dnum { line-height: 1; }
.wdz-itemcal__dtag { margin-top: 3px; font-size: .56rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; opacity: .85; }

.wdz-itemcal__legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--wdz-ic-line); font-size: .82rem; color: var(--wdz-ic-muted); }
.wdz-itemcal__legend span { display: inline-flex; align-items: center; gap: 7px; }
.wdz-itemcal__dot { width: 13px; height: 13px; border-radius: 4px; display: inline-block; }
.wdz-itemcal__dot--open { background: var(--wdz-ic-open); border: 1.5px solid var(--wdz-ic-open-bd); }
.wdz-itemcal__dot--booked { background: repeating-linear-gradient(-45deg, #f4f0f0, #f4f0f0 3px, #efe8e8 3px, #efe8e8 6px); border: 1px solid #e0d3d3; }
.wdz-itemcal__dot--sel { background: var(--wdz-ic-primary); }

/* ---- side panel ---- */
.wdz-itemcal__panel {
	background: linear-gradient(180deg, #f7f9fc, #eef2f8);
	border: 1px solid #e6e9f0; border-radius: 16px; padding: 28px 26px;
	display: flex; flex-direction: column; justify-content: center; min-height: 180px;
}
.wdz-itemcal__panel-empty { color: var(--wdz-ic-muted); font-size: 1.02rem; line-height: 1.55; text-align: center; }
.wdz-itemcal__pempty { text-align: center; }
.wdz-itemcal__picon { display: inline-flex; color: var(--wdz-ic-primary); opacity: .55; margin-bottom: 12px; }
.wdz-itemcal__pprompt { color: var(--wdz-ic-muted); font-size: 1.02rem; line-height: 1.55; margin: 0; }
.wdz-itemcal__pcall { margin: 16px 0 0; font-size: .9rem; color: var(--wdz-ic-muted); }
.wdz-itemcal__pcall a { color: var(--wdz-ic-primary); font-weight: 700; text-decoration: none; }
.wdz-itemcal__pcall a:hover { text-decoration: underline; }
.wdz-itemcal__checking { display: flex; align-items: center; gap: 12px; color: var(--wdz-ic-muted); font-size: 1rem; justify-content: center; }
.wdz-itemcal__spin { width: 18px; height: 18px; border: 2.5px solid var(--wdz-ic-line); border-top-color: var(--wdz-ic-primary); border-radius: 50%; display: inline-block; animation: wdzIcSpin .7s linear infinite; }
@keyframes wdzIcSpin { to { transform: rotate(360deg); } }

.wdz-itemcal__psel { text-align: center; }
.wdz-itemcal__pbadge { font-weight: 800; font-size: 1.12rem; line-height: 1.3; margin-bottom: 6px; }
.wdz-itemcal__pbadge--ok { color: #14663a; }
.wdz-itemcal__pbadge--no { color: #b4232a; }
.wdz-itemcal__pmsg { color: var(--wdz-ic-muted); font-size: .95rem; margin: 6px 0 0; }
.wdz-itemcal__price { font-size: 2rem; font-weight: 800; color: var(--wdz-ic-primary); margin: 10px 0 18px; letter-spacing: -.02em; }
.wdz-itemcal__price span { display: block; font-size: .8rem; font-weight: 600; color: var(--wdz-ic-muted); letter-spacing: 0; margin-top: 2px; }
.wdz-itemcal__book {
	appearance: none; border: 0; cursor: pointer; width: 100%;
	background: var(--wdz-ic-accent); color: #1a1206; font-weight: 800; font-size: 1.02rem;
	padding: 15px 20px; border-radius: 12px; margin-top: 6px;
	box-shadow: 0 12px 28px -10px rgba(201, 162, 39, .55);
	box-shadow: 0 12px 28px -10px color-mix(in srgb, var(--wdz-ic-accent) 65%, transparent);
	transition: transform .15s, box-shadow .15s, filter .15s;
}
.wdz-itemcal__book:hover { transform: translateY(-2px); filter: brightness(1.04); }

/* ---- responsive ---- */
@media (max-width: 820px) {
	.wdz-itemcal { padding: 30px 16px; }
	.wdz-itemcal__card { padding: 26px 22px 22px; }
	.wdz-itemcal__body { grid-template-columns: 1fr; gap: 16px; }
	.wdz-itemcal__cell { min-height: 44px; font-size: .95rem; }
	.wdz-itemcal__panel { min-height: 0; }
}
/* Narrow phones — keep the 7-column grid inside the viewport (aspect-ratio +
   min-height set a minimum cell width, so padding/gaps must stay small). */
@media (max-width: 480px) {
	.wdz-itemcal { padding: 24px 10px; }
	.wdz-itemcal__card { padding: 22px 14px 18px; border-radius: 18px; }
	.wdz-itemcal__title { font-size: 1.35rem; }
	.wdz-itemcal__wd, .wdz-itemcal__grid { gap: 4px; }
	.wdz-itemcal__wd span { font-size: .64rem; }
	.wdz-itemcal__cell { min-height: 38px; font-size: .9rem; border-radius: 9px; }
	.wdz-itemcal__dnum { font-size: .92rem; }
	.wdz-itemcal__dtag { font-size: .5rem; }
	.wdz-itemcal__nav { width: 36px; height: 36px; }
	.wdz-itemcal__month { font-size: 1.1rem; }
	.wdz-itemcal__panel { padding: 22px 18px; }
	/* keep the 3-column ("beside") calendar within the viewport once it stacks */
	.wdz-itemcal.is-beside .wdz-itemcal__card { padding: 22px 12px 16px; }
	.wdz-itemcal.is-beside .wdz-itemcal__cell { min-height: 38px; }
	.wdz-itemcal.is-beside .wdz-itemcal__title { font-size: 1.3rem; }
}

/* ============================================================
   3-COLUMN "beside" layout — the calendar becomes a third column
   inside the product's flex row (image | details | calendar).
   ============================================================ */
.wdz-itemcal-row { display: flex !important; flex-wrap: wrap; align-items: flex-start; gap: 26px; }
.wdz-itemcal-row > .io_product_picbox { flex: 1 1 300px !important; min-width: 260px; max-width: 480px; width: auto !important; }
.wdz-itemcal-row > .io_product_infobox { flex: 1 1 360px !important; min-width: 300px; width: auto !important; }
.wdz-itemcal-row .io_image_big,
.wdz-itemcal-row .io_product_picbox img { max-width: 100% !important; height: auto !important; }
/* Calendar column: compact and capped so it doesn't grow into a huge block. */
.wdz-itemcal-row > #wdz-itemcal.is-beside { flex: 1 1 340px; min-width: 290px; max-width: 388px; }

/* Calendar, when it's a column: no section padding, compact card, stacked body. */
.wdz-itemcal.is-beside { padding: 0; width: auto; }
.wdz-itemcal.is-beside .wdz-itemcal__inner { max-width: none; margin: 0; }
.wdz-itemcal.is-beside .wdz-itemcal__card { padding: 20px 18px 16px; border-radius: 18px; }
.wdz-itemcal.is-beside .wdz-itemcal__head { text-align: left; margin-bottom: 14px; }
.wdz-itemcal.is-beside .wdz-itemcal__title { font-size: 1.1rem; line-height: 1.2; }
.wdz-itemcal.is-beside .wdz-itemcal__sub { font-size: .84rem; }
.wdz-itemcal.is-beside .wdz-itemcal__body { grid-template-columns: 1fr; gap: 14px; }
.wdz-itemcal.is-beside .wdz-itemcal__calhead { margin-bottom: 10px; }
.wdz-itemcal.is-beside .wdz-itemcal__month { font-size: 1rem; }
.wdz-itemcal.is-beside .wdz-itemcal__nav { width: 32px; height: 32px; font-size: 1.05rem; border-radius: 9px; }
.wdz-itemcal.is-beside .wdz-itemcal__wd { gap: 4px; margin-bottom: 5px; }
.wdz-itemcal.is-beside .wdz-itemcal__wd span { font-size: .6rem; }
.wdz-itemcal.is-beside .wdz-itemcal__grid { gap: 4px; }
.wdz-itemcal.is-beside .wdz-itemcal__cell { min-height: 34px; font-size: .84rem; border-radius: 8px; }
.wdz-itemcal.is-beside .wdz-itemcal__dnum { font-size: .84rem; }
.wdz-itemcal.is-beside .wdz-itemcal__dtag { font-size: .46rem; margin-top: 1px; }
.wdz-itemcal.is-beside .wdz-itemcal__legend { font-size: .72rem; gap: 12px; margin-top: 12px; padding-top: 10px; }
.wdz-itemcal.is-beside .wdz-itemcal__panel { min-height: 0; padding: 18px 16px; }
.wdz-itemcal.is-beside .wdz-itemcal__pbadge { font-size: 1rem; }
.wdz-itemcal.is-beside .wdz-itemcal__price { font-size: 1.55rem; margin: 8px 0 14px; }
.wdz-itemcal.is-beside .wdz-itemcal__book { padding: 12px 16px; font-size: .95rem; }
.wdz-itemcal.is-beside .wdz-itemcal__picon svg { width: 28px; height: 28px; }

/* If three columns can't fit, drop the calendar to its own full-width row. */
@media (max-width: 1000px) {
	.wdz-itemcal-row > #wdz-itemcal.is-beside { flex-basis: 100%; }
	.wdz-itemcal.is-beside .wdz-itemcal__body { grid-template-columns: 1.5fr 1fr; }
}
@media (max-width: 820px) {
	.wdz-itemcal.is-beside .wdz-itemcal__body { grid-template-columns: 1fr; }
	/* stack the product row (image, details, calendar) full-width on phones/tablets */
	.wdz-itemcal-row { flex-direction: column; }
	.wdz-itemcal-row > .io_product_picbox,
	.wdz-itemcal-row > .io_product_infobox,
	.wdz-itemcal-row > #wdz-itemcal.is-beside {
		flex: 1 1 auto !important;
		width: 100% !important;
		max-width: 100% !important;
		min-width: 0 !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wdz-itemcal__cell, .wdz-itemcal__book, .wdz-itemcal__nav { transition: none !important; }
	.wdz-itemcal__cell.is-open:hover { transform: none; }
	.wdz-itemcal__spin { animation-duration: 1.4s; }
}
