/*
 * Booking form (woocommerce-bookings/single-product/add-to-cart/booking.php).
 * Plain CSS rather than SCSS so it doesn't depend on the WP-SCSS plugin compiling.
 * Colours follow scss/_vars.scss: $col-green (navy), $col-light-green, $col-dark-green.
 */

.cleeve-booking {
  --cb-navy: #201b4e;
  --cb-navy-dark: #140f36;
  --cb-green: #a1bf60;
  --cb-green-soft: #eef4e2;
  --cb-green-dark: #5f6e2f;
  --cb-line: #e3e2ea;
  --cb-muted: #6f6c85;
  --cb-full: #f3f2f6;
  --cb-error: #c0392b;
  --cb-radius: 10px;

  margin: 0 0 1.5em;
}

.cleeve-booking * {
  font-size: 16px;
  line-height: 1.4;
}

.cleeve-booking__form {
  display: grid;
  gap: 28px;
  margin: 0 0 20px;
}

/* Steps */

.cleeve-booking__title,
.cleeve-booking__title label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--cb-navy);
}

.cleeve-booking__title label {
  position: static;
  margin: 0;
  pointer-events: auto;
}

.cleeve-booking__num {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cb-navy);
  color: #fff;
  font-family: 'Lato', sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.cleeve-booking__hint {
  margin: 0;
  color: var(--cb-muted);
}

/* Calendar */

.cleeve-cal {
  max-width: 420px;
  padding: 16px;
  border: 1px solid var(--cb-line);
  border-radius: var(--cb-radius);
  background: #fff;
}

.cleeve-cal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 12px;
}

.cleeve-cal__month {
  margin: 0;
  font-weight: 700;
}

.cleeve-booking .cleeve-cal__nav {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--cb-line);
  border-radius: 50%;
  background: #fff;
  color: var(--cb-navy);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.cleeve-booking .cleeve-cal__nav:hover:not(:disabled) {
  border-color: var(--cb-navy);
}

.cleeve-booking .cleeve-cal__nav:disabled {
  opacity: 0.3;
  cursor: default;
}

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

.cleeve-cal__weekdays span {
  padding: 4px 0;
  text-align: center;
  font-size: 13px;
  color: var(--cb-muted);
}

.cleeve-cal__grid {
  min-height: 250px;
  align-content: start;
  transition: opacity 0.2s;
}

.cleeve-cal__grid.is-loading {
  opacity: 0.5;
}

.cleeve-booking .cleeve-cal__day {
  aspect-ratio: 1;
  width: 100%;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #b9b7c6;
  font-weight: 400;
  text-align: center;
  cursor: default;
}

.cleeve-booking .cleeve-cal__day.is-available {
  background: var(--cb-green-soft);
  border-color: var(--cb-green);
  color: var(--cb-navy);
  font-weight: 700;
  cursor: pointer;
}

.cleeve-booking .cleeve-cal__day.is-available:not(.is-selected):hover,
.cleeve-booking .cleeve-cal__day.is-available:not(.is-selected):focus-visible {
  background: var(--cb-green);
  outline: none;
}

.cleeve-booking .cleeve-cal__day.is-full {
  background: var(--cb-full);
  color: #9d9aae;
  text-decoration: line-through;
}

.cleeve-booking .cleeve-cal__day.is-today:not(.is-selected) {
  box-shadow: inset 0 0 0 1px var(--cb-navy);
}

.cleeve-booking .cleeve-cal__day.is-selected {
  background: var(--cb-navy);
  border-color: var(--cb-navy);
  color: #fff;
}

.cleeve-cal__error {
  grid-column: 1 / -1;
  margin: 20px 0;
  color: var(--cb-error);
}

.cleeve-cal__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.cleeve-cal__legend li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--cb-muted);
}

.cleeve-cal__key {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.cleeve-cal__key--available { background: var(--cb-green-soft); border: 2px solid var(--cb-green); }
.cleeve-cal__key--full { background: var(--cb-full); border: 2px solid var(--cb-line); }
.cleeve-cal__key--selected { background: var(--cb-navy); }

/* Sessions */

.cleeve-times {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  max-width: 560px;
}

.cleeve-times .cleeve-booking__hint {
  grid-column: 1 / -1;
}

.cleeve-booking .cleeve-times__slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 8px;
  margin: 0;
  border: 2px solid var(--cb-green);
  border-radius: 8px;
  background: #fff;
  color: var(--cb-navy);
  font-weight: 700;
  cursor: pointer;
}

