/*
Plugin: KMH Caravan Rentals
Description: Styles for rental unit archive and single listings.
*/

/* === Layout Containers === */

.caravan-type {
  display: inline-block;
  margin: 6px 0 10px;
  padding: 4px 8px;
  background: #e6f0fa;
  color: #00507a;
  font-weight: 600;
  font-size: 0.85em;
  border-radius: 6px;
}


.rental-sale-layout {
  display: flex;
  align-items: flex-start;
  flex-wrap: nowrap; /* ✅ prevent wrapping unless intended */
  gap: 30px;
}

.rentals-listing {
  flex: 1;
  min-width: 0;
}


.rental-sidebar {
  flex: 0 0 240px;
  background: #f9f9f9;
  padding: 16px;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
  max-height: 92vh;
  overflow-y: auto;
  scrollbar-width: thin;
}
.rental-sidebar::-webkit-scrollbar {
  width: 6px;
}
.rental-sidebar::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

/* === Grid & Cards === */
.rentals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  align-items: start;
}


@media (min-width: 1000px) {
  .rentals-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}


@media (max-width: 900px) {
  .rentals-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

.rental-card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}
.rental-card:hover {
  transform: translateY(-2px);
}
.rental-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  background: #eee;
}

/* === Card Content === */
.card-content {
  padding: 12px 16px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.rental-card h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 12px 0 6px;
}

.rental-meta-inline {
  font-size: 0.9rem;
  color: #444;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: auto;
}
.rental-meta-inline span {
  white-space: nowrap;
}

.featured-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: gold;
  color: black;
  font-weight: bold;
  padding: 5px 10px;
  font-size: 14px;
  border-radius: 4px;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* === Filter Form === */
.rental-filter-form {
  display: block;
}
.rental-filter-form .filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}
.rental-filter-form label {
  font-size: 12px;
  font-weight: 600;
}
.checkbox-group {
  font-size: 12px;
  line-height: 1.6;
}
.checkbox-group label {
  display: block;
  margin-bottom: 4px;
  cursor: pointer;
}
input[type="checkbox"] {
  margin-right: 6px;
  transform: scale(1.05);
}
button[type="submit"],
#reset-filters {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 4px;
  font-weight: 600;
  background: #0073aa;
  color: white;
  border: none;
  cursor: pointer;
  width: 100%;
  margin-top: 8px;
}
button[type="submit"]:hover {
  background: #005f8a;
}

/* === Spinner === */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #0073aa;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}


.rental-single {
  max-width: 1000px;
  margin: 40px auto;
  padding: 20px;
}

.rental-hero {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.rental-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 24px;
  margin-top: 20px;
  font-size: 16px;
  line-height: 1.4;
}
.rental-meta-grid div {
  background: #f8f8f8;
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.rental-meta-grid span {
  display: block;
  font-weight: 600;
  color: #444;
  margin-bottom: 4px;
}

.rental-features {
  margin-top: 24px;
}
.rental-features ul {
  padding-left: 18px;
  margin: 6px 0 0 0;
}
.rental-features li {
  margin-bottom: 4px;
}

.rental-gallery {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 30px;
}

.rental-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  background: #f4f4f4;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: transform 0.2s ease;
}
.rental-gallery img:hover {
  transform: scale(1.03);
}

/* === Overview snippet on rental cards === */
.rental-card .overview {
  font-size: 0.9rem;
  color: #555;
  margin: 0 0 10px;
  line-height: 1.4;
}

.rentals-grid {
  justify-content: start; /* aligns the grid itself left instead of center */
}


.toggle-filters-btn {
  display: none;
  margin-bottom: 10px;
  padding: 10px 14px;
  background: #0073aa;
  color: white;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}


.availability-separator {
  grid-column: 1 / -1;
  text-align: center;
  margin: 20px 0;
  padding: 10px 0;
}

.no-results-message {
  padding: 30px;
  font-size: 1.1em;
  text-align: center;
  color: #444;
}

.card-price-info {
  font-size: 1.1rem;
  color: #222;
  margin-top: 8px;
  /* Ensure visible */
  display: block;
  min-height: 1.5em;
}


@media (max-width: 900px) {
  .rental-sale-layout {
    display: block;
  }

  .rental-sidebar {
    display: block !important;
    width: 100%;
    margin-bottom: 20px;
    background: #f8f9fb;
    padding: 16px;
    border-radius: 10px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
    max-height: none;
    overflow: visible;
    position: relative;
    z-index: 1000;
  }

  .toggle-filters-btn {
    display: none !important;
  }

  .rentals-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .rentals-listing {
    position: relative;
    z-index: 1;
  }
}


body.single-rental_unit .rental-sale-layout {
  display: block !important;
}

body.single-rental_unit .availability-sidebar {
  width: 100% !important;
  max-width: none !important;
  flex: unset !important;
}

.special-offer-badge {
  position: absolute;
  top: 10px;
  right: 10px;   /* ✅ Move to the right */
  background: #ff3838;
  color: #fff;
  font-weight: bold;
  padding: 6px 12px;
  border-radius: 4px;
  z-index: 10;
}
