@media (max-width: 1024px) {
  .categories-large {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
  }

  .categories-small {
    grid-template-columns: repeat(3, 1fr);
  }

  .listings-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  .admin-listing-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "status category"
      "search apply"
      "languages languages";
  }

  .admin-filter-field--apply {
    justify-self: stretch;
  }

  .admin-filter-field--apply .btn {
    width: 100%;
  }

  .admin-banner-settings {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: var(--space-md);
    padding: var(--space-md);
  }

  .admin-banner-settings__controls {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    justify-content: stretch;
  }

  .admin-banner-settings .btn {
    min-width: 190px;
  }

  .admin-banner-form {
    grid-template-columns: 1fr;
    padding: var(--space-md);
  }

  .admin-banner-live-preview {
    min-height: 150px;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 20px;
  }

  .hero__title {
    font-size: 26px;
  }

  .container {
    padding: 0 var(--space-md);
  }

  .main {
    padding: var(--space-lg) 0;
  }

  .admin-header__subtitle {
    display: none;
  }

  .admin-header__logo-wrap {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    border-radius: 10px;
  }

  .admin-header__logo {
    width: 20px;
    height: 20px;
  }

  .admin-header__action {
    min-height: 36px;
    padding: 0 12px;
  }

  .categories-large {
    grid-template-columns: repeat(2, 1fr);
  }

  .categories-small {
    grid-template-columns: repeat(2, 1fr);
  }

  .listings-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  .filters__row {
    flex-direction: column;
  }

  .filters__group {
    min-width: 100%;
  }

  .filters__price-range .form-input {
    width: 100%;
    flex: 1;
  }

  .form-row {
    flex-direction: column;
  }

  .admin-filters {
    flex-direction: column;
  }

  .admin-filters .form-group {
    min-width: 100%;
  }

  .admin-listing-filters {
    grid-template-columns: 1fr;
    grid-template-areas:
      "status"
      "category"
      "search"
      "languages"
      "apply";
    padding: var(--space-md);
    row-gap: var(--space-md);
  }

  .admin-listing-filters .form-group {
    min-width: 0;
  }

  .admin-filter-field--apply,
  .admin-filter-field--apply .btn {
    width: 100%;
  }

  .admin-edit-grid--two {
    grid-template-columns: 1fr;
  }

  .admin-switch-card {
    min-height: 68px;
  }

  .admin-card__header {
    flex-direction: column;
  }

  .admin-banner-settings__controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .admin-banner-settings__field {
    min-width: 0;
  }

  .admin-banner-settings .btn {
    grid-column: 1 / -1;
    min-width: 0;
    width: 100%;
  }

  .admin-banner-form__grid,
  .admin-banner-card__settings-grid {
    grid-template-columns: 1fr;
  }

  .admin-banner-form__actions {
    justify-content: stretch;
    align-items: stretch;
    flex-direction: column;
  }

  .admin-banner-form__actions .btn {
    width: 100%;
  }

  .admin-banner-live-preview {
    min-height: 110px;
  }

  .admin-banner-card__preview {
    width: 100%;
    flex-basis: 100%;
    order: 2;
  }

  .admin-banner-card__summary {
    order: 1;
    flex: 1 1 calc(100% - 60px);
  }

  .admin-banner-drag-handle {
    order: 0;
    margin-left: 0;
  }

  .admin-banner-card__actions {
    justify-content: stretch;
  }

  .admin-banner-card__actions .btn {
    flex: 1 1 130px;
  }

  .admin-banner-card__actions .admin-banner-order-btn {
    flex: 0 0 38px;
  }

  .admin-table {
    font-size: 13px;
  }

  .admin-table th,
  .admin-table td {
    padding: 10px 12px;
  }

  .modal {
    width: 95%;
    max-height: 85vh;
  }

  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn {
    padding: 12px 16px;
    font-size: 13px;
    white-space: nowrap;
  }

  .listing-detail__title {
    font-size: 22px;
  }

  .listing-detail__price {
    font-size: 20px;
  }

  .contact-btn {
    justify-content: center;
  }

  .cookie-consent {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: none;
    border-right: none;
    border-bottom: none;
    border-left: none;
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
  }

  .cookie-consent.cookie-consent--visible {
    transform: translateY(0);
  }

  .banner-carousel__controls {
    bottom: 7px;
    min-height: 22px;
    padding: 1px 4px;
    gap: 0;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: none;
    pointer-events: none;
  }

  .banner-carousel::after {
    bottom: 2px;
    width: min(140px, calc(100% - 48px));
    height: 24px;
  }

  .banner-carousel__slide::after {
    height: 38%;
  }

  .banner-carousel__dot {
    width: 16px;
    height: 20px;
    cursor: default;
  }
}

