/* =========================================================
   Yacht Manager – Public Styles
   ========================================================= */

/* ----- Base wrap ----- */
.ym-wrap {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 16px;
	font-family: inherit;
}

/* ----- Buttons ----- */
.ym-btn {
	display: inline-block;
	padding: 8px 20px;
	border-radius: 4px;
	font-size: 0.9rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	border: 2px solid transparent;
	transition: opacity 0.15s ease;
}
.ym-btn:hover { opacity: 0.85; text-decoration: none; }
.ym-btn--primary  { background: #0073aa; color: #fff; border-color: #0073aa; }
.ym-btn--secondary{ background: transparent; color: #0073aa; border-color: #0073aa; }

/* =========================================================
   Filters
   ========================================================= */
.ym-filters {
	background: #f8f9fa;
	border: 1px solid #e2e4e8;
	border-radius: 6px;
	padding: 20px 24px;
	margin-bottom: 28px;
}
.ym-filters__row {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 16px;
}
.ym-filters__row:last-child { margin-bottom: 0; }

.ym-filters__field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 160px;
	flex: 1 1 160px;
}
.ym-filters__field label {
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #555;
}
.ym-filters__field input,
.ym-filters__field select {
	padding: 7px 10px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 0.9rem;
	background: #fff;
}
.ym-filters__field--range .ym-filters__range {
	display: flex;
	align-items: center;
	gap: 6px;
}
.ym-filters__field--range input { flex: 1; min-width: 0; }
.ym-filters__field--submit {
	flex-direction: row;
	align-items: flex-end;
	gap: 8px;
}

/* =========================================================
   Results header
   ========================================================= */
.ym-results-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
}
.ym-results-count {
	margin: 0;
	color: #666;
	font-size: 0.9rem;
}
.ym-no-results {
	text-align: center;
	color: #666;
	padding: 40px;
}

/* =========================================================
   Yacht grid / cards
   ========================================================= */
.ym-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 24px;
	margin-bottom: 32px;
}

.ym-card {
	border: 1px solid #e2e4e8;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.15s ease;
}
.ym-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }

.ym-card__img-wrap {
	display: block;
	aspect-ratio: 4/3;
	overflow: hidden;
	background: #f0f0f0;
}
.ym-card__img-wrap--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
}
.ym-card__img-wrap--placeholder::after {
	content: '⛵';
	font-size: 3rem;
	opacity: 0.3;
}
.ym-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ym-card__body {
	padding: 16px;
	display: flex;
	flex-direction: column;
	flex: 1;
}
.ym-card__title {
	font-size: 1rem;
	font-weight: 700;
	margin: 0 0 10px;
	line-height: 1.3;
}
.ym-card__title a { text-decoration: none; color: inherit; }
.ym-card__title a:hover { color: #0073aa; }

.ym-card__meta {
	list-style: none;
	padding: 0;
	margin: 0 0 12px;
	font-size: 0.85rem;
	color: #555;
	display: flex;
	flex-direction: column;
	gap: 3px;
}
.ym-label {
	display: inline-block;
	width: 68px;
	font-weight: 600;
	color: #333;
}

.ym-card__price {
	font-size: 1.1rem;
	font-weight: 700;
	color: #0073aa;
	margin: 0 0 14px;
}
.ym-card__cta { align-self: flex-start; margin-top: auto; }

/* =========================================================
   Pagination
   ========================================================= */
.ym-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: center;
	margin: 24px 0;
}
.ym-pagination__link {
	display: inline-block;
	padding: 6px 12px;
	border: 1px solid #ccc;
	border-radius: 4px;
	text-decoration: none;
	font-size: 0.9rem;
	color: #333;
}
.ym-pagination__link.is-active,
.ym-pagination__link:hover {
	background: #0073aa;
	border-color: #0073aa;
	color: #fff;
}

/* =========================================================
   Detail page
   ========================================================= */
.ym-detail {
	max-width: 960px;
	margin: 0 auto;
}
.ym-detail__back {
	display: inline-block;
	margin-bottom: 16px;
	text-decoration: none;
	color: #0073aa;
	font-size: 0.9rem;
}
.ym-detail__back:hover { text-decoration: underline; }
.ym-detail .ym-detail__title {
	font-size: 1.8rem;
	font-weight: 700;
	font-family: inherit;
	line-height: 1.2;
	margin: 0 0 24px;
	padding: 0;
	border: none;
	background: none;
	text-transform: none;
	letter-spacing: normal;
	color: inherit;
}

