.listing-hero {
  background: linear-gradient(
    180deg,
    rgba(92, 106, 196, 0.08),
    transparent 80%
  );
  padding: clamp(2rem, 2.5vw, 3rem) 0 0.1rem;
}

.listing-hero__inner {
  display: grid;
  gap: 1.5rem;
}

.listing-hero__header {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: flex-start;
}

.listing-hero__title {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: flex-start;
}

.listing-hero__title h1 {
  margin: 0;
  font-size: clamp(2rem, 2vw + 1.5rem, 2.75rem);
  line-height: 1.2;
}

.listing-hero__price {
  color: var(--color-secondary);
  font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.4rem);
  font-weight: 600;
  white-space: nowrap;
  align-self: flex-start;
}

.listing-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 1.1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 600;
  background: rgba(92, 106, 196, 0.1);
  color: var(--color-secondary);
}

.listing-tag--sale {
  background: rgba(247, 200, 67, 0.2);
  color: #c27a03;
}

.listing-tag--rent {
  background: rgba(92, 106, 196, 0.18);
  color: var(--color-secondary);
}

.listing-tag--reserved {
  background: rgba(220, 38, 38, 0.15);
  color: #991b1b;
}

.listing-layout-section {
  padding: clamp(1.6rem, 2vw, 2.4rem) 0 clamp(2.5rem, 3vw, 3.1rem);
}

.listing-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.8rem, 4vw, 3rem);
}

.listing-layout__wide {
  grid-column: 1 / -1;
}

.listing-layout__content {
  display: grid;
  gap: clamp(2rem, 3vw, 2.8rem);
}

.listing-layout__aside {
  position: static;
  margin-top: 2rem;
}

.listing-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
  align-items: stretch;
}

.listing-gallery__primary,
.listing-gallery__thumb {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  background: linear-gradient(
    135deg,
    rgba(246, 206, 79, 0.35) 0%,
    rgba(24, 34, 58, 0.7) 100%
  );
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.07);
}

.listing-gallery__primary::before,
.listing-gallery__thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(
    --listing-gallery-bg,
    linear-gradient(
      135deg,
      rgba(246, 206, 79, 0.35) 0%,
      rgba(24, 34, 58, 0.7) 100%
    )
  );
  background-size: cover;
  background-position: center;
  filter: blur(28px);
  transform: scale(1.15);
  opacity: 0.9;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.listing-gallery__thumb::before {
  content: none;
}

.listing-gallery__primary:hover::before,
.listing-gallery__thumb:hover::before {
  opacity: 1;
}

.listing-gallery__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background-color: transparent;
  border-radius: inherit;
  position: relative;
  z-index: 1;
}

.listing-gallery__image--portrait {
  object-fit: contain;
  object-position: center;
}

.listing-gallery__primary {
  grid-row: auto;
  aspect-ratio: 4 / 3;
  min-height: 0;
}

.listing-gallery__thumbnails {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  grid-row: auto;
  align-content: stretch;
  overflow: hidden;
}

.listing-gallery__thumb {
  aspect-ratio: 4 / 3;
  min-height: 0;
}

.listing-gallery__zoom,
.listing-gallery__more {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: rgba(26, 26, 26, 0.68);
  color: #ffffff;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  z-index: 4;
}

.listing-gallery__zoom svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
}

.listing-gallery__thumb--more::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}

.listing-gallery__reservation {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 3;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: clamp(1.05rem, 1vw + 0.9rem, 1.35rem);
  font-weight: 400;
  color: #fff;
  background: rgba(185, 28, 28, 0.55);
}

.listing-gallery__primary--reserved .listing-gallery__reservation {
  display: flex;
}

.listing-summary__table {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(26, 26, 26, 0.08);
  border-radius: 20px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.05);
}

.listing-summary__cell {
  flex: 1 1 0;
  min-width: 180px;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
  position: relative;
}

.listing-summary__cell:not(:first-child)::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 1px;
  background: rgba(26, 26, 26, 0.12);
}

