/*
 * Showroom grid (includes/showroom-grid.php). Values mirror the live Royal
 * Elementor grid, measured on 2cvgarage.nl — see tools/showroom-parity-spec.md.
 *
 * Royal's "Gill Sans" came from Elementor's own @font-face; it mapped weight
 * 100/300 to the Light file and 800 to the UltraBold file, which are the
 * theme's "Gill Sans Light" / "Gill Sans UltraBold" families.
 */

.showroom {
  position: relative;
  padding: 20px 48px 0;
}

/* --- Filter bar ------------------------------------------------------- */

/* Filters left, the shared "Huidig aanbod / Verkocht" toggle
   (partials/aanbod-status-toggle.php) right, as on /auto-aanbod/. */
.showroom__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 30px;
}

.showroom__bar .aanbod-status-toggle {
  margin-left: auto;
}

.showroom__filters {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.showroom__filters li {
  margin: 9px;
  font-family: "Gill Sans Light", sans-serif;
  font-size: 1.1rem;
  line-height: 32px;
  letter-spacing: -0.3px;
  text-transform: uppercase;
}

.showroom__filter,
.showroom__filter:hover,
.showroom__filter:focus {
  display: inline-block;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid #000;
  transition: border-color 0.1s;
}

.showroom__filter:hover,
.showroom__filter.is-active {
  border-bottom-color: #05baff;
}

/* --- Grid ------------------------------------------------------------- */

.showroom__grid {
  transition: opacity 0.3s;
}

.showroom__grid.is-fading {
  opacity: 0;
}

/* Royal's columns come out just under the exact width, floored to whole
   pixels (374 -> 373, 420.67 -> 420, 391.33 -> 391); match that. */
.showroom__sizer,
.showroom-card {
  width: calc((100% - 2 * 96px) / 3);
  width: round(down, calc((100% - 2 * 96px) / 3 - 0.2px), 1px);
}

.showroom__gutter {
  width: 96px;
}

/* Without JS (no Isotope): plain wrapping rows. */
.showroom:not(.is-enhanced) .showroom__grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  column-gap: 96px;
}

.showroom:not(.is-enhanced) .showroom__sizer,
.showroom:not(.is-enhanced) .showroom__gutter {
  display: none;
}

/* --- Card ------------------------------------------------------------- */

.showroom-card {
  position: relative;
  margin-bottom: 64px;
  padding-top: 50px;
  transition: opacity 0.5s 0.1s;
}

.showroom-card.is-entering {
  opacity: 0;
  transition: none;
}

.showroom-card__status,
.showroom-card__status:hover,
.showroom-card__status:focus {
  position: absolute;
  top: 48px;
  left: -40px;
  writing-mode: vertical-rl;
  background: #000;
  color: #05baff;
  font-family: "Gill Sans UltraBold", sans-serif;
  font-size: 1rem;
  line-height: 32px;
  text-transform: capitalize;
  text-decoration: none;
}

.showroom-card__media {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 4px;
}

.showroom-card__media img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.showroom-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.3s;
}

.showroom-card__media:hover img {
  transform: scale(1.1);
}

.showroom-card__media:hover::after {
  opacity: 1;
}

.showroom-card__title {
  position: relative;
  z-index: 1;
  margin: -14px 0 8px -20px;
  padding: 0;
  font-family: "Gill Sans UltraBold", sans-serif;
  font-size: 32px;
  line-height: 34px;
  text-transform: uppercase;
}

.showroom-card__title a,
.showroom-card__title a:focus {
  display: inline-block;
  font: inherit;
  color: #fff;
  text-decoration: none;
  transition: color 0.2s;
}

.showroom-card__title a:hover {
  color: #05baff;
  text-decoration: none;
}

/* Padding, not margin: Royal's 16px sat inside an inline block, so it
   never collapsed with the excerpt's 12px top margin. */