@media (max-width: 640px) {
  .about__inner {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .footer__inner {
    flex-direction: column;
    gap: var(--space-lg);
  }

  .hero {
    padding: var(--space-lg) 0;
  }

  .hero--compact {
    padding-top: var(--space-sm);
  }

  .hero__title {
    font-size: 22px;
    margin-bottom: var(--space-lg);
  }

  .admin-banner-settings__controls {
    grid-template-columns: 1fr;
  }

  .admin-banner-settings .btn {
    grid-column: auto;
  }

  .categories-large {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .category-card-lg {
    padding: var(--space-lg);
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
  }

  .category-card-lg::after {
    width: 100%;
    height: 100%;
    bottom: 0;
    right: 0;
    opacity: 0.5;
  }

  .category-card-lg .category-card__icon {
    width: 32px;
    height: 32px;
  }

  .category-card-lg .category-card__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
  }

  .categories-small {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  .category-card {
    padding: var(--space-md) var(--space-sm);
    gap: 6px;
  }

  .category-card__icon {
    width: 24px;
    height: 24px;
  }

  .category-card__name {
    font-size: 12px;
  }

  .banner-carousel__track {
    aspect-ratio: 16 / 9;
  }

  .banner-carousel__button {
    min-width: 104px;
    min-height: 40px;
    padding: 0 18px;
    font-size: 13px;
  }

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

  .header__cta .btn-text {
    display: none;
  }

  .header__cta .btn-text-short {
    display: inline;
  }

  .lang-button {
    padding: 7px 10px;
    font-size: 12px;
  }

  .lang-button__flag {
    width: 18px;
    height: 13px;
  }

  .pagination__btn {
    min-width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .gallery__main {
    aspect-ratio: 4 / 3;
  }

  .listing-detail__title {
    font-size: 20px;
  }

  .filters-popup__sheet,
  .contacts-modal__sheet {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: min(86dvh, 720px);
    border-radius: var(--radius-card) var(--radius-card) 0 0;
    transform: translateY(100%);
  }

  .filters-popup.active .filters-popup__sheet,
  .contacts-modal.active .contacts-modal__sheet {
    transform: translateY(0);
  }

  .filters-popup__header,
  .contacts-modal__header,
  .filters-popup__body,
  .contacts-modal__body,
  .filters-popup__footer {
    padding: var(--space-md);
  }

  .filters-popup__footer {
    flex-direction: column-reverse;
  }

  .filters-popup__footer .btn {
    width: 100%;
  }

  .cookie-consent {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px;
    padding: 20px 18px max(18px, calc(16px + env(safe-area-inset-bottom)));
  }

  .cookie-consent__visual,
  .cookie-consent__image {
    width: 96px;
    height: 96px;
  }

  .cookie-consent__title {
    font-size: 18px;
    margin-bottom: 6px;
  }

  .cookie-consent__text {
    font-size: 14px;
  }

  .cookie-consent__link {
    min-height: 30px;
    margin-top: 4px;
  }

  .cookie-consent__actions {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .cookie-consent__actions .btn {
    width: 100%;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .toast {
    left: var(--space-md);
    right: var(--space-md);
    bottom: var(--space-md);
    max-width: none;
  }

  .login-card {
    padding: var(--space-lg);
  }

  .lightbox__nav {
    display: none;
  }

  .lightbox__stage {
    padding: 70px 16px max(70px, calc(40px + env(safe-area-inset-bottom))) 16px;
  }

  .lightbox__close {
    width: 44px;
    height: 44px;
  }

  .lightbox__close svg {
    width: 24px;
    height: 24px;
  }

  .lightbox__topbar {
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .lightbox__counter {
    font-size: 13px;
  }
}