.listing-summary__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(92, 106, 196, 0.1);
  flex-shrink: 0;
}

.listing-summary__icon svg {
  width: 32px;
  height: 32px;
  color: var(--color-secondary);
  fill: currentColor;
  stroke: none;
  display: inline-block;
}

.listing-summary__icon-svg {
  color: var(--color-secondary);
  stroke: none;
  fill: currentColor;
}

.listing-summary__icon-svg--land-size {
  transform: scale(1.25);
  transform-origin: center;
}

.listing-summary__content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1 1 auto;
}

.listing-summary__value {
  font-weight: 600;
  font-size: 1.1rem;
}

.listing-summary__label {
  font-size: 0.85rem;
  color: rgba(26, 26, 26, 0.65);
}

.listing-summary__price {
  margin-top: 0.35rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-secondary);
  white-space: nowrap;
  display: none;
}

.listing-section {
  display: grid;
  gap: 1rem;
}

.listing-section__title {
  margin: 0;
  font-size: 1.35rem;
}

.listing-section__body {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(26, 26, 26, 0.82);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.05);
}

.listing-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.9rem;
}

.listing-details__item {
  padding: 1rem 1.1rem;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
  display: grid;
  gap: 0.35rem;
}

.listing-details__label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(26, 26, 26, 0.58);
}

.listing-details__value {
  font-weight: 600;
  color: var(--color-secondary);
}

.listing-map {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  min-height: 280px;
  width: 100%;
  background: #ffffff;
  border: 1px solid rgba(92, 106, 196, 0.15);
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(26, 26, 26, 0.8);
  text-align: center;
  padding: 1.5rem;
}

.listing-map.is-ready {
  display: block;
  padding: 0;
  min-height: 320px;
}

.listing-map__placeholder {
  max-width: 320px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.listing-video {
  display: grid;
  gap: 0.9rem;
}

.listing-video__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(26, 26, 26, 0.7);
}

.listing-video__badge::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #f6ce4f, #5c6ac4);
  display: inline-flex;
}

.listing-video__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 22px;
  overflow: hidden;
  background: #000000;
}

.listing-video__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
}


.listing-agent {
  position: static;
  top: auto;
  display: grid;
  gap: 1.5rem;
  padding: 1.8rem;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.listing-agent__header {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.listing-agent__avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.listing-agent__name {
  font-weight: 600;
  font-size: 1.15rem;
}

.listing-agent__title {
  font-size: 0.85rem;
  color: rgba(26, 26, 26, 0.6);
}

.listing-agent__actions {
  display: grid;
  gap: 0.8rem;
}

.listing-agent__form {
  display: grid;
  gap: 1rem;
}

.listing-agent__alert {
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.listing-agent__alert--success {
  background: rgba(56, 171, 112, 0.12);
  color: #1f7a4f;
}

.listing-agent__alert--error {
  background: rgba(214, 69, 69, 0.12);
  color: #c33434;
}

.listing-agent__field {
  display: grid;
  gap: 0.4rem;
}

.listing-agent__field--captcha {
  align-items: flex-start;
}

.listing-agent__field--error .listing-agent__input,
.listing-agent__field--error .listing-agent__textarea {
  border-color: rgba(214, 69, 69, 0.75);
  background: rgba(214, 69, 69, 0.06);
}

.listing-agent__error {
  font-size: 0.75rem;
  color: #c33434;
}

.listing-agent__field label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(26, 26, 26, 0.55);
}

.listing-agent__input,
.listing-agent__textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(92, 106, 196, 0.18);
  background: rgba(92, 106, 196, 0.06);
  font-size: 0.95rem;
  color: rgba(26, 26, 26, 0.85);
  transition: border 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.listing-agent__input:focus,
.listing-agent__textarea:focus {
  outline: none;
  border-color: rgba(92, 106, 196, 0.45);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(92, 106, 196, 0.15);
}

.listing-agent__field--captcha .listing-agent__error {
  margin-top: 0.25rem;
}

.listing-agent__textarea {
  min-height: 110px;
  resize: vertical;
}

.listing-agent__form-submit {
  align-self: start;
  padding: 0.9rem 1.4rem;
  border-radius: 999px;
  border: none;
  background: var(--color-primary);
  color: #1a1a1a;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.listing-agent__form-submit:hover {
  background: var(--color-primary-dark);
  box-shadow: 0 12px 24px rgba(247, 200, 67, 0.28);
  transform: translateY(-1px);
}

.listing-agent__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-secondary);
  background: rgba(92, 106, 196, 0.08);
  border: 1px solid rgba(92, 106, 196, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.listing-agent__action svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
}

.listing-agent__action:hover {
  transform: translateY(-1px);
  background: rgba(92, 106, 196, 0.16);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.12);
}

