/* ============================================
   RESULTS PAGE RESPONSIVE STYLES Romm2rent
   ============================================ */

/* 🔵 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 {
    width: 140px;
    height: 50px;
    font-size: 15px;
  }

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

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

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

  /* Etiquettes */
  .results-etiquettes-title {
    width: 100%;
    max-width: 1000px;
    font-size: 18px;
  }

  .results-etiquettes-grid {
    grid-template-columns: repeat(6, 140px);
    gap: 15px 12px;
    max-width: 1000px;
  }

  .etiquette-item {
    width: 140px;
    height: 32px;
  }

  .etiquette-text {
    font-size: 14px;
  }

  /* Rooms */
  .room-card {
    width: 300px;
    height: 330px;
  }

  .room-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 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto auto auto;
    gap: 30px;
  }

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

  .filter-col:nth-child(1),
  .filter-col:nth-child(2) {
    grid-column: span 1;
  }

  .filter-col:nth-child(1)::after {
    content: "";
    position: absolute;
    right: -15px;
    top: 20%;
    bottom: 20%;
    width: 1px;
    background-color: rgba(0, 0, 0, 0.32);
    display: block;
    height: 50px;
  }

  .filter-col:nth-child(3) {
    grid-column: 1 / -1;
    max-width: calc(50% - 10px);
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding-top: 10px;
  }

  .filter-col:nth-child(3) .filter-label {
    margin-bottom: 0;
    white-space: nowrap;
  }

  .filter-col:nth-child(3) .select-input {
    flex: 1;
  }

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

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

  .filter-button-col {
    grid-column: 1 / -1;
    padding: 0;

    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);
    grid-template-rows: auto auto auto;
    gap: 20px;
    padding-top: 0;
  }

  .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) {
    /* Tipo de habitación and Baño privado - 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 {
    width: 140px;
    height: 50px;
    font-size: 15px;
  }

  /* Etiquettes */
  .results-etiquettes-section {
    padding: 30px 20px;
  }

  .results-etiquettes-title {
    max-width: 100%;
    font-size: 18px;
    margin-bottom: 25px;
  }

  .results_pisos_label {
    font-weight: var(--font-medium);
  }

  .results-etiquettes-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    max-width: 650px;
    margin: 0 auto;
  }

  .etiquette-item {
    width: 100%;
    height: 35px;
  }

  .results-etiquettes-grid .etiquette-item:nth-child(n) {
    grid-column: auto;
  }

  /* Rooms */
  .rooms-section {
    padding: 30px 20px 50px;
  }

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

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

  .room-thumb {
    /* 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 */
  .room-thumb::-webkit-scrollbar {
    display: none;
  }

  /* Room thumb images for smooth scrolling */
  .room-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;
  }

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

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

  /* 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 {
    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 {
    font-size: 16px;
    transform: scale(0.875);
    transform-origin: left center;
  }

  .filter-col:nth-child(3) {
    /* Zona - second row, centered */
    max-width: calc(70% - 10px);
  }

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

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

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

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

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

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

  .calendar-popup-salida {
    left: 35%;
    right: auto;
    transform: translateX(-50%);
    width: 260px;
    min-width: 260px;
    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;
  }

  /* Etiquettes */
  .results-etiquettes-section {
    padding: 25px 0;
  }

  .results-etiquettes-title {
    font-size: 16px;
    margin-bottom: 20px;
    padding: 0 15px;
  }

  .results-etiquettes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto;
    grid-auto-flow: row;
    gap: 12px;
    max-width: 100%;
    padding: 0 15px;
  }

  .etiquette-item {
    width: 100%;
    height: 38px;
  }

  .results-etiquettes-grid .etiquette-item:nth-child(n) {
    grid-column: auto;
    grid-row: auto;
  }

  .etiquette-text {
    font-size: 15px;
  }

  /* Rooms */
  .rooms-section {
    padding: 25px 15px 40px;
  }

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

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

  .room-thumb {
    height: 200px;
  }

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

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

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

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

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

  .room-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;
  }

  /* Mobile button styling */
  .filter-button-mobile {
    padding-top: 12px;
  }

  /* Filter Bottom Row */
  .filter-bottom-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto auto auto;
    gap: 10px;
    padding-top: 0px;
    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) {
    /* Tipo de habitación - second row, span both columns */
    grid-column: 1 / -1;
    justify-self: center;
  }

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

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

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

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

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

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

  .calendar-popup-salida {
    left: 5%;
    right: auto;
    transform: translateX(-50%);
    width: 210px;
    min-width: 200px;
    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;
  }

  /* Etiquettes */
  .results-etiquettes-section {
    padding: 20px 0;
  }

  .results-etiquettes-title {
    font-size: 15px;
    margin-bottom: 18px;
    padding: 0 12px;
  }

  .results-etiquettes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: auto;
    grid-auto-flow: row;
    gap: 10px;
    max-width: 100%;
    padding: 0 12px;
  }

  .etiquette-item {
    width: 100%;
    height: 35px;
    padding: 0 10px;
  }

  .results-etiquettes-grid .etiquette-item:nth-child(n) {
    grid-column: auto;
    grid-row: auto;
  }

  .etiquette-icon {
    width: 20px;
    height: 20px;
  }

  .etiquette-text {
    font-size: 14px;
  }

  /* Rooms */
  .rooms-section {
    padding: 20px 12px 35px;
  }

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

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

  .room-thumb {
    height: 170px;
  }

  .room-info {
    height: 110px;
    padding: 12px 14px;
    gap: 6px;
  }

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

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

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

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

  .room-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 {
    flex-shrink: 0;
  }
}

@media (max-width: 375px) {
  .filter-col:nth-child(3) {
    max-width: calc(75% - 10px);
  }
}

@media (max-width: 350px) {
  .filter-col:nth-child(3) {
    max-width: calc(85% - 10px);
  }
}