/* Gallery */
.ym-gallery {
	display: grid;
	grid-template-columns: 1fr 156px;
	grid-template-rows: 460px;
	gap: 8px;
	margin-bottom: 32px;
}
.ym-gallery--single {
	grid-template-columns: 1fr;
}

/* Hero (main) image */
.ym-gallery__main {
	overflow: hidden;
	border-radius: 6px;
	min-height: 0;
}
.ym-gallery__main .ym-gallery__hero {
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: cover;
	display: block;
	margin: 0;
	padding: 0;
	border-radius: 6px;
	border: none;
	box-shadow: none;
	cursor: zoom-in;
	transition: opacity 0.18s ease;
}

/* Thumbnail sidebar */
.ym-gallery__thumbs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 4px;
	overflow-y: auto;
	align-content: start;
	min-height: 0;
}
.ym-gallery__thumbs .ym-gallery__thumb {
	padding: 0;
	margin: 0;
	border: 2px solid transparent;
	border-radius: 4px;
	overflow: hidden;
	cursor: pointer;
	background: none;
	transition: border-color 0.15s;
	line-height: 0;
	box-sizing: border-box;
}
.ym-gallery__thumbs .ym-gallery__thumb img {
	width: 100%;
	max-width: 100%;
	height: auto;
	aspect-ratio: 4/3;
	object-fit: cover;
	display: block;
	margin: 0;
	padding: 0;
	border: none;
	border-radius: 0;
	box-shadow: none;
	vertical-align: top;
}
.ym-gallery__thumbs .ym-gallery__thumb--active,
.ym-gallery__thumbs .ym-gallery__thumb:hover {
	border-color: #0073aa;
}

/* Mobile: stack vertically */
@media (max-width: 640px) {
	.ym-gallery {
		grid-template-columns: 1fr;
		grid-template-rows: auto;
	}
	.ym-gallery__main {
		aspect-ratio: 16/9;
	}
	.ym-gallery__hero {
		height: auto;
	}
	.ym-gallery__thumbs {
		grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
		max-height: 160px;
		overflow-y: auto;
	}
}

/* Lightbox */
.ym-lightbox {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.92);
	z-index: 9999;
	align-items: center;
	justify-content: center;
}
.ym-lightbox--open {
	display: flex;
}
.ym-lightbox__img-wrap {
	max-width: 90vw;
	max-height: 90vh;
	display: flex;
	align-items: center;
	justify-content: center;
}
.ym-lightbox__img {
	max-width: 90vw;
	max-height: 90vh;
	object-fit: contain;
	border-radius: 4px;
	transition: opacity 0.18s ease;
}
.ym-lightbox__close {
	position: absolute;
	top: 16px;
	right: 20px;
	background: none;
	border: none;
	color: #fff;
	font-size: 2.2rem;
	line-height: 1;
	cursor: pointer;
	opacity: 0.8;
	transition: opacity 0.15s;
}
.ym-lightbox__close:hover { opacity: 1; }
.ym-lightbox__prev,
.ym-lightbox__next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.15);
	border: none;
	color: #fff;
	font-size: 1.4rem;
	cursor: pointer;
	padding: 14px 18px;
	border-radius: 6px;
	transition: background 0.15s;
	line-height: 1;
}
.ym-lightbox__prev:hover,
.ym-lightbox__next:hover { background: rgba(255, 255, 255, 0.28); }
.ym-lightbox__prev { left: 16px; }
.ym-lightbox__next { right: 16px; }
.ym-lightbox__counter {
	position: absolute;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, 0.6);
	font-size: 0.85rem;
	pointer-events: none;
}

/* Detail body layout */
.ym-detail__body {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 32px;
}
@media (max-width: 640px) {
	.ym-detail__body { grid-template-columns: 1fr; }
}

/* Specs table */
.ym-detail__body .ym-specs__heading,
.ym-detail__body .ym-description__heading {
	font-size: 1.1rem;
	font-weight: 700;
	margin: 0 0 12px;
	padding-bottom: 6px;
	padding-top: 0;
	padding-left: 0;
	padding-right: 0;
	border: none;
	border-bottom: 2px solid #0073aa;
	background: none;
	color: inherit;
	text-transform: none;
	letter-spacing: normal;
}
.ym-detail__body .ym-specs__table {
	display: table;
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
	margin-bottom: 0;
	max-width: 100%;
}
.ym-detail__body .ym-specs__table th,
.ym-detail__body .ym-specs__table td {
	border: none;
	border-bottom: 1px solid #eee;
	padding: 8px 10px;
	text-align: left;
}
.ym-detail__body .ym-specs__table th {
	font-weight: 600;
	color: #555;
	width: 40%;
}
.ym-detail__body .ym-specs__price-row th,
.ym-detail__body .ym-specs__price-row td {
	font-size: 1.1rem;
	font-weight: 700;
	color: #0073aa;
}