.listing-agent__action--primary {
  color: var(--color-secondary);
  background: rgba(92, 106, 196, 0.08);
  border-color: rgba(92, 106, 196, 0.18);
  box-shadow: none;
}

.listing-agent__link {
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-primary);
  text-decoration: underline;
  font-weight: 600;
}

.listing-lightbox[hidden] {
  display: none;
}

.listing-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
}

.listing-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.listing-lightbox__body {
  position: relative;
  z-index: 1;
  width: min(90vw, 960px);
  background: #10121a;
  border-radius: 20px;
  padding: 1.5rem;
  display: grid;
  gap: 1rem;
}

.listing-lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 54px;
  height: 54px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

.listing-lightbox__close::before {
  content: "";
  position: absolute;
  inset: -12px;
}

.listing-lightbox__close svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  fill: none;
}

.listing-lightbox__figure {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 320px;
}

.listing-lightbox__figure img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 14px;
  object-fit: contain;
}

.listing-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.listing-lightbox__nav-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.listing-lightbox__nav-icon--prev {
  transform: scaleX(-1);
}

.listing-lightbox__nav--prev {
  left: 1.2rem;
}

.listing-lightbox__nav--next {
  right: 1.2rem;
}

.listing-lightbox__footer {
  text-align: center;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}

@media (max-width: 600px) {
  .listing-lightbox {
    padding: 0;
  }

  .listing-lightbox__body {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    padding: 1rem 0.75rem 1.25rem;
    gap: 0.75rem;
    grid-template-rows: 1fr auto;
  }

  .listing-lightbox__close {
    top: 0.65rem;
    right: 0.65rem;
    width: 50px;
    height: 50px;
  }

  .listing-lightbox__close::before {
    inset: -14px;
  }

  .listing-lightbox__close svg {
    width: 26px;
    height: 26px;
  }

  .listing-lightbox__figure {
    min-height: 0;
    height: 100%;
  }

  .listing-lightbox__figure img {
    max-height: 100%;
    width: 100%;
  }

  .listing-lightbox__nav {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.24);
  }

  .listing-lightbox__nav--prev {
    left: 0.8rem;
  }

  .listing-lightbox__nav--next {
    right: 0.8rem;
  }

  .listing-lightbox__footer {
    font-size: 0.82rem;
    padding-bottom: 0.25rem;
  }
}

@media (min-width: 1025px) {
  .listing-hero__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2rem;
    align-items: end;
  }

  .listing-hero__price {
    justify-self: flex-end;
    align-self: end;
  }

  .listing-layout {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    gap: clamp(2rem, 4vw, 3rem);
  }

  .listing-layout__aside {
    margin-top: calc(1.35rem + 1rem);
  }

  .listing-agent {
    position: sticky;
    top: 7.5rem;
  }
}

@media (max-width: 1024px) {
  .listing-agent__action {
    width: 100%;
  }
}

