/* ============================================
   RESULTS PAGE RESPONSIVE STYLES Flat2rent
   ============================================ */

/* 🔵 Desktop – 1024px to 1439px */
@media (max-width: 1439px) {
  /* Results Header */
  .results-container {
    padding: 0 40px;
  }

  .results-title {
    font-size: 32px;
  }

  .results-subtitle {
    font-size: 18px;
  }

  /* Filter Block */
  .filter-block {
    width: 100%;
    height: auto;
    padding: 35px;
  }

  .filter-label {
    font-size: 18px;
  }

  .filter-bottom-select,
  .multi-select-wrapper {
    width: 140px;
  }

  .multi-select-display {
    width: 140px;
    height: 50px;
    font-size: 15px;
  }

  .filter-bottom-select {
    height: 50px;
    font-size: 15px;
  }

  .filter-input {
    font-size: 15px;
  }

  .filter-bottom-label {
    font-size: 18px;
  }

  /* Filter Bottom Row */
  .filter-bottom-row {
    gap: 10px;
  }

  /* Flats */
  .flat-card {
    width: 300px;
    height: 330px;
  }

  .flat-thumb {
    height: 210px;
  }

  /* Doubts Section */
  .doubts-container {
    width: 100%;
    max-width: 1000px;
    height: 250px;
    padding: 0 50px;
  }

  .doubts-title {
    font-size: 32px;
  }

  .doubts-item {
    font-size: 18px;
  }
}

/* 🟡 Tablet – 768px to 1023px */
@media (max-width: 1023px) {
  /* Results Header */
  .results-header {
    padding-top: 60px;
  }

  .results-container {
    padding: 0 20px;
  }

  .results-header-content {
    flex-direction: column;
    gap: 10px;
  }

  .results-title {
    font-size: 28px;
  }

  .results-subtitle {
    font-size: 16px;
  }

  /* Filter Section */
  .filter-section {
    padding-top: 40px;
  }

  .filter-block {
    max-width: 800px;
    height: auto;
    padding: 30px;
    gap: 10px;
  }

  /* Filter Top Row - 2 columns for Flat2Rent (no Salida) */
  .filter-top-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }

  .filter-col {
    width: 100%;
    padding: 0;
  }

  .filter-col:nth-child(1) {
    /* Entrada - first column */
    grid-column: span 1;
  }

  .filter-col:nth-child(2) {
    /* Zona - second column */
    grid-column: span 1;
  }

  .filter-col::after {
    display: none;
  }

  .filter-label {
    font-size: 16px;
  }

  .filter-button-col {
    grid-column: 1 / -1;
    padding: 0;
    margin-top: 10px;
    display: flex;
    justify-content: center;
  }

  .search-button {
    width: 220px;
    font-size: 17px;
  }

  /* Hide desktop button, show mobile button */
  .filter-button-desktop {
    display: none;
  }

  .filter-button-mobile {
    display: flex;
    justify-content: center;
    padding-top: 15px;
  }

  /* Filter Bottom Row */
  .filter-bottom-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding-top: 20px;
  }

  .filter-bottom-col:nth-child(1) {
    /* FILTRAR - first row, span both columns */
    grid-column: 1 / -1;
  }

  .filter-bottom-col:nth-child(2),
  .filter-bottom-col:nth-child(3) {
    /* Habitaciones and Baños - second row */
    grid-column: span 1;
  }

  .filter-bottom-col:nth-child(4) {
    /* Precio máximo - third row, centered */
    grid-column: 1 / -1;
    margin: 0 auto;
  }

  .filter-title {
    height: auto;
    font-size: 18px;
  }

  .filter-bottom-field {
    gap: 10px;
  }

  .filter-bottom-label {
    font-size: 16px;
  }

  .filter-bottom-select,
  .multi-select-wrapper {
    width: 140px;
  }

  .multi-select-display {
    width: 140px;
    height: 50px;
    font-size: 15px;
  }

  .filter-bottom-select {
    height: 50px;
    font-size: 15px;
  }

  /* Flats */
  .flats-section {
    padding: 30px 20px 50px;
  }

  .flats-list {
    flex-wrap: wrap;
    gap: 30px;
    max-width: 650px;
  }

  .flat-card {
    width: 300px;
    height: 330px;
  }

  /* Map */
  .map-container {
    height: 300px;
  }

  /* Doubts */
  .doubts-container {
    max-width: 650px;
    height: auto;
    flex-direction: column;
    padding: 40px 30px;
    gap: 30px;
  }

  .doubts-content {
    padding-right: 0;
    text-align: center;
  }

  .doubts-title {
    font-size: 28px;
  }

  .doubts-item {
    font-size: 16px;
    text-align: left;
  }

  .doubts-actions {
    flex-direction: row;
    gap: 15px;
  }
}

