/* ==========================================================================
   CASSANO LISTINGS — FRONTEND STYLES
   ========================================================================== */

/* ---- Listing cards grid -------------------------------------------------- */
.cassano-listings-grid {
  display: grid;
  grid-template-columns: repeat( auto-fill, minmax(300px, 1fr) );
  gap: 28px;
  margin: 30px 0;
}

/* ---- Card --------------------------------------------------------------- */
.listing-card {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
}
.listing-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,.14);
  transform: translateY(-3px);
}

.listing-card-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: #e8f5f2;
}
.listing-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s;
  display: block;
}
.listing-card:hover .listing-card-image img {
  transform: scale(1.04);
}
.listing-card-no-image {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.listing-card-no-image span {
  color: #05997e;
  font-size: .85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.listing-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #05997e;
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 4px 10px;
  border-radius: 3px;
}
.listing-card-badge.featured {
  background: #e26d2b;
}

.listing-card-body {
  padding: 18px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.listing-card-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: #05997e;
  font-family: 'Playfair Display', Georgia, serif;
  margin-bottom: 6px;
}
.listing-card-address {
  font-size: .97rem;
  font-weight: 600;
  color: #222;
  margin-bottom: 3px;
  line-height: 1.3;
}
.listing-card-city {
  font-size: .84rem;
  color: #777;
  margin-bottom: 12px;
}
.listing-card-meta {
  display: flex;
  gap: 14px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}
.listing-card-meta span {
  font-size: .82rem;
  color: #555;
}
.listing-card-meta span strong {
  color: #111;
  margin-right: 2px;
}

/* ---- Filter notice ------------------------------------------------------- */
.cassano-filter-notice {
  background: #f0faf8;
  border-left: 3px solid #05997e;
  padding: 10px 16px;
  margin-bottom: 20px;
  font-size: .9rem;
  border-radius: 0 4px 4px 0;
}
.cassano-filter-notice a {
  color: #05997e;
  font-weight: 600;
}
.cassano-no-listings {
  color: #666;
  font-style: italic;
  padding: 30px 0;
  text-align: center;
}
.cassano-no-listings a { color: #05997e; }

/* ==========================================================================
   SINGLE LISTING DETAIL PAGE
   ========================================================================== */

.cassano-listing-page {
  background: #fff;
}

/* ---- Page-level header (above gallery) ----------------------------------- */
.listing-page-header {
  background: #fff;
  padding: 28px 0 20px;
  border-bottom: 1px solid #ececec;
}
.listing-page-header .listing-status-badge { margin-bottom: 8px; }
.listing-page-header .listing-detail-address { margin-bottom: 4px; }
.listing-page-header .listing-detail-location { margin-bottom: 8px; }

/* ---- Gallery ------------------------------------------------------------- */
.listing-gallery-wrap {
  background: #111;
  margin-bottom: 0;
}
.listing-gallery-main-wrap {
  position: relative;
  width: 100%;
  max-height: 540px;
  overflow: hidden;
  text-align: center;
}
.listing-gallery-main-wrap a {
  display: block;
  line-height: 0;
}
#listing-main-photo {
  width: 100%;
  max-height: 540px;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}
.listing-thumbstrip-wrap {
  position: relative;
  background: #1a1a1a;
  display: flex;
  align-items: center;
}
.listing-gallery-thumbs {
  display: flex;
  gap: 4px;
  padding: 4px 0;
  flex: 1;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.listing-gallery-thumbs::-webkit-scrollbar { display: none; }
.listing-thumbstrip-arrow {
  flex-shrink: 0;
  width: 40px;
  height: 76px;
  background: rgba(0,0,0,.55);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  z-index: 2;
}
.listing-thumbstrip-arrow:hover { background: #05997e; }
.listing-thumbstrip-arrow.hidden { opacity: 0; pointer-events: none; }
.listing-thumb {
  flex: 0 0 100px;
  height: 68px;
  border: 2px solid transparent;
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  background: none;
  transition: border-color .15s;
}
.listing-thumb:hover,
.listing-thumb.active {
  border-color: #05997e;
}
.listing-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---- 2-column layout ----------------------------------------------------- */
.listing-detail-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  padding-top: 40px;
  padding-bottom: 60px;
  align-items: start;
}

/* ---- Main content -------------------------------------------------------- */
.listing-detail-main {
  min-width: 0;
}

.listing-detail-header {
  margin-bottom: 28px;
}
.listing-status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 3px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
  background: #05997e;
  color: #fff;
}
.listing-status-badge.listing-status-sold   { background: #c0392b; }
.listing-status-badge.listing-status-pending { background: #e26d2b; }
.listing-status-badge.listing-status-active  { background: #05997e; }

.listing-detail-address {
  font-size: 2rem;
  font-family: 'Playfair Display', Georgia, serif;
  color: #111;
  margin: 0 0 6px;
  line-height: 1.2;
}
.listing-detail-location {
  color: #888;
  font-size: 1rem;
  margin: 0 0 12px;
}
.listing-detail-price {
  font-size: 2.1rem;
  font-weight: 700;
  color: #05997e;
  font-family: 'Playfair Display', Georgia, serif;
}

/* ---- Meta bar ------------------------------------------------------------ */
.listing-detail-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: #f8f8f8;
  border: 1px solid #ececec;
  border-radius: 6px;
  margin-bottom: 36px;
  overflow: hidden;
}
.listing-detail-meta-bar .meta-item {
  text-align: center;
  padding: 18px 24px;
  flex: 1;
  border-right: 1px solid #ececec;
}
.listing-detail-meta-bar .meta-item:last-child {
  border-right: none;
}
.listing-detail-meta-bar .meta-item strong {
  display: block;
  font-size: 1.5rem;
  color: #111;
  font-family: 'Playfair Display', Georgia, serif;
}
.listing-detail-meta-bar .meta-item span {
  display: block;
  font-size: .73rem;
  text-transform: uppercase;
  color: #999;
  letter-spacing: .5px;
  margin-top: 3px;
}

/* ---- Sections ------------------------------------------------------------ */
.listing-detail-section {
  margin-bottom: 36px;
  padding-bottom: 36px;
  border-bottom: 1px solid #f0f0f0;
}
.listing-detail-section:last-of-type {
  border-bottom: none;
}
.listing-detail-section h3 {
  font-size: 1.15rem;
  font-family: 'Playfair Display', Georgia, serif;
  color: #111;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #05997e;
  display: inline-block;
}
.listing-detail-section p {
  color: #555;
  line-height: 1.75;
  font-size: .97rem;
}

/* ---- Facts grid ---------------------------------------------------------- */
.listing-detail-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid #ececec;
  border-radius: 6px;
  overflow: hidden;
}
.fact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid #f5f5f5;
  font-size: .9rem;
}
.fact-row:nth-child(odd) {
  background: #fafafa;
}
.fact-label {
  color: #888;
  font-weight: 500;
}
.fact-value {
  color: #111;
  font-weight: 600;
  text-align: right;
}

/* ---- Amenities ----------------------------------------------------------- */
.listing-amenity-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.amenity-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 10px;
  align-items: start;
  padding-bottom: 14px;
  border-bottom: 1px solid #f5f5f5;
}
.amenity-row:last-child { border-bottom: none; padding-bottom: 0; }
.amenity-row dt {
  font-size: .79rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: #888;
  padding-top: 2px;
}
.amenity-row dd { margin: 0; }
.amenity-plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: .88rem;
  color: #444;
  line-height: 1.7;
}
.amenity-two-col .amenity-plain-list {
  columns: 2;
  column-gap: 24px;
}
.amenity-plain-list li::before {
  content: '·';
  color: #05997e;
  font-weight: 700;
  margin-right: 6px;
}