.showroom-card__props {
  margin: 0 0 0 -20px;
  padding-bottom: 16px;
  color: #fff;
  font-family: "Gill Sans Light", sans-serif;
  font-size: 1rem;
  line-height: 32px;
}

.showroom-card__price {
  font-weight: 700;
}

.showroom-card__props span:not(:last-child)::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 10px;
  margin: 0 8px 0 13px;
  background: #acacac;
}

.showroom-card__year:not(:last-child)::after {
  margin: 0 11px 0 15px;
}

.showroom-card__excerpt {
  width: 100%;
  margin: 12px 0 0 -20px;
  color: #fff;
  font-family: "Gill Sans Light", sans-serif;
  font-size: 20px;
  line-height: 26px;
}

.showroom-card__excerpt p {
  margin: 0;
  font: inherit;
  color: inherit;
}

/* For-sale page: no status label, so no room reserved for it; the grid
   starts 48px under the filters and the specs sit closer to the text
   (measured on live /auto-aanbod/). */
.showroom--auto-aanbod .showroom__grid {
  margin-top: 48px;
}

.showroom--auto-aanbod .showroom-card {
  padding-top: 0;
}

.showroom--auto-aanbod .showroom-card__props {
  padding-bottom: 4px;
}

/* Voitures-etc page (measured on live /aanbod-voitures-etc/): wider grid,
   48px rows at every width, bigger photo corners and title, "|"-separated
   specs in a smaller font, orange "Verkocht" badge on the right. */
.showroom--voitures-etc {
  padding: 70px 22px 0;
}

.showroom--voitures-etc .showroom-card {
  margin-bottom: 48px;
  padding-top: 0;
}

.showroom--voitures-etc .showroom-card__media {
  border-radius: 8px;
}

/* Royal "zoom out": slightly enlarged at rest, normal size on hover. */
.showroom--voitures-etc .showroom-card__media img {
  transform: scale(1.1);
}

.showroom--voitures-etc .showroom-card__media:hover img {
  transform: none;
}

.showroom--voitures-etc .showroom-card__title {
  margin: -22px 0 23px -24px;
  font-size: 36px;
  line-height: 41.6px;
}

.showroom--voitures-etc .showroom-card__props {
  padding-bottom: 16px;
  font-family: "Gill Sans SemiBold", sans-serif;
  font-size: 14px;
}

.showroom--voitures-etc .showroom-card__price {
  font-weight: normal;
}

.showroom--voitures-etc .showroom-card__props span:not(:last-child)::after,
.showroom--voitures-etc .showroom-card__year:not(:last-child)::after {
  content: "|";
  display: inline;
  width: auto;
  height: auto;
  margin: 0;
  padding-left: 4px;
  background: none;
}

.showroom--voitures-etc .showroom-card__unit {
  padding-left: 4px;
}

.showroom-card__badge,
.showroom-card__badge:hover,
.showroom-card__badge:focus {
  float: right;
  padding: 0 16px;
  border-radius: 3px;
  background: #ff9c00;
  color: #000;
  font-size: 0.8rem;
  line-height: 32px;
  text-transform: uppercase;
  text-decoration: none;
}

.showroom--voitures-etc .showroom-card__excerpt {
  margin: 0 0 0 -24px;
}

/* --- Pagination ------------------------------------------------------- */

.showroom__pagination {
  margin-top: 25px;
  min-height: 1px;
  text-align: center;
}

.showroom.is-enhanced .showroom__next {
  display: none;
}

.showroom__next {
  color: #fff;
  font-family: "Gill Sans SemiBold", sans-serif;
}

.showroom__loading,
.showroom__finish {
  display: none;
}

.showroom.is-loading .showroom__loading {
  position: relative;
  display: inline-block;
  width: 23px;
  height: 23px;
}

.showroom__loading span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #fff;
  opacity: 0.6;
  animation: showroom-bounce 2s ease-in-out infinite;
}

.showroom__loading span + span {
  animation-delay: -1s;
}

