/* ============================================================
   Propstack Real Estate — Frontend CSS
   Theme-unabhängig, BEM-basiert, responsive
   ============================================================ */

/* Variables */
:root {
  --propstack-primary:     #1a56db;
  --propstack-primary-dark:#1344b8;
  --propstack-text:        #1f2937;
  --propstack-muted:       #6b7280;
  --propstack-border:      #e5e7eb;
  --propstack-bg:          #f9fafb;
  --propstack-white:       #ffffff;
  --propstack-success:     #059669;
  --propstack-error:       #dc2626;
  --propstack-radius:      8px;
  --propstack-shadow:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --propstack-shadow-md:   0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
}

/* ============================================================
   Buttons
   ============================================================ */
.propstack-btn {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  padding: .6em 1.25em;
  border-radius: var(--propstack-radius);
  font-size: .95rem;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background .15s, border-color .15s, color .15s;
}
.propstack-btn--primary {
  background: var(--propstack-primary);
  color: var(--propstack-white);
}
.propstack-btn--primary:hover {
  background: var(--propstack-primary-dark);
  color: var(--propstack-white);
}
.propstack-btn--outline {
  background: transparent;
  border-color: var(--propstack-border);
  color: var(--propstack-text);
}
.propstack-btn--outline:hover {
  border-color: var(--propstack-primary);
  color: var(--propstack-primary);
}

/* ============================================================
   Listing
   ============================================================ */
.propstack-listing { margin: 2rem 0; }

.propstack-listing__grid {
  display: grid;
  grid-template-columns: repeat(var(--propstack-cols, 3), 1fr);
  gap: 1.5rem;
}
.propstack-listing--cols-1 { --propstack-cols: 1; }
.propstack-listing--cols-2 { --propstack-cols: 2; }
.propstack-listing--cols-3 { --propstack-cols: 3; }
.propstack-listing--cols-4 { --propstack-cols: 4; }

.propstack-listing--list .propstack-listing__grid {
  grid-template-columns: 1fr;
}
.propstack-listing--list .propstack-card {
  display: grid;
  grid-template-columns: 300px 1fr;
}
.propstack-listing--list .propstack-card__image { height: 100%; }

.propstack-listing__empty {
  text-align: center;
  padding: 3rem;
  background: var(--propstack-bg);
  border-radius: var(--propstack-radius);
  color: var(--propstack-muted);
}
.propstack-listing__pagination {
  margin-top: 2rem;
  text-align: center;
}

/* ============================================================
   Card
   ============================================================ */
.propstack-card {
  background: var(--propstack-white);
  border-radius: var(--propstack-radius);
  box-shadow: var(--propstack-shadow);
  overflow: hidden;
  transition: box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.propstack-card:hover { box-shadow: var(--propstack-shadow-md); }

.propstack-card__image {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--propstack-bg);
}
.propstack-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}
.propstack-card:hover .propstack-card__image img { transform: scale(1.03); }
.propstack-card__image-link { display: block; }
.propstack-card__image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--propstack-border);
}
.propstack-card__image-placeholder svg { width: 48px; height: 48px; }

.propstack-card__status {
  position: absolute;
  top: .75rem;
  left: .75rem;
  padding: .25em .75em;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.propstack-card__status--vermarktung { background: var(--propstack-success); color: #fff; }
.propstack-card__status--reserviert  { background: #f59e0b; color: #fff; }

.propstack-card__content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: .5rem;
}
.propstack-card__title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
}
.propstack-card__title a {
  color: var(--propstack-text);
  text-decoration: none;
}
.propstack-card__title a:hover { color: var(--propstack-primary); }
.propstack-card__desc {
  font-size: .88rem;
  color: var(--propstack-muted);
  margin: 0;
  line-height: 1.5;
}
.propstack-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .75rem;
  font-size: .83rem;
  color: var(--propstack-muted);
}
.propstack-card__meta-item {
  display: flex;
  align-items: center;
  gap: .3em;
}
.propstack-card__price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--propstack-primary);
  margin-top: auto;
}
.propstack-card__link { align-self: flex-start; margin-top: .5rem; }

/* ============================================================
   Filters
   ============================================================ */