/* ---- School Information -------------------------------------------------- */
.listing-schools-section {
  background: #f0faf8;
  border: 1px solid #c8e8e2;
  border-radius: 8px;
  padding: 24px 28px !important;
  border-bottom: none !important;
  margin-bottom: 36px;
}
.listing-schools-section h3 {
  color: #047a65 !important;
}
.listing-schools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.school-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.school-card-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: #fff;
  border: 1px solid #c8e8e2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #05997e;
}
.school-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.school-card-label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #888;
}
.school-card-name {
  font-size: .95rem;
  font-weight: 600;
  color: #111;
  line-height: 1.3;
}
.school-card-district {
  font-size: .78rem;
  color: #05997e;
  font-weight: 500;
}

/* ---- Room table ---------------------------------------------------------- */
.listing-room-table {
  border: 1px solid #ececec;
  border-radius: 6px;
  overflow: hidden;
}
.room-table-head,
.room-table-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1.4fr 1.4fr;
  align-items: center;
}
.room-table-head {
  background: #f8f8f8;
  border-bottom: 1px solid #ececec;
  padding: 10px 16px;
  gap: 12px;
}
.room-table-head span {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #999;
}
.room-table-row {
  padding: 10px 16px;
  gap: 12px;
  border-bottom: 1px solid #f5f5f5;
  font-size: .88rem;
  color: #555;
}
.room-table-row:last-child { border-bottom: none; }
.room-table-row:nth-child(odd) { background: #fafafa; }
.room-name {
  font-weight: 600;
  color: #111;
}

/* ---- Map ----------------------------------------------------------------- */
.listing-detail-map iframe {
  border-radius: 6px;
  width: 100%;
  display: block;
}

/* ---- Back link ----------------------------------------------------------- */
.listing-back-link { margin-top: 10px; }

/* ---- Sidebar ------------------------------------------------------------- */
.listing-detail-sidebar {
  position: sticky;
  top: 20px;
}

.sidebar-widget {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.sidebar-widget-title {
  font-size: 1rem;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  color: #111;
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid #05997e;
}

/* ---- Search form --------------------------------------------------------- */
.sidebar-search-form { display: flex; flex-direction: column; gap: 12px; }

.sf-field { display: flex; flex-direction: column; gap: 4px; }
.sf-field label {
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: #888;
}
.sf-field input,
.sf-field select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: .9rem;
  color: #333;
  background: #fafafa;
  box-sizing: border-box;
  transition: border-color .15s;
}
.sf-field input:focus,
.sf-field select:focus {
  border-color: #05997e;
  outline: none;
  background: #fff;
}

.sf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.sf-submit {
  width: 100%;
  padding: 12px;
  background: #05997e;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: block;
  transition: background .2s;
  margin-top: 4px;
}
.sf-submit:hover { background: #047a65; color: #fff; }

/* ---- Agent widget -------------------------------------------------------- */
.agent-widget { text-align: center; }
.agent-avatar {
  width: 72px;
  height: 72px;
  background: #e8f5f2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  color: #05997e;
}
.agent-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111;
  font-family: 'Playfair Display', Georgia, serif;
}
.agent-brokerage {
  font-size: .85rem;
  color: #888;
  margin-bottom: 14px;
}
.agent-phone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: .9rem;
  color: #444;
  text-decoration: none;
  margin-bottom: 6px;
}
.agent-phone:hover { color: #05997e; }
.agent-phone svg { flex-shrink: 0; color: #05997e; }
.agent-info { margin-bottom: 16px; }

/* ---- Related listings ---------------------------------------------------- */
.listing-related-section {
  background: #f8f8f8;
  padding: 50px 0 60px;
  border-top: 1px solid #ececec;
}
.related-heading {
  font-size: 1.6rem;
  font-family: 'Playfair Display', Georgia, serif;
  color: #111;
  margin-bottom: 28px;
  text-align: center;
}

/* ---- Buttons (shared) ---------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 4px;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all .2s;
}
.btn-primary { background: #05997e; color: #fff; }
.btn-primary:hover { background: #047a65; color: #fff; }
.btn-outline {
  background: transparent;
  color: #05997e;
  border: 2px solid #05997e;
}
.btn-outline:hover { background: #05997e; color: #fff; }

/* ---- Listings search / filter bar --------------------------------------- */
.cl-search-bar {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px 24px 16px;
  margin-bottom: 28px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.cl-search-form {}
.cl-search-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  margin-bottom: 14px;
}
.cl-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.cl-field label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #888;
  white-space: nowrap;
}
.cl-field input,
.cl-field select {
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: .9rem;
  color: #333;
  background: #fafafa;
  box-sizing: border-box;
  transition: border-color .15s;
  height: 38px;
}
.cl-field input:focus,
.cl-field select:focus {
  border-color: #05997e;
  outline: none;
  background: #fff;
}
.cl-field-city   { flex: 1 1 160px; }
.cl-field-status { flex: 0 1 130px; }
.cl-field-price  { flex: 1 1 220px; }
.cl-field-beds   { flex: 0 1 90px; }
.cl-field-baths  { flex: 0 1 90px; }
.cl-field-type   { flex: 1 1 160px; }

.cl-range-pair {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cl-range-pair input { flex: 1; min-width: 0; }
.cl-range-sep {
  color: #aaa;
  font-size: .85rem;
  flex-shrink: 0;
}

.cl-search-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #f0f0f0;
  padding-top: 14px;
}
.cl-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  background: #05997e;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.cl-search-btn:hover { background: #047a65; }
.cl-clear-btn {
  font-size: .85rem;
  color: #05997e;
  text-decoration: none;
  font-weight: 600;
}
.cl-clear-btn:hover { text-decoration: underline; }
.cl-results-count {
  margin: 0 0 0 auto;
  font-size: .82rem;
  color: #999;
}

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 900px) {
  .listing-detail-layout {
    grid-template-columns: 1fr;
  }
  .listing-detail-sidebar {
    position: static;
    order: -1;
  }
  .listing-detail-address { font-size: 1.5rem; }
  .listing-detail-price { font-size: 1.6rem; }
  .listing-detail-facts { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .listing-gallery-thumbs { gap: 2px; padding: 2px; }
  .listing-thumb { flex: 0 0 80px; height: 55px; }
  #listing-main-photo { max-height: 280px; }
  .listing-detail-meta-bar .meta-item { padding: 12px 14px; }
  .listing-detail-meta-bar .meta-item strong { font-size: 1.2rem; }
  .cassano-listings-grid { grid-template-columns: 1fr; gap: 18px; }
  .sf-row { grid-template-columns: 1fr; }
  .cl-search-bar { padding: 16px; }
  .cl-search-fields { gap: 10px; }
  .cl-field-city, .cl-field-status, .cl-field-price,
  .cl-field-beds, .cl-field-baths, .cl-field-type { flex: 1 1 100%; }
  .cl-results-count { margin: 0; }
}
