/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

$font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
$color: #0f172a; // Deep Navy (Slate 900)
$color2: #3b82f6; // Vibrant Blue (Blue 500)
$accent: #f97316; // Orange accent
$gray-light: #f3f4f6;
$gray-medium: #9ca3af;
$radius: 12px;
$shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);

:root {
  --immowp-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
  --immowp-color1: #0f172a;
  --immowp-color2: #3b82f6;
  --immowp-accent: #f97316;
  --immowp-radius: 12px;
  --immowp-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.iwp__property {
  padding: 40px 20px;
  font-family: $font;
  color: #334155;
  max-width: 1280px;
  width: 100%;
  margin: auto;
  box-sizing: border-box;

  * {
    box-sizing: border-box;
  }

  // Search Bar Redesign
  .iwp__searchbar {
    background: #fff;
    border-radius: $radius;
    box-shadow: $shadow;
    padding: 20px;
    margin-bottom: 40px;
    border: 1px solid #e2e8f0;

    .iwp__search-top-bar {
      .iwp__search-main {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 12px;
        align-items: flex-end;
      }
    }

    .iwp__filter-group {
      display: flex;
      flex-direction: column;
      gap: 6px;
      min-width: 0;

      label {
        font-size: 13px !important;
        font-weight: 600 !important;
        color: #64748b !important;
        margin: 0 !important;
        line-height: 1.2 !important;
        margin-bottom: 0 !important;
        display: block !important;
      }
    }

    .iwp__input {
      width: 100%;
      height: 48px;
      padding: 0 16px;
      border: 1px solid #cbd5e1;
      border-radius: 8px;
      font-size: 14px;
      color: $color;
      background-color: #fff;
      transition: all 0.2s;

      &:focus {
        border-color: $color2;
        outline: none;
        box-shadow: 0 0 0 3px rgba($color2, 0.1);
      }

      &::placeholder {
        color: #64748b;
        opacity: 1;
      }
    }

    // Slim Select Overrides
    .ss-main {
      min-height: 48px !important;
      height: auto !important;
      max-height: none !important;
      border-radius: 8px !important;
      border-color: #cbd5e1 !important;
      color: $color !important;
      background-color: #fff;
      width: 100%;
      padding: 0;
      overflow: visible !important;

      .ss-values {
        min-height: 48px !important;
        height: auto !important;
        max-height: none !important;
        padding: 4px 12px !important;
        overflow: visible !important;
      }

      .ss-multi-selected {
        border: none !important;
        box-shadow: none !important;
        min-height: 48px !important;
        height: auto !important;
        max-height: none !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        background-color: transparent !important;
        overflow: visible !important;

        .ss-values {
          display: flex !important;
          align-items: center !important;
          flex-wrap: wrap !important;
          gap: 4px !important;
          min-height: 40px !important;
          height: auto !important;
          max-height: none !important;
          padding: 8px 0 !important;
          overflow: visible !important;
          width: 100% !important;

          .ss-value {
            background-color: #f1f5f9;
            color: $color;
            border-radius: 4px;
            margin: 0 !important;
            border: none;
            padding: 4px 8px !important;
            font-size: 13px;
            line-height: 1.4;
            white-space: nowrap;
          }

          .ss-placeholder {
            color: #64748b;
            margin: 0;
          }
        }

        .ss-add {
          margin: 0 12px 0 0 !important;
          flex-shrink: 0;
        }
      }

      &:focus,
      &.ss-focus {
        border-color: $color2 !important;
        box-shadow: 0 0 0 3px rgba($color2, 0.1) !important;
        outline: none;
      }
    }

    .iwp__filter-actions {
      display: flex;
      align-items: flex-end;
      justify-content: flex-end;
      gap: 8px;
      width: auto;
      min-width: fit-content;
      grid-column: auto;
      justify-self: end;

      .iwp__filter-actions-spacer {
        display: flex;
        flex-direction: column;
        gap: 6px;
        width: auto;
      }

      .iwp__action-buttons {
        display: flex;
        gap: 8px;
        justify-content: flex-end;
        flex-wrap: nowrap;
      }
    }

    .iwp__btn-search {
      height: 46px;
      padding: 0 18px;
      background-color: $color2;
      color: #fff;
      border: none;
      border-radius: 10px;
      font-weight: 600;
      font-size: 15px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      transition: background-color 0.2s;
      white-space: nowrap;
      flex-shrink: 0;

      &:hover {
        background-color: #2563eb;
        color: #fff;
      }

      svg {
        stroke: #fff; // Ensure icon is white
        width: 20px;
        height: 20px;
      }

      span {
        font-size: 14px;
        font-weight: 600;
      }
    }

    .iwp__btn-filters-toggle {
      height: 46px;
      width: 46px;
      padding: 0;
      background-color: #f1f5f9;
      color: #475569;
      border: 1px solid #e2e8f0;
      border-radius: 10px;
      font-weight: 600;
      font-size: 0;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s;
      white-space: nowrap; // Prevent text wrap causing overflow
      flex-shrink: 0;

      &:hover,
      &.active {
        background-color: #e2e8f0;
        color: $color;
      }
    }

    .iwp__search-advanced {
      margin-top: 20px;
      padding-top: 20px;
      border-top: 1px solid #f1f5f9;
      animation: slideDown 0.3s ease-out;

      .iwp__advanced-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 20px;
      }

      .iwp__range-inputs {
        display: flex;
        gap: 8px;

        input {
          width: 50%;
        }
      }
    }
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  // Listing Header
  .iwp__listing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;

    .iwp__listing-header-info {
      display: flex;
      align-items: center;
      gap: 16px;
      flex-wrap: wrap;
    }

    .iwp__results-count {
      font-size: 18px;
      font-weight: 700;
      color: $color;
      margin: 0;
      display: flex;
      align-items: center;
      gap: 6px;
      line-height: 1;

      span {
        font-weight: 500;
        color: #64748b;
        font-size: 18px;
      }
    }

    .iwp__btn-alert {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 8px 16px;
      background-color: #f0f9ff; // Light blue background
      border: 1px solid transparent;
      border-radius: 6px;
      color: $color2;
      font-weight: 600;
      font-size: 13px;
      text-decoration: none;
      transition: all 0.2s;

      svg {
        width: 16px;
        height: 16px;
      }

      &:hover {
        background-color: $color2;
        color: #fff;
      }
    }

    .iwp__listing-header-actions {
      .iwp__select-simple select {
        height: 40px;
        padding: 0 32px 0 12px;
        border: 1px solid #e2e8f0;
        border-radius: 8px;
        background-color: #fff;
        color: #475569;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        appearance: none;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3e%3cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3e%3c/path%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 8px center;
        background-size: 16px;
        min-width: 180px;
        transition: border-color 0.2s;

        &:focus,
        &:hover {
          outline: none;
          border-color: $color2;
        }
      }
    }
  }

  @media (max-width: 768px) {
    .iwp__searchbar .iwp__search-top-bar .iwp__search-main {
      grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .iwp__listing-header {
      flex-direction: column;
      align-items: flex-start;

      .iwp__listing-header-info {
        width: 100%;
        justify-content: space-between;
      }

      .iwp__listing-header-actions {
        width: 100%;

        .iwp__select-simple select {
          width: 100%;
        }
      }
    }
  }


  // Email Alert Form
  .iwp__alert-form-container {
    max-width: 800px;
    margin: 0 auto;
  }

  .iwp__alert-message {
    background: #fff;
    border-radius: $radius;
    padding: 20px 24px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: $shadow;

    &--success {
      background: #f0fdf4;
      border-color: #86efac;
      color: #166534;

      svg {
        color: #22c55e;
        flex-shrink: 0;
      }
    }

    p {
      margin: 0;
      font-weight: 600;
      font-size: 15px;
    }
  }

  .iwp__alert-form {
    background: #fff;
    border-radius: $radius;
    box-shadow: $shadow;
    padding: 32px;
    border: 1px solid #e2e8f0;
  }

  .iwp__alert-header {
    display: flex;
    gap: 20px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f1f5f9;

    .iwp__alert-icon {
      flex-shrink: 0;
      width: 56px;
      height: 56px;
      background: linear-gradient(135deg, $color2 0%, #2563eb 100%);
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;

      svg {
        color: #fff;
      }
    }

    .iwp__alert-text {
      flex: 1;

      h2 {
        font-size: 24px;
        font-weight: 700;
        color: $color;
        margin: 0 0 8px 0;
        line-height: 1.3;
      }

      p {
        font-size: 15px;
        color: #64748b;
        margin: 0;
        line-height: 1.6;
      }
    }
  }

  .iwp__alert-form-fields {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  .iwp__alert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
  }

  .iwp__alert-field {
    display: flex;
    flex-direction: column;
    gap: 8px;

    label {
      font-size: 14px;
      font-weight: 600;
      color: #475569;
      margin: 0;
    }

    input {
      width: 100%;
      height: 48px;
      padding: 0 16px;
      border: 1px solid #cbd5e1;
      border-radius: 8px;
      font-size: 15px;
      color: $color;
      background-color: #fff;
      transition: all 0.2s;
      font-family: $font;

      &:focus {
        border-color: $color2;
        outline: none;
        box-shadow: 0 0 0 3px rgba($color2, 0.1);
      }

      &::placeholder {
        color: #94a3b8;
      }
    }
  }

  .iwp__alert-checkboxes-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    padding: 24px 0;
  }

  .iwp__alert-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;

    .iwp__alert-group-label {
      font-size: 15px;
      font-weight: 600;
      color: $color;
      margin: 0;
      padding-bottom: 8px;
      border-bottom: 2px solid #e2e8f0;
    }
  }

  .iwp__alert-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .iwp__alert-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 8px;
    transition: background-color 0.2s;

    &:hover {
      background-color: #f8fafc;
    }

    input[type="checkbox"] {
      position: absolute;
      opacity: 0;
      cursor: pointer;
      height: 0;
      width: 0;

      &:checked~.iwp__checkbox-custom {
        background-color: $color2;
        border-color: $color2;

        &::after {
          display: block;
        }
      }

      &:focus~.iwp__checkbox-custom {
        box-shadow: 0 0 0 3px rgba($color2, 0.1);
      }
    }

    .iwp__checkbox-custom {
      position: relative;
      height: 20px;
      width: 20px;
      background-color: #fff;
      border: 2px solid #cbd5e1;
      border-radius: 4px;
      transition: all 0.2s;
      flex-shrink: 0;

      &::after {
        content: "";
        position: absolute;
        display: none;
        left: 5px;
        top: 2px;
        width: 5px;
        height: 10px;
        border: solid white;
        border-width: 0 2px 2px 0;
        transform: rotate(45deg);
      }
    }

    .iwp__checkbox-label {
      font-size: 14px;
      color: #475569;
      font-weight: 500;
      user-select: none;
    }
  }

  .iwp__alert-submit-container {
    padding-top: 8px;
  }

  .iwp__alert-submit {
    width: 100%;
    height: 54px;
    padding: 0 24px;
    background: linear-gradient(135deg, $color2 0%, #2563eb 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba($color2, 0.3);
    font-family: $font;

    svg {
      stroke: #fff;
      width: 20px;
      height: 20px;
    }

    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 16px rgba($color2, 0.4);
      background: linear-gradient(135deg, #2563eb 0%, $color2 100%);
    }

    &:active {
      transform: translateY(0);
    }
  }

  @media (max-width: 768px) {
    .iwp__alert-form {
      padding: 24px 20px;
    }

    .iwp__alert-header {
      flex-direction: column;
      gap: 16px;

      .iwp__alert-text h2 {
        font-size: 20px;
      }
    }

    .iwp__alert-grid {
      grid-template-columns: 1fr;
    }

    .iwp__alert-checkboxes-container {
      grid-template-columns: 1fr;
      gap: 20px;
    }
  }


  // Listing Grid
  .iwp__items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
  }

  .iwp__items-carousel {
    display: block;
    width: 100%;
    position: relative;

    .swiper_carousel {
      width: 100%;
      overflow: hidden;
    }

    .swiper-wrapper {
      align-items: stretch;
    }

    .swiper-slide {
      height: auto;
      display: flex;
      flex: 0 0 auto;
      width: auto;
    }

    .iwp__item {
      width: 100%;
      height: 100%;
    }

    .swiper-button-prev,
    .swiper-button-next {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      width: 44px;
      height: 44px;
      border-radius: 50%;
      background-color: rgba(15, 23, 42, 0.85);
      color: #fff;
      box-shadow: 0 10px 25px rgba(15, 23, 42, 0.2);
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background-color 0.2s, transform 0.2s;

      &:after {
        font-size: 16px;
        font-weight: bold;
      }

      &:hover {
        background-color: rgba(59, 130, 246, 0.95);
        transform: translateY(-50%) scale(1.05);
      }
    }

    .swiper-button-prev {
      left: -10px;
    }

    .swiper-button-next {
      right: -10px;
    }

    @media (max-width: 768px) {
      .swiper-button-prev {
        left: 10px;
      }

      .swiper-button-next {
        right: 10px;
      }
    }
  }

  // Property Card
  .iwp__item {
    background: #fff;
    border-radius: $radius;
    overflow: hidden;
    box-shadow: $shadow;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e8f0;

    &:hover {
      transform: translateY(-5px);
      box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    }

    a {
      text-decoration: none;
      color: inherit;
      display: flex;
      flex-direction: column;
      height: 100%;
    }

    .iwp__item-header {
      position: relative;
      padding-top: 66.66%; // 3:2 Aspect Ratio
      background-color: $gray-light;
      overflow: hidden;

      .iwp__item-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;

        img {
          width: 100%;
          height: 100%;
          object-fit: cover;
          transition: transform 0.5s ease;
        }
      }

      .iwp__item-price-overlay {
        position: absolute;
        bottom: 12px;
        left: 12px;
        background-color: #0f172a;
        color: #fff;
        padding: 6px 12px;
        border-radius: 6px;
        font-weight: 700;
        font-size: 16px;
        z-index: 2;
        display: flex;
        align-items: center;
        gap: 4px;

        .iwp__postfix {
          font-size: 12px;
          font-weight: 400;
          opacity: 0.8;
        }
      }
    }

    &:hover .iwp__item-image img {
      transform: scale(1.05);
    }

    .iwp__item-meta {
      position: absolute;
      top: 12px;
      left: 12px;
      z-index: 2;

      ul {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        gap: 6px;
        flex-wrap: wrap;
      }

      li {
        padding: 4px 10px;
        border-radius: 6px;
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
        background-color: #fff;
        color: #0f172a;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);

        &.iwp__heart {
          // Specific styles if needed
        }
      }
    }


    .iwp__item-content {
      padding: 20px;
      flex-grow: 1;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .iwp__item-text {
      h3 {
        font-size: 18px;
        font-weight: 700;
        color: $color;
        margin: 0 0 4px 0;
        line-height: 1.3;
      }

      .localisation {
        display: flex;
        align-items: center;
        gap: 6px;
        color: #64748b;
        font-size: 14px;
        
        svg {
          width: 14px;
          height: 14px;
        }
      }
    }

    .iwp__item-overview {
      margin-top: auto;
      padding-top: 16px;
      border-top: 1px solid #f1f5f9;
      display: flex;
      justify-content: space-between;
      align-items: center;

      div {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 13px;
        color: #475569;
        font-weight: 500;

        svg {
          width: 16px;
          height: 16px;
          fill: #94a3b8;
        }
      }
    }
  }
  
  // --- New Single Page Design ---

  .iwp__header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 30px;

    .iwp__header-meta {
      ul {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
      }

      li {
        padding: 6px 14px;
        border-radius: 999px;
        font-size: 13px;
        font-weight: 600;
        text-transform: uppercase;
        border: 1px solid #e2e8f0;
        background-color: #fff;
        color: $color;

        &.iwp__heart {
          background-color: #fee2e2;
          color: #b91c1c;
          border-color: #fecaca;
        }

        &.immowp_type {
          background-color: #e0f2fe;
          color: #0369a1;
          border-color: #bae6fd;
        }

        &.iwp_status {
          background-color: #ecfccb;
          color: #3f6212;
          border-color: #d9f99d;
        }
      }
    }

    .iwp__header-title {
      display: flex;
      flex-direction: column;
      gap: 12px;

      @media (min-width: 768px) {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
      }

      .iwp__header-title__address {
        h1 {
          font-size: 32px;
          margin: 0 0 6px 0;
          color: $color;
          line-height: 1.2;
        }

        span {
          display: inline-flex;
          align-items: center;
          gap: 6px;
          font-size: 15px;
          color: #64748b;

          svg {
            width: 16px;
            height: 16px;
            fill: $color2;
          }
        }
      }

      .iwp__header-title__price {
        font-size: 30px;
        font-weight: 700;
        color: $color2;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 4px;

        .iwp__price,
        .iwp_price {
          font-size: 32px;
          font-weight: 700;
        }

        .iwp__postfix {
          font-size: 15px;
          color: #475569;
          font-weight: 500;
        }
      }
    }
  }

  .iwp__property-container {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    
    @media (max-width: 1024px) {
      flex-direction: column;
    }
  }

  .iwp__main-content {
    flex: 1;
    min-width: 0;
    width: 100%;
  }

  .iwp__property-sidebar {
    width: 360px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    
    @media (max-width: 1024px) {
      width: 100%;
      position: static;
    }
  }
  
  // Gallery Slider
  .iwp__gallery-wrapper {
    margin-bottom: 40px;
    position: relative;
    
    .swiper-button-next,
    .swiper-button-prev {
        color: #fff;
        background: rgba(0,0,0,0.5);
        width: 40px;
        height: 40px;
        border-radius: 50%;
        
        &:after {
            font-size: 16px;
            font-weight: bold;
        }
    }

    .iwp__gallery-badges {
        position: absolute;
        top: 20px;
        left: 20px;
        z-index: 10;
        display: flex;
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
        
        .iwp__badge {
            padding: 6px 12px;
            border-radius: 4px;
            font-size: 12px;
            font-weight: 700;
            text-transform: uppercase;
            color: #fff;
            box-shadow: 0 2px 4px rgba(0,0,0,0.2);
            
            &--status {
                background-color: $accent;
            }
            
            &--exclusive {
                background-color: $color;
            }
            
            &--heart {
                background-color: #ef4444;
            }
        }
    }
  }
  
  .iwp__gallery-slider {
    width: 100%;
    height: 500px;
    border-radius: $radius;
    overflow: hidden;
    margin-bottom: 10px;
    
    @media (max-width: 768px) {
      height: 300px;
    }
    
    .swiper-slide {
      background-color: #f1f5f9;
      position: relative;
      
      img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
      }

      .iwp__slide-counter {
        position: absolute;
        top: 10px;
        right: 10px;
        background: rgba(0,0,0,0.6);
        color: #fff;
        padding: 4px 10px;
        border-radius: 20px;
        font-size: 12px;
        font-weight: 600;
      }
    }
  }
  
  .iwp__gallery-thumbs {
    height: 80px;
    box-sizing: border-box;
    
    .swiper-slide {
      width: 15% !important; // Force smaller width
      height: 100%;
      opacity: 0.4;
      border-radius: 8px;
      overflow: hidden;
      cursor: pointer;
      transition: opacity 0.2s;
      
      &:hover {
        opacity: 0.8;
      }
      
      img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
      }
    }
    
    .swiper-slide-thumb-active {
      opacity: 1;
      border: 2px solid $color2;
    }
  }

  // Price Card with Agent Info
  .iwp__price-card {
    background: #fff;
    border-radius: $radius;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    margin-bottom: 30px;
    
    .iwp__price-card-label {
      font-size: 12px;
      font-weight: 700;
      text-transform: uppercase;
      color: #64748b;
      margin-bottom: 8px;
      letter-spacing: 0.5px;
      text-align: center;
    }
    
    .iwp__price-card-price {
      font-size: 36px;
      font-weight: 800;
      color: $color;
      margin-bottom: 20px;
      text-align: center;
      line-height: 1.2;
      
      .period {
          font-size: 16px;
          color: #94a3b8;
          font-weight: 500;
      }
    }
    
    .iwp__price-separator {
      height: 1px;
      background-color: #e2e8f0;
      margin: 20px 0;
      width: 100%;
    }

    // Agent Section Styles (Migrated from sidebar)
    .iwp__sidebar-agent {
        .iwp__sidebar-agent__header {
            display: flex;
            gap: 16px;
            align-items: center;
            margin-bottom: 20px;
            
            .iwp__sidebar-agent__image {
                width: 64px;
                height: 64px;
                border-radius: 50%;
                overflow: hidden;
                flex-shrink: 0;
                border: 2px solid #f1f5f9;
                
                img {
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                }
            }
            
            .iwp__sidebar-agent__content {
                flex: 1;
                min-width: 0;
                
                h3 {
                    font-size: 16px;
                    font-weight: 700;
                    color: $color;
                    margin: 0 0 4px 0;
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                }
                
                .iwp__contact-line {
                    display: flex;
                    align-items: center;
                    gap: 10px;
                    margin-bottom: 8px;

                    .iwp__contact-icon {
                        width: 28px;
                        height: 28px;
                        border-radius: 999px;
                        background-color: #eef2ff;
                        display: flex;
                        align-items: center;
                        justify-content: center;
                        flex-shrink: 0;

                        svg {
                            width: 16px;
                            height: 16px;
                            stroke: $color2;
                        }
                    }

                    .iwp__contact-text,
                    a {
                        font-size: 13px;
                        color: #475569;
                        line-height: 1.4;
                        text-decoration: none;
                        display: inline-block;
                    }

                    a {
                        font-weight: 600;

                        &:hover {
                            color: $color2;
                        }
                    }
                }
            }
        }
        
        .iwp__sidebar-agent__form {
            hr {
                border: 0;
                border-top: 1px solid #e2e8f0;
                margin: 20px 0;
            }
            
            // Styling for form elements if they are standard inputs
            input[type="text"],
            input[type="email"],
            input[type="tel"],
            textarea {
                width: 100%;
                padding: 12px;
                border: 1px solid #cbd5e1;
                border-radius: 8px;
                margin-bottom: 10px;
                font-family: inherit;
                
                &:focus {
                    outline: none;
                    border-color: $color2;
                    box-shadow: 0 0 0 3px rgba($color2, 0.1);
                }
            }
            
            button, input[type="submit"] {
                width: 100%;
                background-color: $color2;
                color: #fff;
                border: none;
                padding: 14px;
                border-radius: 8px;
                font-weight: 600;
                cursor: pointer;
                transition: background-color 0.2s;
                
                &:hover {
                    background-color: #2563eb;
                }
            }
        }
    }
  }

  // Sidebar Others
  .iwp__sidebar-others {
      h4 {
          font-size: 18px;
          font-weight: 600;
          margin-bottom: 20px;
          color: $color;
      }
      
      .iwp__items {
          grid-template-columns: 1fr; // Stack in sidebar
          gap: 20px;
      }
      
      .iwp__item {
          .iwp__item-header {
              padding-top: 50%; // Slightly shorter images in sidebar
          }
          .iwp__item-content {
              padding: 16px;
          }
      }
  }
}