/* Description */
.ym-description__body {
	font-size: 0.95rem;
	line-height: 1.7;
	color: #333;
}

/* Not found */
.ym-not-found {
	color: #666;
	margin-bottom: 16px;
}

/* =========================================================
   HTMX loading indicator
   ========================================================= */

/* The element is always in the DOM but invisible by default.
   HTMX adds the .htmx-request class to the indicator while a
   request is in-flight. */
.ym-loading {
	height: 3px;
	background: transparent;
	margin-bottom: 12px;
	overflow: hidden;
	opacity: 0;
	transition: opacity 0.1s ease;
}
.ym-loading.htmx-request {
	opacity: 1;
}
#ym-filter-form.htmx-request ~ #ym-results {
	pointer-events: none;
	opacity: 0.6;
	transition: opacity 0.1s ease;
}
.ym-loading__bar {
	display: block;
	height: 100%;
	width: 40%;
	background: #0073aa;
	border-radius: 2px;
	animation: ym-slide 1.2s ease-in-out infinite;
}
@keyframes ym-slide {
	0%   { transform: translateX(-100%); }
	100% { transform: translateX(350%); }
}

/* =========================================================
   Availability calendar
   ========================================================= */
.ym-availability {
	margin-top: 40px;
}
.ym-availability__heading {
	font-size: 1.1rem;
	font-weight: 700;
	margin: 0 0 20px;
	padding-bottom: 6px;
	border-bottom: 2px solid #0073aa;
}
.ym-availability__loading {
	color: #888;
	font-size: 0.9rem;
}

.ym-calendar-viewport {
	overflow: hidden;
}
.ym-calendar {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 24px;
}
.ym-calendar__month {
	background: #f8f9fa;
	border: 1px solid #e2e4e8;
	border-radius: 6px;
	padding: 20px 20px 16px;
}
.ym-calendar__month-title {
	font-size: 0.85rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #444;
	margin-bottom: 10px;
	text-align: center;
}
.ym-calendar__month .ym-calendar__grid {
	display: table;
	width: 100%;
	border-collapse: collapse;
	font-size: 0.78rem;
	margin-bottom: 0;
	max-width: 100%;
}
.ym-calendar__month .ym-calendar__grid thead,
.ym-calendar__month .ym-calendar__grid tbody {
	display: table-row-group;
	width: 100%;
}
.ym-calendar__month .ym-calendar__grid thead {
	display: table-header-group;
}
.ym-calendar__month .ym-calendar__grid tr {
	display: table-row;
}
.ym-calendar__month .ym-calendar__grid th,
.ym-calendar__month .ym-calendar__grid td {
	display: table-cell;
	border: none;
	padding: 0;
}
.ym-calendar__month .ym-calendar__grid th {
	text-align: center;
	font-weight: 600;
	color: #888;
	padding: 3px 0 6px;
}
.ym-calendar__day {
	text-align: center;
	padding: 2px;
}
.ym-calendar__day span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	font-size: 0.78rem;
}
.ym-calendar__day--empty span,
.ym-calendar__day--past span {
	color: #ccc;
}
.ym-calendar__day--free span {
	background: #e6f4ea;
	color: #2d7a3a;
	cursor: pointer;
}
.ym-calendar__day--free span:hover {
	background: #2d7a3a;
	color: #fff;
}
.ym-calendar__day--special span {
	background: #e3f2fd;
	color: #1565c0;
	cursor: pointer;
}
.ym-calendar__day--special span:hover {
	background: #1565c0;
	color: #fff;
}
.ym-calendar__day--booked span {
	background: #fdecea;
	color: #c0392b;
}
.ym-calendar__day--loading span {
	background: #e6f4ea;
	color: transparent;
	cursor: default;
	pointer-events: none;
	position: relative;
}
.ym-calendar__day--loading span::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 14px;
	height: 14px;
	margin: -7px 0 0 -7px;
	border-radius: 50%;
	border: 2px solid rgba(45, 122, 58, 0.25);
	border-top-color: #2d7a3a;
	animation: ym-spin 0.7s linear infinite;
}
@keyframes ym-spin {
	to { transform: rotate(360deg); }
}

