/* Listings */
.listings {
  padding: 20px 80px;
  position: relative;

  .card-view {
    gap: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 400px));
    justify-content: center;
  }

  .map-view { display: none; height: 600px; padding: 20px; background: #f0f0f0; }

  &.map-active { .map-view { display: block; } .card-view { display: none; } }

  article {
    cursor: pointer;

    .carousel {
      overflow: hidden;
      position: relative;
      border-radius: 12px;
      background: #f7f7f7;
      margin-bottom: 10px;

      .carousel-images {
        width: 100%;
        height: 200px;
        position: relative;

        .carousel-image {
          inset: 0;
          opacity: 0;
          width: 100%;
          height: 100%;
          position: absolute;
          transition: opacity 0.3s ease-in-out;

          &.active { opacity: 1; }

          img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 12px;
          }
        }
      }

      .carousel-arrow {
        top: 50%;
        opacity: 0;
        width: 30px;
        height: 30px;
        color: white;
        position: absolute;
        border-radius: 50%;
        transform: translateY(-50%);
        background: rgba(0, 0, 0, 0.5);
        transition: opacity 0.3s ease-in-out;

        &.prev { left: 10px; }
        &.next { right: 10px; }
      }

      &:hover .carousel-arrow { opacity: 1; }
    }

    section {
      h3 { font-size: 16px; margin-bottom: 5px; }

      p {
        margin-bottom: 5px;
        color: var(--text-gray);

        &:last-child { font-weight: bold; }
      }
    }
  }

  @media (max-width: 768px) {
    padding: 0 16px 16px;

    .card-view {
      grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
      gap: 16px;
    }

    article {
      .carousel {
        margin-bottom: 8px;

        .carousel-images { height: 180px; }
      }
    }

    .map-view { height: 400px; padding: 16px; }
  }
}