/* 🟠 Large Phones – 480px to 767px */
@media (max-width: 767px) {
  /* Main Content */
  .main-content {
    margin-top: 60px;
  }

  /* Results Header */
  .results-header {
    padding-top: 40px;
  }

  .results-container {
    padding: 0 15px;
  }

  .results-title {
    font-size: 24px;
  }

  .results-subtitle {
    font-size: 16px;
  }

  /* Filter Section */
  .filter-section {
    padding-top: 30px;
    padding-left: 15px;
    padding-right: 15px;
  }

  .filter-block {
    max-width: 100%;
    padding: 25px 20px;
    gap: 18px;
  }

  .filter-label {
    font-size: 15px;
  }

  .filter-input {
    padding: 8px 0px 8px 0px;
    font-size: 16px;
    transform: scale(0.875);
    transform-origin: left center;
  }

  .search-button {
    height: 45px;
    font-size: 17px;
  }

  /* Filter Bottom Row */
  .filter-bottom-row {
    gap: 15px;
    padding-top: 15px;
  }

  .filter-title {
    font-size: 18px;
  }

  .filter-bottom-label {
    font-size: 15px;
  }

  .filter-bottom-select,
  .multi-select-wrapper {
    width: 95px;
  }

  .multi-select-display {
    width: 120px;
    height: 45px;
    font-size: 14px;
    padding: 0 25px 0 12px;
  }

  .multi-select-arrow {
    right: 6px;
    width: 12px;
    height: 12px;
  }

  .filter-bottom-select {
    height: 45px;
    font-size: 14px;
  }

  .multi-select-option {
    padding: 10px 12px;
    font-size: 14px;
  }

  .checkmark {
    width: 14px;
    height: 14px;
    margin-right: 10px;
  }

  /* Calendar Popup Adjustments */
  .calendar-popup-entrada {
    left: 80%;
    right: auto;
    transform: translateX(-50%);
    max-width: 85vw;
    padding: 10px;
  }

  .calendar-grid {
    gap: 3px;
  }

  .calendar-day-header,
  .calendar-day {
    min-width: 28px;
    min-height: 28px;
    font-size: 11px;
    padding: 4px 2px;
  }

  .calendar-month-year {
    font-size: 13px;
  }

  .calendar-nav {
    font-size: 14px;
    padding: 3px;
  }

  /* Flats */
  .flats-section {
    padding: 25px 15px 40px;
  }

  .flats-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 100%;
    width: 100%;
  }

  .flat-card {
    width: 100%;
    max-width: 100%;
    height: 320px;
  }

  .flat-thumb {
    height: 200px;
    /* Smooth horizontal scroll gallery */
    overflow-x: scroll;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
    display: flex;
    scroll-behavior: smooth;
  }

  /* Hide scrollbar for Chrome/Safari */
  .flat-thumb::-webkit-scrollbar {
    display: none;
  }

  /* Flat thumb images for smooth scrolling */
  .flat-thumb-image {
    min-width: 100%;
    width: 100%;
    height: 100%;
    flex-shrink: 0;
    scroll-snap-align: start;
    object-fit: cover;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
  }

  .flat-thumb:active {
    cursor: grabbing;
  }

  /* Hide navigation arrows on mobile */
  .flat-thumb-nav {
    display: none !important;
  }

  .flat-info {
    height: 120px;
    padding: 15px;
    gap: 8px;
  }

  .flat-line {
    font-size: 14px;
  }

  .flat-zone strong {
    font-size: 14px;
  }

  .price-value {
    font-size: 24px;
  }

  .price-unit {
    font-size: 14px;
  }

  .flat-owner {
    font-size: 14px;
  }

  /* Map */
  .map-section {
    padding: 30px 15px;
  }

  .map-container {
    height: 250px;
  }

  /* Doubts */
  .doubts-section {
    padding: 30px 15px 50px;
  }

  .doubts-container {
    max-width: 100%;
    padding: 35px 25px;
    gap: 25px;
  }

  .doubts-title {
    font-size: 24px;
  }

  .doubts-item {
    font-size: 15px;
  }

  .doubts-actions {
    flex-direction: column;
    width: 100%;
  }
}

