/* CCS_CAROUSEL_CSS_MARKER
   Chamathka Cab Service — scroll-snap carousel primitive.
   Snippet: "CCS Carousel Styles" | group: Shared Styles | type: css | run_at: wp_head

   Shared by the vehicles section and the reviews section. The row scrolls and
   snaps with no JavaScript at all; ccs-carousel.js only adds the buttons and
   the progress indicator. */

.ccs-carousel {
  position: relative;
}

.ccs-carousel__viewport {
  display: grid;
  grid-auto-flow: column;
  /* Definite track widths. A minmax() min of 0 would let the browser squeeze
     every card into the viewport instead of letting the row scroll. */
  grid-auto-columns: 86%;
  gap: var(--wp--custom--grid-gap);
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding-block-end: var(--wp--preset--spacing--20);
  /* Let cards breathe at the viewport edges on small screens. */
  margin-inline: calc(var(--wp--custom--container-gutter) * -1);
  padding-inline: var(--wp--custom--container-gutter);
}

.ccs-carousel__viewport::-webkit-scrollbar {
  display: none;
}

.ccs-carousel__item {
  scroll-snap-align: start;
  min-width: 0;
  /* The cards inside stretch to the tallest in the row. */
  display: flex;
}

.ccs-carousel__item > * {
  flex: 1;
}

@media (min-width: 640px) {
  .ccs-carousel__viewport {
    grid-auto-columns: calc(50% - var(--wp--custom--grid-gap) / 2);
  }
}

@media (min-width: 1000px) {
  .ccs-carousel__viewport {
    grid-auto-columns: calc(33.333% - var(--wp--custom--grid-gap) * 2 / 3);
    margin-inline: 0;
    padding-inline: 0;
  }
}

/* Hidden when the whole row is already in view (class set from the script). */
.ccs-carousel.is-static .ccs-carousel__controls {
  display: none;
}

.ccs-carousel__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wp--preset--spacing--50);
  margin-top: var(--wp--preset--spacing--50);
}

.ccs-carousel__buttons {
  display: flex;
  gap: var(--wp--preset--spacing--20);
}

.ccs-carousel__button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: var(--wp--custom--border-hairline) solid var(--wp--preset--color--line-strong);
  border-radius: var(--wp--custom--radius-md);
  background-color: var(--wp--preset--color--base);
  color: var(--wp--preset--color--contrast);
  cursor: pointer;
  transition:
    background-color var(--wp--custom--duration-fast) var(--wp--custom--ease-out),
    border-color var(--wp--custom--duration-fast) var(--wp--custom--ease-out),
    color var(--wp--custom--duration-fast) var(--wp--custom--ease-out);
}

.ccs-carousel__button:hover:not(:disabled) {
  background-color: var(--wp--preset--color--accent);
  border-color: var(--wp--preset--color--accent);
  color: var(--wp--preset--color--base);
}

.ccs-carousel__button:disabled {
  opacity: 0.35;
  cursor: default;
}

.ccs-section--inverse .ccs-carousel__button,
.ccs-section--black .ccs-carousel__button {
  background-color: transparent;
  border-color: var(--wp--custom--border-inverse);
  color: var(--wp--preset--color--base);
}

.ccs-carousel__progress {
  position: relative;
  flex: 1;
  max-width: 220px;
  height: 3px;
  border-radius: var(--wp--custom--radius-pill);
  background-color: var(--wp--preset--color--line);
  overflow: hidden;
}

.ccs-section--inverse .ccs-carousel__progress,
.ccs-section--black .ccs-carousel__progress {
  background-color: rgba(255, 255, 255, 0.16);
}

.ccs-carousel__progress-bar {
  position: absolute;
  inset-block: 0;
  left: 0;
  display: block;
  width: 33%;
  border-radius: inherit;
  background-color: var(--wp--preset--color--accent);
  transition:
    width var(--wp--custom--duration-base) var(--wp--custom--ease-out),
    transform var(--wp--custom--duration-base) var(--wp--custom--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  .ccs-carousel__viewport {
    scroll-behavior: auto;
  }

  .ccs-carousel__progress-bar {
    transition: none;
  }
}
