/* AdoPet Responsive Styles
 * ------------------------
 * All responsive behaviour for forms, cards and wizards.
 *
 * IMPORTANT: Only media queries live here – no base rules.
 */

/* Public listings grid */
@media screen and (max-width: 1024px) {
    .adopet-pet-listings {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .adopet-pet-listings {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .adopet-sponsor-section,
    .adopet-rehoming-section {
        padding: 20px;
    }
}

/* Global input width for small screens */
@media (max-width: 768px) {
  input[type=date],
  input[type=email],
  input[type=number],
  input[type=password],
  input[type=search],
  input[type=tel],
  input[type=text],
  input[type=url],
  select,
  textarea {
    width: 80vw;
  }
}

/* Search form layout */
@media (max-width: 768px) {
    .adopet-search-form {
        padding: 15px;
    }

    .search-form {
        gap: 15px;
    }

    .location-section {
        grid-template-columns: 1fr;
    }

    .species-buttons {
        flex-direction: column;
    }

    .form-actions {
        flex-direction: column;
    }

    .search-button,
    .reset-button {
        width: 100%;
    }

    .LocationForm-with-Icons,
    .breed-selection {
        width: 100vw;
    }

    .selectdiv select {
        width: 100%;
    }
}

/* Location input & dropdowns – small screens */
@media (max-width: 768px) {
  .LocationForm-with-Icons .LocationForm-textinput {
    width: 90vw;
  }

  .dropdown-new {
    width: calc(100vw - 10vw);
    max-width: calc(100vw - 10vw);
  }
}

@media (max-width: 768px) {
    .dropdown {
        width: 90% !important;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .breed-selection,
    #breedSelect,
    .selectdiv,
    .selectdiv select,
    .dropdown {
        width: 90% !important;
        margin: 0 auto;
    }

    .selectdiv:after {
        right: 4vw;
    }

    .selectdiv:before {
        right: 12vw;
    }
}

@media (max-width: 768px) {
    .LocationForm-with-Icons {
        width: 100%;
        max-width: none;
    }

    .dropdown-new {
        width: 90vw;
        max-width: 100%;
    }
}

/* Show Pets button & species pills on mobile */
@media screen and (max-width: 768px) {
    .show-pets-btn {
        width: 75vw;
        font-size: 0.9375rem;
        padding: 1rem;
        min-height: 3.25rem;
        margin: 1rem auto;
        position: relative;
        left: 50%;
        transform: translateX(-50%);
    }

    .species-selection {
        width: 100%;
        justify-content: center;
    }

    .distance-slider {
        max-width: none;
    }
}

/* Card grids on small screens */
@media (max-width: 768px) {
    .pet-grid {
        grid-template-columns: 1fr;
    }

    .pet-attributes {
        justify-content: center;
        text-align: center;
    }
}

/* Wizard layout breakpoints */
@media (max-width: 768px) {
    .hero-wizard {
        --wizard-pad: 32px;
    }

    .hero-wizard .wizard-step {
        padding: var(--wizard-pad) 16px;
        min-height: 300px;
    }

    .hero-wizard .wizard-step h3 {
        font-size: 1.5rem;
        margin-bottom: 16px;
    }

    .hero-wizard .wizard-step p {
        font-size: 1rem;
        margin-bottom: 20px;
    }
}

@media (max-width: 640px) {
    .adopet-wizard-page {
        padding: 20px 12px;
        align-items: stretch;
    }

    .adopet-wizard-card {
        box-shadow: none;
        border-radius: 0;
        padding: 20px 0 10px;
    }

    .hero-wizard--register .wizard-grid {
        flex-direction: column;
    }

    .hero-wizard--register .wizard-grid .wizard-floating-group {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .wizard-photo-drop,
    .wizard-input,
    .wizard-textarea {
        max-width: 100%;
    }

    .wizard-status-grid {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .hero-wizard--register .wizard-grid {
        flex-direction: column;
    }
}

/* Lost/Found wizard map canvas */
@media (max-width: 768px) {
  .hero-wizard .wizard-results-map .map-canvas {
    height: 320px;
  }
}

/* Mobile filter drawer for wizard map */
@media (max-width: 768px) {
  .hero-wizard .filter-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    z-index: 1000;
    transition: left .3s ease;
    overflow-y: auto;
  }

  .hero-wizard .filter-sidebar.active {
    left: 0;
  }

  .hero-wizard .mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 900;
    display: none;
  }

  .hero-wizard .mobile-overlay.active {
    display: block;
  }

  .hero-wizard .mobile-filter-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 800;
    display: block;
  }
}

@media (min-width: 768px) {
  .hero-wizard .wizard-map-layout {
    flex-direction: row;
  }

  .hero-wizard .filter-sidebar {
    width: 320px;
    min-width: 320px;
    height: calc(100vh - 160px);
    overflow-y: auto;
  }

  .desktop-list-map-toggle {
    display: flex;
  }

  .mobile-filter-bar {
    display: none !important;
  }
}