.ym-calendar__legend {
	grid-column: 1 / -1;
	display: flex;
	gap: 20px;
	font-size: 0.82rem;
	margin-top: 4px;
}
.ym-calendar__legend-item {
	display: flex;
	align-items: center;
	gap: 6px;
}
.ym-calendar__legend-item::before {
	content: '';
	display: inline-block;
	width: 14px;
	height: 14px;
	border-radius: 50%;
}
.ym-calendar__legend-item--free::before    { background: #e6f4ea; border: 1px solid #2d7a3a; }
.ym-calendar__legend-item--special::before { background: #e3f2fd; border: 1px solid #1565c0; }
.ym-calendar__legend-item--booked::before  { background: #fdecea; border: 1px solid #c0392b; }

.ym-calendar__contact {
	font-size: 0.82rem;
	color: #666;
	margin-top: 8px;
	white-space: nowrap;
}
.ym-calendar__contact a {
	color: #2d7a3a;
	text-decoration: underline;
}
.ym-contact-prompt {
	font-size: 0.85rem;
	margin: 0 0 8px;
	color: #333;
}
.ym-contact-link {
	display: inline-block;
	padding: 6px 14px;
	background: #2d7a3a;
	color: #fff;
	border-radius: 4px;
	font-size: 0.85rem;
	text-decoration: none;
	white-space: nowrap;
}
.ym-contact-link:hover {
	background: #235f2c;
	color: #fff;
}
.ym-calendar-wrap {
	position: relative;
}

.ym-booking-picker {
	display: none;
	position: absolute;
	z-index: 100;
	flex-wrap: wrap;
	gap: 6px;
	background: #fff;
	border: 1px solid #e2e4e8;
	border-radius: 8px;
	padding: 10px 12px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.ym-booking-picker--visible {
	display: flex;
}

.ym-year-nav {
	display: grid;
	grid-template-columns: 32px 1fr 32px;
	align-items: center;
	margin-bottom: 16px;
}
.ym-year-nav__label {
	font-size: 1.1rem;
	font-weight: 700;
	text-align: center;
	color: #333;
}
.ym-year-nav__arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 1px solid #c0c4cc;
	background: #fff;
	color: #555;
	font-size: 1rem;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ym-year-nav__arrow:hover {
	background: #0073aa;
	border-color: #0073aa;
	color: #fff;
}

.ym-duration-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 16px;
	justify-content: center;
}
.ym-duration-pill {
	padding: 5px 14px;
	border-radius: 999px;
	border: 1px solid #c0c4cc;
	background: #fff;
	color: #555;
	font-size: 0.82rem;
	cursor: pointer;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ym-duration-pill--active {
	background: #2d7a3a;
	border-color: #2d7a3a;
	color: #fff;
}
.ym-duration-pill--active.ym-duration-pill--special {
	background: #1565c0;
	border-color: #1565c0;
	color: #fff;
}
.ym-duration-pill:hover:not(.ym-duration-pill--active) {
	border-color: #2d7a3a;
	color: #2d7a3a;
}

/* Mobile month nav (hidden on desktop) */
.ym-mobile-month-nav {
	display: none;
	grid-template-columns: 32px 1fr 32px;
	align-items: center;
	margin-bottom: 12px;
}
.ym-mobile-month-nav__label {
	font-size: 1rem;
	font-weight: 700;
	text-align: center;
	color: #333;
}
.ym-mobile-month-nav__arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 1px solid #c0c4cc;
	background: #fff;
	color: #555;
	font-size: 1rem;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ym-mobile-month-nav__arrow:hover {
	background: #0073aa;
	border-color: #0073aa;
	color: #fff;
}

/* Responsive */
@media (max-width: 640px) {
	.ym-mobile-month-nav { display: grid; }
	.ym-calendar { grid-template-columns: 1fr; }
	.ym-calendar__month { width: 100%; box-sizing: border-box; }
	.ym-calendar__grid { table-layout: fixed; }
	.ym-calendar__day span { width: 34px; height: 34px; font-size: 0.9rem; }
}
@media (max-width: 600px) {
	.ym-filters__row { flex-direction: column; }
	.ym-grid { grid-template-columns: 1fr; }
}