/* 🔴 Small Phones – up to 479px */
@media (max-width: 479px) {
  /* Results Header */
  .results-header {
    padding-top: 30px;
  }

  .results-container {
    padding: 0 12px;
  }

  .results-title {
    font-size: 22px;
  }

  .results-subtitle {
    font-size: 15px;
  }

  /* Filter Section */
  .filter-section {
    padding-top: 25px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .filter-block {
    padding: 20px 15px;
    gap: 15px;
  }

  .filter-label {
    font-size: 14px;
    margin-bottom: 6px;
  }

  .filter-input {
    font-size: 16px;
    transform: scale(0.8125);
    transform-origin: left center;
  }
  .date-input {
    padding-right: 0px;
  }
  .search-button {
    width: 130px;
    height: 35px;
    font-size: 13px;
  }

  /* Filter Bottom Row */
  .filter-bottom-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding-top: 12px;
    justify-items: center;
  }

  .filter-bottom-col:nth-child(1) {
    /* FILTRAR - first row, span both columns */
    grid-column: 1 / -1;
    justify-self: center;
  }

  .filter-bottom-col:nth-child(2) {
    /* Habitaciones - second row, span both columns */
    grid-column: 1 / -1;
    justify-self: center;
  }

  .filter-bottom-col:nth-child(3) {
    /* Baños - third row, left column */
    grid-column: span 1;
    justify-self: end;
  }

  .filter-bottom-col:nth-child(4) {
    /* Precio máximo - third row, right column */
    grid-column: span 1;
    justify-self: start;
  }

  .filter-title {
    font-size: 16px;
  }

  .filter-bottom-label {
    font-size: 13px;
  }

  .filter-bottom-select,
  .multi-select-wrapper {
    width: 90px;
  }

  .multi-select-display {
    width: 90px;
    height: 40px;
    font-size: 13px;
    padding: 0 22px 0 10px;
  }

  .multi-select-arrow {
    right: 5px;
    width: 11px;
    height: 11px;
  }

  .filter-bottom-select {
    height: 40px;
    font-size: 13px;
  }

  .multi-select-option {
    padding: 8px 10px;
    font-size: 13px;
  }

  .checkmark {
    width: 12px;
    height: 12px;
    margin-right: 8px;
  }

  .multi-select-option input[type="checkbox"]:checked + .checkmark::after {
    font-size: 10px;
  }

  /* Calendar Popup Adjustments */
  .calendar-popup-entrada {
    left: 95%;
    right: auto;
    transform: translateX(-50%);
    width: 235px;
    min-width: 235px;
    max-width: 90vw;
    padding: 8px;
  }

  .calendar-grid {
    gap: 2px;
  }

  .calendar-day-header,
  .calendar-day {
    min-width: 26px;
    min-height: 26px;
    font-size: 10px;
    padding: 3px 2px;
  }

  .calendar-month-year {
    font-size: 12px;
  }

  .calendar-nav {
    font-size: 14px;
    padding: 2px;
  }

  /* Flats */
  .flats-section {
    padding: 20px 12px 35px;
  }

  .flats-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 100%;
    width: 100%;
  }

  .flat-card {
    width: 100%;
    max-width: 100%;
    height: 292px;
  }

  .flat-thumb {
    height: 180px;
  }

  .flat-info {
    height: 112px;
    padding: 12px 15px;
    gap: 7px;
  }

  .flat-line {
    font-size: 13px;
  }

  .flat-zone strong {
    font-size: 13px;
  }

  .price-value {
    font-size: 22px;
  }

  .price-unit {
    font-size: 13px;
  }

  .flat-owner {
    font-size: 13px;
  }

  /* Map */
  .map-section {
    padding: 25px 12px;
  }

  .map-container {
    height: 220px;
  }

  /* Doubts */
  .doubts-section {
    padding: 25px 12px 40px;
  }

  .doubts-container {
    padding: 30px 20px;
    border-radius: 30px;
    gap: 20px;
  }

  .doubts-title {
    font-size: 22px;
    margin-bottom: 15px;
  }

  .doubts-item {
    font-size: 14px;
    margin-bottom: 12px;
  }

  .whatsapp-button,
  .contact-button {
    max-width: 100%;
    height: 45px;
    font-size: 16px;
  }
}

/* 🔴 Extra Small Phones – up to 420px */
@media (max-width: 420px) {
  /* Filter Bottom Row - Each column in its own row */
  .filter-bottom-row {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-top: 0px;
    align-items: center;
  }

  .filter-bottom-col {
    width: 100%;
    justify-self: center;
  }

  .filter-bottom-col:nth-child(n) {
    grid-column: auto;
  }

  .filter-bottom-field {
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 235px;
    margin: 0 auto;
  }

  .filter-bottom-label {
    text-align: left;
    flex-shrink: 0;
  }

  .filter-bottom-select,
  .multi-select-wrapper {
    flex-shrink: 0;
  }
}