.cleeve-booking .cleeve-times__slot:not(:disabled):not(.is-selected):hover,
.cleeve-booking .cleeve-times__slot:not(.is-selected):focus-visible {
  background: var(--cb-green-soft);
  outline: none;
}

.cleeve-booking .cleeve-times__slot.is-selected {
  background: var(--cb-navy);
  border-color: var(--cb-navy);
  color: #fff;
}

.cleeve-booking .cleeve-times__slot.is-selected span {
  color: #fff;
}

.cleeve-booking .cleeve-times__slot.is-booked {
  border-color: var(--cb-line);
  background: var(--cb-full);
  color: #9d9aae;
  cursor: default;
}

.cleeve-times__slot.is-booked .cleeve-times__time {
  color: #9d9aae;
  text-decoration: line-through;
}

.cleeve-times__status {
  font-size: 12px;
  font-weight: 400;
  color: #9d9aae;
}

/* Dogs */

.cleeve-booking__select {
  position: relative;
  max-width: 420px;
}

.cleeve-booking__select::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 20px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--cb-navy);
  border-bottom: 2px solid var(--cb-navy);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.cleeve-booking .cleeve-booking__select select {
  width: 100%;
  margin: 0;
  padding: 14px 44px 14px 16px;
  border: 2px solid var(--cb-green);
  border-radius: 8px;
  background: #fff;
  color: var(--cb-navy);
  font-weight: 700;
  cursor: pointer;
}

.cleeve-booking .cleeve-booking__select select:focus {
  border-color: var(--cb-navy);
}

/* Summary + actions */

.cleeve-booking__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 560px;
  padding: 14px 18px;
  border-radius: var(--cb-radius);
  background: var(--cb-green-soft);
  border-left: 4px solid var(--cb-green);
}

.cleeve-booking__summary[hidden] {
  display: none;
}

.cleeve-booking__summary.is-loading {
  opacity: 0.6;
}

.cleeve-booking__summary.is-error {
  background: #fdecea;
  border-left-color: var(--cb-error);
  color: var(--cb-error);
}

.cleeve-booking__summary-price {
  font-size: 24px;
  font-weight: 700;
  white-space: nowrap;
}

/* WooCommerce floats form.cart buttons; this one sits on its own line. */
.woocommerce .cleeve-booking button.button.alt.cleeve-booking__submit {
  float: none;
  display: block;
  width: 100%;
  max-width: 560px;
  margin: 0;
  border-radius: 8px;
}

.woocommerce .cleeve-booking button.button.alt.cleeve-booking__submit.disabled {
  background: #b9b7c6;
  cursor: not-allowed;
  opacity: 1;
}

.cleeve-booking__express-sep {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 560px;
  margin: 18px 0 0;
  color: var(--cb-muted);
}

.cleeve-booking__express-sep[hidden] {
  display: none;
}

.cleeve-booking__express-sep::before,
.cleeve-booking__express-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--cb-line);
}

.cleeve-booking__express-sep span {
  font-size: 14px;
  color: var(--cb-muted);
}

#wc-stripe-express-checkout-element {
  max-width: 560px;
  transition: opacity 0.2s;
}

/* Until a date, time and dog band are chosen, the Google Pay / Link buttons can't be used. */
#wc-stripe-express-checkout-element.cleeve-express-locked {
  opacity: 0.4;
  pointer-events: none;
}

@media (max-width: 480px) {
  .cleeve-cal {
    padding: 10px;
  }

  .cleeve-times {
    grid-template-columns: repeat(3, 1fr);
  }

  .cleeve-booking__title,
  .cleeve-booking__title label {
    font-size: 20px;
  }
}

/* ------------------------------------------------------------------
 * Booking product page layout (inc/content/booking-product.php)
 * ------------------------------------------------------------------ */

.cleeve-book {
  --cb-navy: #201b4e;
  --cb-green: #a1bf60;
  --cb-green-soft: #eef4e2;
  --cb-line: #e3e2ea;
  --cb-muted: #6f6c85;
  --cb-radius: 10px;
}

.cleeve-book .container.small-pad {
  padding-top: 40px;
  padding-bottom: 60px;
}

.cleeve-book__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 24px;
  margin: 0 0 24px;
}

.woocommerce .cleeve-book__header .product_title {
  margin: 0;
  font-size: 36px;
  line-height: 1.15;
}