@media (min-width: 900px) {
  .listing-gallery {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
  }

  .listing-gallery__primary {
    grid-row: 1 / span 2;
    height: 100%;
  }

  .listing-gallery__thumbnails {
    grid-template-columns: none;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    grid-row: 1 / span 2;
    height: 100%;
  }

  .listing-gallery__thumb {
    height: 100%;
  }

  .listing-gallery__image {
    height: 100%;
  }
}

@media (max-width: 780px) {
  .listing-hero__title h1 {
    font-size: clamp(1.85rem, 2vw + 1.1rem, 2.3rem);
  }

  .listing-layout {
    gap: clamp(1.6rem, 4vw, 2.2rem);
  }
}

@media (max-width: 760px) {
  .listing-gallery {
    gap: 0;
  }

  .listing-gallery__primary {
    aspect-ratio: 4 / 3;
  }

  .listing-gallery__thumbnails {
    display: none;
  }

  .listing-hero {
    padding-bottom: 0.8rem;
  }

  .listing-hero__price {
    display: none;
  }

  .listing-layout-section {
    padding-top: 1.2rem;
  }

  .listing-summary__table {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 0.75rem;
    column-gap: 0;
    overflow: visible;
    border: none;
    background: transparent;
    box-shadow: none;
  }

  .listing-summary__cell {
    min-width: 0;
    padding: 1rem 1.2rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(26, 26, 26, 0.08);
  }

  .listing-summary__cell:nth-child(n + 2) {
    border-radius: 18px;
  }

  .listing-summary__cell:first-child {
    grid-column: 1 / -1;
  }

  .listing-summary__cell:nth-child(2n + 2) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
  }

  .listing-summary__cell:nth-child(2n + 2):last-child {
    border-top-right-radius: 18px;
    border-bottom-right-radius: 18px;
    border-right: 1px solid rgba(26, 26, 26, 0.08);
  }

  .listing-summary__cell:nth-child(2n + 3) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: 1px solid rgba(26, 26, 26, 0.12);
  }

  .listing-summary__cell:not(:first-child)::before {
    display: none;
  }

  .listing-summary__price {
    display: block;
  }

  .listing-summary__cell--primary .listing-summary__content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    column-gap: 0.5rem;
    align-items: center;
    width: 100%;
  }

  .listing-summary__cell--primary .listing-summary__value {
    grid-column: 1;
    grid-row: 1;
  }

  .listing-summary__cell--primary .listing-summary__label {
    grid-column: 1;
    grid-row: 2;
  }

  .listing-summary__cell--primary .listing-summary__price {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin-top: 0;
    margin-left: 0;
    justify-self: end;
    text-align: right;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 3rem;
  }
}

@media (max-width: 720px) {
  .listing-summary__table {
    border-radius: 16px;
  }

  .listing-summary__cell {
    min-width: 160px;
    padding: 1rem 1.2rem;
  }
}

@media (max-width: 520px) {
  .listing-hero {
    padding: 1.6rem 0 0.7rem;
  }

  .listing-hero__title {
    gap: 0.5rem;
  }

  .listing-tag {
    font-size: 0.78rem;
    padding: 0.38rem 0.95rem;
  }

  .listing-layout-section {
    padding: 1.4rem 0;
  }

  .listing-agent {
    padding: 1.2rem;
  }

  .listing-section__body {
    padding: 1.2rem;
  }

  .listing-details {
    grid-template-columns: 1fr;
  }

  .listing-summary__cell {
    min-width: 0;
    padding: 0.95rem 1.05rem;
  }

  .listing-summary__table {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .listing-summary__price {
    font-size: 1.25rem;
  }

  .listing-summary__cell--primary .listing-summary__price {
    margin-left: 0;
  }

  .listing-summary__icon {
    width: 42px;
    height: 42px;
  }

  .listing-summary__icon svg {
    width: 28px;
    height: 28px;
  }

  .listing-map {
    min-height: 240px;
    padding: 1.2rem;
    border-radius: 18px;
  }

  .listing-agent__actions {
    grid-template-columns: 1fr;
  }

  .listing-agent__action {
    justify-content: center;
  }
}