@keyframes showroom-bounce {
  0%, 100% { transform: scale(0); }
  50% { transform: scale(1); }
}

.showroom.is-finished .showroom__finish {
  display: block;
  margin: 0;
  color: #fff;
  font-family: "Gill Sans SemiBold", sans-serif;
  font-size: 1rem;
}

/* --- Tablet (Elementor tablet breakpoint) ----------------------------- */

@media (max-width: 1024px) {
  .showroom__filters {
    margin-bottom: 25px;
  }

  .showroom__filters li {
    margin: 0;
  }

  .showroom__filter {
    padding: 12px;
  }

  .showroom__sizer,
  .showroom-card {
    width: calc((100% - 64px) / 2);
    width: round(down, calc((100% - 64px) / 2 - 0.2px), 1px);
  }

  .showroom__gutter {
    width: 64px;
  }

  .showroom:not(.is-enhanced) .showroom__grid {
    column-gap: 64px;
  }

  .showroom-card {
    margin-bottom: 48px;
  }

  .showroom--auto-aanbod .showroom__grid {
    margin-top: 0;
  }

  /* Voitures-etc keeps its 96px gutter on tablets. */
  .showroom--voitures-etc .showroom__sizer,
  .showroom--voitures-etc .showroom-card {
    width: calc((100% - 96px) / 2);
    width: round(down, calc((100% - 96px) / 2 - 0.2px), 1px);
  }

  .showroom--voitures-etc .showroom__gutter {
    width: 96px;
  }
}

/* --- Mobile ----------------------------------------------------------- */

@media (max-width: 767px) {
  .showroom {
    margin-top: 16px;
    padding: 0;
  }

  /* The toggle wraps below the filters, right-aligned. */
  .showroom__bar .aanbod-status-toggle {
    margin-bottom: 24px;
  }

  .showroom__filters {
    margin-bottom: 12px;
  }

  .showroom__filters li {
    margin: 0 8px 0 2px;
  }

  .showroom__filter {
    padding: 0 0 0 8px;
  }

  .showroom__sizer,
  .showroom-card {
    width: calc(100% - 1px);
    width: round(down, calc(100% - 0.2px), 1px);
  }

  .showroom__gutter {
    width: 0;
  }

  .showroom-card {
    padding: 38px 0 32px;
  }

  /* On mobile the label overlaps the photo's left edge. */
  .showroom-card__status,
  .showroom-card__status:hover,
  .showroom-card__status:focus {
    top: 30px;
    left: -6px;
    z-index: 1;
    padding: 8px 0;
  }

  .showroom-card__title {
    margin: -16px 0 16px 0;
  }

  .showroom-card__props {
    margin: 0;
    padding-bottom: 0;
  }

  .showroom-card__excerpt {
    margin: 16px 0 0 0;
  }

  .showroom--auto-aanbod .showroom__grid {
    margin-top: 0;
  }

  .showroom--auto-aanbod .showroom-card__props {
    padding-bottom: 0;
  }

  .showroom--auto-aanbod .showroom-card {
    padding: 0;
  }

  .showroom--auto-aanbod .showroom-card__title {
    margin-top: -14px;
  }

  .showroom--voitures-etc {
    padding: 62px 14px 0;
  }

  .showroom--voitures-etc .showroom__sizer,
  .showroom--voitures-etc .showroom-card {
    width: calc(100% - 1px);
    width: round(down, calc(100% - 0.2px), 1px);
  }

  .showroom--voitures-etc .showroom__gutter {
    width: 0;
  }

  .showroom--voitures-etc .showroom-card {
    padding: 0 0 24px;
  }

  .showroom--voitures-etc .showroom-card__title {
    margin: 26px 0 11px 0;
    font-size: 24px;
  }

  .showroom--voitures-etc .showroom-card__badge {
    position: relative;
    top: -12px;
  }

  .showroom--voitures-etc .showroom-card__excerpt {
    margin: 0;
  }
}