/* The header rating sits inline, so no bottom margin on the stars (more specific than the shared star rules below). */
.woocommerce .cleeve-book__header .woocommerce-product-rating .star-rating {
  margin: 0;
}

.woocommerce .cleeve-book__header .woocommerce-product-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.cleeve-book__header .woocommerce-review-link {
  font-size: 15px;
  color: var(--cb-muted);
}

.cleeve-book__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  align-items: start;
}

.cleeve-book__card {
  padding: 28px;
  border: 1px solid var(--cb-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(32, 27, 78, 0.06);
}

.woocommerce div.product .cleeve-book__card form.cart {
  margin: 0;
}

/* Inside the card the pieces can use the full width. */
.cleeve-book__card .cleeve-booking__summary,
.woocommerce .cleeve-book__card .cleeve-booking button.button.alt.cleeve-booking__submit,
.cleeve-book__card .cleeve-booking__express-sep,
.cleeve-book__card #wc-stripe-express-checkout-element {
  max-width: none;
}

.cleeve-book__card .cleeve-cal {
  max-width: none;
}

/* Wide screens: calendar on the left, sessions and dogs on the right. */
@media (min-width: 1100px) {
  .cleeve-book__card .cleeve-booking__form {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 32px;
  }

  .cleeve-book__card .cleeve-booking__step:first-of-type {
    grid-row: span 2;
  }

  .cleeve-book__card .cleeve-booking__summary {
    grid-column: 1 / -1;
  }

  .cleeve-book__card .cleeve-times {
    grid-template-columns: repeat(3, 1fr);
  }
}

.cleeve-book__aside {
  display: grid;
  gap: 20px;
  position: sticky;
  top: 20px;
}

.cleeve-book__panel {
  padding: 22px 24px;
  border-radius: 14px;
  background: var(--cb-green-soft);
}

.cleeve-book__about {
  background: #f6f6f9;
}

.cleeve-book__panel *,
.cleeve-book__about p {
  font-size: 16px;
  line-height: 1.5;
}

.cleeve-book .cleeve-book__panel-title {
  margin: 0 0 12px;
  font-size: 20px;
}

.cleeve-book__prices {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cleeve-book__prices li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(32, 27, 78, 0.1);
}

.cleeve-book__prices strong {
  font-weight: 700;
}

.cleeve-book__hours {
  margin: 12px 0 0;
  color: var(--cb-muted);
}

.cleeve-book__about p {
  margin: 0 0 10px;
}

.cleeve-book__about p:last-child {
  margin-bottom: 0;
}

/* Gallery */

.cleeve-book__gallery,
.cleeve-book__reviews {
  margin-top: 56px;
}

.cleeve-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 200px;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cleeve-gallery__item:first-child {
  grid-column: span 2;
  grid-row: span 2;
}

.cleeve-gallery__link {
  display: block;
  height: 100%;
  overflow: hidden;
  border-radius: var(--cb-radius);
}

.cleeve-gallery__link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.cleeve-gallery__link:hover img,
.cleeve-gallery__link:focus-visible img {
  transform: scale(1.04);
}

/* Lightbox styles are shared with the homepage: css/lightbox.css */

.cleeve-booking .cleeve-cal__nav svg {
  display: block;
  color: inherit; /* the theme's `* { color }` rule would otherwise make the icons navy */
}

/* Reviews: WooCommerce's review template restyled to match the homepage cards (css/home.css) */

.cleeve-book__reviews-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 24px;
}

.woocommerce .cleeve-book__reviews-head h2 {
  margin: 0;
}

.cleeve-book__reviews-summary,
.cleeve-book__reviews-summary * {
  margin: 0;
  font-size: 16px;
  color: var(--cb-muted);
}

.cleeve-book__reviews-summary .cleeve-stars {
  color: #e4a11b;
  letter-spacing: 2px;
}

/* The heading above replaces WooCommerce's "12 reviews for …" title. */
.cleeve-book__reviews .woocommerce-Reviews-title {
  display: none;
}

.woocommerce .cleeve-book__reviews #reviews #comments ol.commentlist {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 0;
  padding: 0;
}

/* WooCommerce's clearfix pseudo-elements would take up grid cells. */
.woocommerce .cleeve-book__reviews #reviews #comments ol.commentlist::before,
.woocommerce .cleeve-book__reviews #reviews #comments ol.commentlist::after {
  display: none;
}

.woocommerce .cleeve-book__reviews #reviews #comments ol.commentlist li {
  display: flex;
  margin: 0;
  padding: 28px;
  border-radius: 14px;
  background: #f6f6f9;
}