// Features
.iwp__block-features {
  .iwp__block-features-list {
    list-style-type: none;
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;

    li {
      width: calc(100% / 3);
      margin-bottom: 20px;
      padding: 0 5px;

      @media screen and (max-width: 768px) {
        width: 50%;
      }

      .iwp__block-features-detail {
        display: flex;
        align-items: center;
      }

      svg {
        width: 15px;
        margin-right: 20px;
        fill: $color;
      }

      span {
        line-height: 1;
      }
    }
  }
}

// Video
.iwp__block-visite {
  .iwp__card-body {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

// Energie
.iwp__block-energie {

  .iwp__card-body {
    display: flex;
    justify-content: space-around;
    flex-direction: column;

    h4 {
      display: none;
    }

    @media screen and (max-width: 768px) {
      flex-direction: column;

      img {
        max-width: 240px;
        margin: auto;

        &+img {
          margin-top: 15px;
        }
      }
    }
  }

  // Bold styling for min/max values and dates
  .energy-range {
    font-weight: bold;
  }

  .energy-date {
    font-weight: bold;
  }

  // Diagnostic date line styling
  .diagnostic-date-line {
    padding: 10px 0;
    border-top: 1px solid #eee;
    margin-top: 15px;
    text-align: center;
    font-size: 14px;
    color: #666;

    .date-label {
      font-weight: bold;
      margin-right: 10px;
    }

    .date-value {
      font-weight: bold;
      color: #333;
    }
  }
}

// Property Header
.iwp__property-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid #e2e8f0;

  @media screen and (max-width: 768px) {
    flex-direction: column;
    gap: 20px;
  }

  .iwp__property-main-info {
    flex: 1;

    .iwp_create_alert {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 10px 20px;
      background-color: $color2;
      color: #fff;
      border-radius: 8px;
      text-decoration: none;
      font-weight: 600;
      font-size: 14px;
      transition: background-color 0.2s;
      margin-bottom: 16px;

      &:hover {
        background-color: #2563eb;
      }
    }

    h1 {
      font-size: 32px;
      font-weight: 700;
      color: $color;
      margin: 12px 0;
      line-height: 1.2;
    }

    .iwp__property-badges {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .iwp__badge {
      padding: 6px 12px;
      border-radius: 6px;
      font-size: 13px;
      font-weight: 600;
      text-transform: uppercase;
      color: #fff;

      &--type {
        background-color: $color2;
      }

      &--status {
        background-color: $accent;
      }

      &--exclusive {
        background-color: #0f172a;
      }
    }

    .iwp__property-location {
      display: flex;
      align-items: center;
      gap: 8px;
      color: #64748b;
      font-size: 16px;

      svg {
        color: $color2;
      }
    }
  }

  .iwp__property-price-info {
    text-align: right;

    @media screen and (max-width: 768px) {
      text-align: left;
    }

    .price-value {
      font-size: 32px;
      font-weight: 700;
      color: $color2;

      .period {
        font-size: 16px;
        color: #64748b;
        font-weight: 500;
      }
    }

    .price-fees {
      font-size: 14px;
      color: #64748b;
      margin-top: 4px;
    }
  }
}

// Content Layout
.iwp__content {
  .iwp__row {
    display: flex;
    gap: 40px;

    @media screen and (max-width: 1024px) {
      flex-direction: column;
    }

    .iwp__main {
      flex: 1;
      min-width: 0; // Prevent flex overflow
    }

    .iwp__sidebar {
      width: 360px;
      flex-shrink: 0;

      @media screen and (max-width: 1024px) {
        width: 100%;
      }

      .iwp__sidebar-sticky {
        position: sticky;
        top: 20px;
      }

      .iwp__sidebar-price-card {
        background: #fff;
        border-radius: $radius;
        padding: 24px;
        box-shadow: $shadow;
        border: 1px solid #e2e8f0;
        margin-bottom: 24px;

        h3 {
          font-size: 18px;
          font-weight: 600;
          color: $color;
          margin-top: 0;
          margin-bottom: 16px;
        }

        .btn-contact {
          width: 100%;
          background-color: $color2;
          color: #fff;
          border: none;
          padding: 16px;
          border-radius: 8px;
          font-weight: 600;
          font-size: 16px;
          cursor: pointer;
          transition: background-color 0.2s;
          margin-bottom: 16px;

          &:hover {
            background-color: #2563eb;
          }
        }

        .reference {
          text-align: center;
          font-size: 13px;
          color: #94a3b8;
        }
      }
    }
  }
}

// Blocks / Cards
.iwp__block {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: $radius;
  margin-bottom: 30px;
  overflow: hidden;

  &.iwp__card {
    .iwp__card-header {
      padding: 20px 24px;
      background-color: #fff;
      border-bottom: 1px solid #e2e8f0;

      h2 {
        font-size: 20px;
        font-weight: 600;
        color: $color;
        margin: 0;
      }
    }

    .iwp__card-body {
      padding: 24px;
      color: #475569;
      line-height: 1.6;
    }
  }
}

// Overview List
.iwp__overview-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); // Responsive grid
  gap: 20px;

  li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    
    // Fix for some themes adding before/after content
    &:before, &:after {
        display: none;
    }
  }

  .iwp__overview-item {
    background-color: #f8fafc; // Light slate
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
    
    .iwp__media-icon {
        flex-shrink: 0;
        width: 42px;
        height: 42px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: $color; // Dark color for icon
        
        svg {
            width: 24px;
            height: 24px;
            stroke-width: 1.5px;
            fill: none;
            stroke: currentColor;
        }
    }
    
    .iwp__media-body {
        display: flex;
        flex-direction: column;
        gap: 2px;
        
        .iwp__label {
            font-size: 14px;
            font-weight: 700;
            color: $color;
            line-height: 1.2;
        }
        
        .iwp__value {
            font-size: 14px;
            color: #64748b; // Slate 500
            line-height: 1.2;
        }
    }
  }
}

// Details List
.iwp__details-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px 40px;

  li {
    width: auto !important;
    margin: 0 !important;
    padding: 4px 0;
    border-bottom: 1px solid #f1f5f9;

    &:last-child {
      border-bottom: none;
    }

    .iwp__details-item {
      display: flex;
      justify-content: space-between;

      strong {
        color: #64748b;
        font-weight: 500;
      }

      span {
        color: $color;
        font-weight: 600;
      }
    }
  }
}

// Pagination
.iwp__property-pagination {
  padding-top: 40px;
  display: flex;
  justify-content: center;
  gap: 8px;

  .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: #fff;
    color: $color;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;

    &:hover,
    &.current {
      background-color: $color2;
      color: #fff;
      border-color: $color2;
    }
  }
}