.propstack-filters {
  background: var(--propstack-bg);
  border: 1px solid var(--propstack-border);
  border-radius: var(--propstack-radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.propstack-filters__row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  margin-bottom: .75rem;
}
.propstack-filters__row:last-child { margin-bottom: 0; }
.propstack-filters__group {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  flex: 1 1 160px;
}
.propstack-filters__group--inline { flex: 1 1 130px; }
.propstack-filters__group label {
  font-size: .82rem;
  font-weight: 500;
  color: var(--propstack-muted);
}
.propstack-filters__group select,
.propstack-filters__group input {
  padding: .5em .75em;
  border: 1px solid var(--propstack-border);
  border-radius: calc(var(--propstack-radius) - 2px);
  font-size: .9rem;
  background: var(--propstack-white);
  width: 100%;
}
.propstack-filters__actions {
  display: flex;
  gap: .5rem;
  margin-top: .75rem;
}

/* ============================================================
   Detail — Hero
   ============================================================ */
.propstack-detail { margin: 2rem 0; }

.propstack-detail__hero {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 2rem;
  align-items: start;
}
.propstack-detail__hero-content { padding: 1rem 0; }
.propstack-detail__title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: .5rem 0;
  line-height: 1.2;
}
.propstack-detail__location {
  display: flex;
  align-items: center;
  gap: .4em;
  color: var(--propstack-muted);
  font-size: .95rem;
}
.propstack-detail__hero-price {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--propstack-primary);
  margin: 1rem 0;
}
.propstack-detail__hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.propstack-detail__hero-fact {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--propstack-bg);
  border-radius: var(--propstack-radius);
  padding: .75rem 1.25rem;
  min-width: 90px;
  text-align: center;
}
.propstack-detail__hero-fact-value {
  font-size: 1rem;
  font-weight: 700;
}
.propstack-detail__hero-fact-label {
  font-size: .75rem;
  color: var(--propstack-muted);
  margin-top: .2rem;
}

/* ============================================================
   Detail — Body (Main + Sidebar)
   ============================================================ */
.propstack-detail__body {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 2rem;
  margin-top: 2rem;
  align-items: start;
}
.propstack-detail__section {
  margin-bottom: 2.5rem;
}
.propstack-detail__section h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--propstack-border);
}
.propstack-detail__text { line-height: 1.7; }

/* Eckdaten Grid */
.propstack-facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem;
  margin: 0;
  padding: 0;
}
.propstack-facts-grid__item {
  background: var(--propstack-bg);
  border-radius: var(--propstack-radius);
  padding: .75rem 1rem;
}
.propstack-facts-grid dt {
  font-size: .8rem;
  color: var(--propstack-muted);
  margin-bottom: .2rem;
}
.propstack-facts-grid dd {
  font-weight: 600;
  margin: 0;
  font-size: .95rem;
}

/* Features */
.propstack-features-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .5rem;
}
.propstack-features-list__item {
  display: flex;
  align-items: center;
  gap: .5em;
  font-size: .9rem;
}
.propstack-features-list__item svg { color: var(--propstack-success); flex-shrink: 0; }