.woocommerce .cleeve-book__reviews #reviews #comments ol.commentlist li .comment_container {
  display: flex;
  width: 100%;
}

.woocommerce .cleeve-book__reviews #reviews #comments ol.commentlist li img.avatar {
  display: none;
}

/* Stars first, then the quote, then who wrote it. */
.woocommerce .cleeve-book__reviews #reviews #comments ol.commentlist li .comment-text {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
}

.cleeve-book__reviews .comment-text .star-rating { order: 1; }
.cleeve-book__reviews .comment-text .description { order: 2; flex: 1; }
.cleeve-book__reviews .comment-text .meta { order: 3; }

.woocommerce .cleeve-book__reviews .comment-text .star-rating,
.woocommerce .cleeve-book__header .star-rating {
  position: relative;
  align-self: flex-start; /* shrink to the stars so the partial-width gold layer lines up */
  float: none;
  width: auto;
  height: auto;
  margin: 0 0 12px;
  font-family: inherit;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 2px;
  overflow: hidden;
}

/* Plain star characters (like the homepage) instead of the theme's icon font. */
.woocommerce .cleeve-book__reviews .comment-text .star-rating::before,
.woocommerce .cleeve-book__header .star-rating::before {
  content: '\2605\2605\2605\2605\2605' !important;
  position: static;
  float: none;
  font-family: inherit;
  color: #dcdae4;
}

.woocommerce .cleeve-book__reviews .comment-text .star-rating span,
.woocommerce .cleeve-book__header .star-rating span {
  top: 0;
  left: 0;
  height: 18px;
  padding: 0;
  overflow: hidden;
  font-size: 0;
  white-space: nowrap;
}

/* The "Rated 5 out of 5" text stays for screen readers (the element also has an aria-label). */
.woocommerce .cleeve-book__reviews .comment-text .star-rating span *,
.woocommerce .cleeve-book__header .star-rating span * {
  font-size: 0;
}

.woocommerce .cleeve-book__reviews .comment-text .star-rating span::before,
.woocommerce .cleeve-book__header .star-rating span::before {
  content: '\2605\2605\2605\2605\2605' !important;
  font-family: inherit;
  font-size: 18px;
  color: #e4a11b;
}

.cleeve-book__reviews .comment-text .description,
.cleeve-book__reviews .comment-text .description p {
  margin: 0 0 16px;
  font-size: 18px;
  line-height: 1.55;
}

.woocommerce .cleeve-book__reviews #reviews #comments ol.commentlist li .meta {
  margin: 0;
  font-size: 14px;
  color: var(--cb-muted);
}

.woocommerce .cleeve-book__reviews .meta .woocommerce-review__author {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--cb-navy);
}

.woocommerce .cleeve-book__reviews .meta .woocommerce-review__verified {
  font-size: 13px;
  font-style: normal;
  color: #5f6e2f;
}

.woocommerce .cleeve-book__reviews .meta .woocommerce-review__dash {
  display: none;
}

.woocommerce .cleeve-book__reviews .meta time {
  display: block;
  font-size: 14px;
  color: var(--cb-muted);
}

/* Leave a review */

.cleeve-book__reviews #review_form_wrapper {
  max-width: 720px;
  margin-top: 40px;
  padding: 28px;
  border: 1px solid var(--cb-line);
  border-radius: 14px;
}

.cleeve-book__reviews #review_form * {
  font-size: 16px;
}

.cleeve-book__reviews #review_form .comment-reply-title {
  display: block;
  margin-bottom: 8px;
  font-family: 'Playfair Display', serif;
  font-size: 22px;
}

/* Tablets and phones: one column, booking form straight after the title. */
@media (max-width: 900px) {
  .cleeve-book__layout {
    grid-template-columns: 1fr;
  }

  .cleeve-book__aside {
    position: static;
  }

  .woocommerce .cleeve-book__reviews #reviews #comments ol.commentlist {
    grid-template-columns: 1fr;
  }

  .cleeve-gallery {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 150px;
  }
}

@media (max-width: 600px) {
  .cleeve-book .container.small-pad {
    padding-top: 24px;
  }

  .woocommerce .cleeve-book__header .product_title {
    font-size: 26px;
  }

  .cleeve-book__header {
    margin-bottom: 16px;
  }

  .cleeve-book__card {
    margin: 0 -8px;
    padding: 18px 14px;
  }

  .cleeve-booking__form {
    gap: 22px;
  }

}