/* Energie-Klassen */
.propstack-energy-class {
  display: inline-block;
  padding: .15em .5em;
  border-radius: 4px;
  font-weight: 700;
  font-size: .85em;
  color: #fff;
  margin-left: .4em;
}
.propstack-energy-class--a,.propstack-energy-class--a++ { background: #059669; }
.propstack-energy-class--b { background: #84cc16; color: #000; }
.propstack-energy-class--c { background: #eab308; color: #000; }
.propstack-energy-class--d { background: #f97316; }
.propstack-energy-class--e,.propstack-energy-class--f,.propstack-energy-class--g { background: #dc2626; }

/* ============================================================
   Sidebar
   ============================================================ */
.propstack-detail__sidebar {
  position: sticky;
  top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Broker */
.propstack-broker {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--propstack-bg);
  border-radius: var(--propstack-radius);
  padding: 1.25rem;
}
.propstack-broker__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.propstack-broker__info {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: .9rem;
}
.propstack-broker__name { font-weight: 600; }
.propstack-broker__phone,
.propstack-broker__email {
  color: var(--propstack-primary);
  text-decoration: none;
  font-size: .88rem;
}

/* ============================================================
   Contact Form
   ============================================================ */
.propstack-contact-form {
  background: var(--propstack-white);
  border: 1px solid var(--propstack-border);
  border-radius: var(--propstack-radius);
  padding: 1.5rem;
}
.propstack-contact-form__title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 1.25rem;
}
.propstack-form__row--two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.propstack-form__group {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin-bottom: .75rem;
}
.propstack-form__group label {
  font-size: .85rem;
  font-weight: 500;
}
.propstack-form__group input,
.propstack-form__group textarea,
.propstack-form__group select {
  padding: .55em .8em;
  border: 1px solid var(--propstack-border);
  border-radius: calc(var(--propstack-radius) - 2px);
  font-size: .92rem;
  font-family: inherit;
  width: 100%;
  transition: border-color .15s;
}
.propstack-form__group input:focus,
.propstack-form__group textarea:focus {
  outline: none;
  border-color: var(--propstack-primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}
.propstack-form__group--checkbox {
  flex-direction: row;
  align-items: flex-start;
  gap: .5em;
}
.propstack-form__group--checkbox label {
  display: flex;
  align-items: flex-start;
  gap: .5em;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 400;
  line-height: 1.4;
}
.propstack-form__group--checkbox input[type="checkbox"] {
  width: auto;
  flex-shrink: 0;
  margin-top: .15em;
}
.propstack-form__error {
  font-size: .8rem;
  color: var(--propstack-error);
  min-height: 1.1em;
}
.propstack-form__group.has-error input,
.propstack-form__group.has-error textarea {
  border-color: var(--propstack-error);
}
.propstack-form__actions { margin-top: 1rem; }
.propstack-form__feedback {
  margin-top: .75rem;
  font-size: .9rem;
  border-radius: var(--propstack-radius);
  padding: .6em .9em;
}
.propstack-form__feedback.success { background: #d1fae5; color: #065f46; }
.propstack-form__feedback.error   { background: #fee2e2; color: #991b1b; }

/* ============================================================
   Gallery
   ============================================================ */
.propstack-gallery__main {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: var(--propstack-radius);
  background: #000;
}
.propstack-gallery__main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity .2s;
}
.propstack-gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.5);
  color: #fff;
  border: none;
  padding: .5rem .9rem;
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background .15s;
}
.propstack-gallery__nav:hover { background: rgba(0,0,0,.75); }
.propstack-gallery__nav--prev { left: .75rem; }
.propstack-gallery__nav--next { right: .75rem; }
.propstack-gallery__counter {
  position: absolute;
  bottom: .75rem;
  right: .75rem;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: .8rem;
  padding: .2em .6em;
  border-radius: 999px;
}
.propstack-gallery__thumbs {
  display: flex;
  gap: .5rem;
  margin-top: .75rem;
  overflow-x: auto;
  padding-bottom: .25rem;
}
.propstack-gallery__thumb {
  flex-shrink: 0;
  width: 80px;
  height: 56px;
  border-radius: 4px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  background: none;
}
.propstack-gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.propstack-gallery__thumb--active { border-color: var(--propstack-primary); }

/* ============================================================
   Map placeholder
   ============================================================ */
.propstack-map { margin-top: 1rem; }
.propstack-map__placeholder {
  background: var(--propstack-bg);
  border: 1px dashed var(--propstack-border);
  border-radius: var(--propstack-radius);
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--propstack-muted);
  font-size: .9rem;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .propstack-detail__hero  { grid-template-columns: 1fr; }
  .propstack-detail__body  { grid-template-columns: 1fr; }
  .propstack-detail__sidebar { position: static; }
  .propstack-listing__grid { --propstack-cols: 2; }
  .propstack-listing--cols-4 { --propstack-cols: 2; }
}

@media (max-width: 640px) {
  .propstack-listing__grid { --propstack-cols: 1 !important; }
  .propstack-listing--list .propstack-card { grid-template-columns: 1fr; }
  .propstack-form__row--two { grid-template-columns: 1fr; }
  .propstack-detail__title { font-size: 1.4rem; }
  .propstack-detail__hero-price { font-size: 1.3rem; }
  .propstack-filters__row { flex-direction: column; }
  .propstack-filters__group { flex: 1 1 100%; }
}
