/* Общи стилове – оставено за бъдещи допълнения */

/* Pagination */
.pagination {
  margin-top: 0.9rem;
  display: flex;
  justify-content: center;
}

.pagination__list {
  margin: 0;
  padding: 0.35rem 0.5rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: center;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.pagination__link {
  min-width: 2.2rem;
  height: 2.2rem;
  padding: 0 0.65rem;
  border-radius: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #0f172a;
  border: 1px solid transparent;
  background: #f8fafc;
  font-weight: 600;
  font-size: 0.9rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.pagination__link:hover {
  background: #fff;
  border-color: #e5e7eb;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
  transform: translateY(-1px);
}

.pagination__link--nav {
  min-width: auto;
  padding: 0 1rem;
  border-radius: 9999px;
  font-weight: 600;
}

.pagination__link--prev {
  background: #eef2ff;
  color: #1e3a8a;
  border-color: #e0e7ff;
}

.pagination__link--next {
  background: linear-gradient(135deg, #0b3b8f, #0b174c);
  color: #fff;
  border-color: #0b174c;
}

.pagination__link--next:hover {
  color: #fff;
}

.pagination__link.is-active {
  background: #f97316;
  color: #fff;
  border-color: #f97316;
  box-shadow: 0 4px 10px rgba(249, 115, 22, 0.35);
}

.pagination__link.is-disabled {
  opacity: 0.5;
  pointer-events: none;
  box-shadow: none;
}

.pagination__ellipsis {
  color: #9ca3af;
  padding: 0 0.2rem;
  font-size: 1.1rem;
}

.pagination__icon {
  display: inline-flex;
  font-size: 1.1rem;
  line-height: 1;
}

.pagination__link--prev .pagination__icon {
  margin-right: 0.3rem;
}

.pagination__link--next .pagination__icon {
  margin-left: 0.3rem;
}

@media (max-width: 480px) {
  .pagination__list {
    padding: 0.3rem 0.4rem;
    gap: 0.3rem;
  }

  .pagination__link {
    min-width: 2rem;
    height: 2rem;
    font-size: 0.85rem;
  }

  .pagination__link--nav {
    padding: 0 0.75rem;
  }
}

/* Ad Swiper slider */
.ad-swiper {
  position: relative;
  margin-bottom: 0.6rem;
}

.ad-swiper__main {
  width: 100%;
  height: 260px;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #0f172a;
  position: relative;
}

.ad-swiper__main .swiper-wrapper,
.ad-swiper__main .swiper-slide {
  height: 100% !important;
}

.ad-swiper__main .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-swiper__main .swiper-wrapper,
.ad-lightbox__swiper .swiper-wrapper {
  display: flex !important;
  flex-wrap: nowrap !important;
}

.ad-swiper__main .swiper-slide,
.ad-lightbox__swiper .swiper-slide {
  flex: 0 0 100% !important;
  width: 100% !important;
}

@media (min-width: 768px) {
  .ad-swiper__main {
    height: 340px;
  }
}

@media (min-width: 1200px) {
  .ad-swiper__main {
    height: 380px;
  }
}

.ad-swiper__slide {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
}

.ad-swiper__image {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block;
}

.password-field {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.password-field input {
  flex: 1;
  min-width: 0;
}

.password-toggle {
  padding: 0.35rem 0.6rem;
  border-radius: 9999px;
  border: 1px solid #d1d5db;
  background: #fff;
  font-size: 0.8rem;
  cursor: pointer;
}

.social-login {
  max-width: 400px;
}

.social-login__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.social-login__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: 9999px;
  border: 1px solid #d1d5db;
  font-size: 0.9rem;
  text-decoration: none;
  background: #fff;
  color: #111827;
  min-width: 0;
}

.social-login__btn--facebook {
  background: #3b5998;
  border-color: #3b5998;
  color: #fff;
}

.social-login__icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.social-login__btn--facebook .social-login__icon {
  color: #fff;
}

.social-login__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

@media (max-width: 374px) {
  .social-login__row {
    grid-template-columns: 1fr;
  }
}

.ad-swiper__image--cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ad-swiper__arrow,
.ad-lightbox__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 9999px;
  border: none;
  background: rgba(15, 23, 42, 0.7);
  color: #f9fafb;
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  pointer-events: auto;
}

.ad-swiper__arrow.swiper-button-disabled {
  opacity: 0.35;
  pointer-events: auto;
  cursor: default;
}

.ad-lightbox__arrow.swiper-button-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.ad-swiper .ad-swiper__thumbs {
  opacity: 0;
  visibility: hidden;
}

.ad-swiper.ad-swiper--ready .ad-swiper__thumbs {
  opacity: 1;
  visibility: visible;
}

.ad-swiper__arrow--prev {
  left: 0.5rem;
}

.ad-swiper__arrow--next {
  right: 0.5rem;
}

.ad-swiper__pagination .swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  background: rgba(249, 250, 251, 0.5);
  opacity: 1;
}

.ad-swiper__pagination .swiper-pagination-bullet-active {
  background: #f97316;
}

.ad-swiper__pagination {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.5rem !important;
  min-height: 12px;
  display: flex;
  justify-content: center;
  pointer-events: auto;
}

.ad-swiper .ad-swiper__pagination {
  opacity: 0;
  visibility: hidden;
}

.ad-swiper.ad-swiper--ready .ad-swiper__pagination {
  opacity: 1;
  visibility: visible;
}

.ad-swiper__thumbs {
  margin-top: 0.5rem;
  overflow: hidden;
}

.ad-swiper__thumbs .swiper-wrapper {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
}

.ad-swiper__thumbs .swiper-slide {
  width: 64px;
  height: 64px;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 2px solid transparent;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.ad-swiper__thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ad-swiper__thumbs .swiper-slide-thumb-active {
  border-color: #f97316;
  transform: scale(1.06);
}

.ad-swiper__placeholder {
  width: 100%;
  height: 260px;
  border-radius: 0.75rem;
  background: #0f172a;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

@media (min-width: 768px) {
  .ad-swiper__placeholder {
    height: 340px;
  }
}

@media (min-width: 1200px) {
  .ad-swiper__placeholder {
    height: 380px;
  }
}

/* Lightbox */
.ad-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.ad-lightbox.is-open {
  display: flex;
}

.ad-lightbox__content {
  width: 90vw;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
}

.ad-lightbox__inner {
  position: relative;
  width: 90vw;
  height: 70vh;
  max-width: 90vw;
  max-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  pointer-events: none;
}

.ad-lightbox__swiper {
  width: 100%;
  height: 100%;
  pointer-events: auto;
}

.ad-lightbox__swiper .swiper-wrapper {
  height: 100%;
}

.ad-lightbox__swiper .swiper-slide {
  height: 100%;
}

.ad-lightbox__slide {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-lightbox__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ad-lightbox__arrow--prev {
  left: 0.5rem;
  pointer-events: auto;
}

.ad-lightbox__arrow--next {
  right: 0.5rem;
  pointer-events: auto;
}

.ad-lightbox__close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: rgba(15, 23, 42, 0.85);
  color: #f9fafb;
  border: none;
  border-radius: 9999px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  font-size: 0.9rem;
  pointer-events: auto;
}

.ad-lightbox__close--bottom {
  position: static;
  margin-top: 0;
}

/* Chat lightbox */
.chat-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 1000;
}

.chat-lightbox.is-open {
  display: flex;
}

.chat-lightbox__panel {
  position: relative;
  width: 90vw;
  max-width: 720px;
  max-height: 70vh;
  padding: 1.5rem 1.25rem 1.25rem;
  border-radius: 0.9rem;
  background: #0f172a;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-lightbox__image {
  max-width: 100%;
  max-height: 60vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.chat-lightbox__close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: rgba(15, 23, 42, 0.9);
  color: #f9fafb;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 9999px;
  padding: 0.15rem 0.6rem;
  cursor: pointer;
  font-size: 0.85rem;
}

/* Attachment previews */
.attachment-preview {
  display: none;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.attachment-preview__item {
  width: 64px;
  height: 64px;
  border-radius: 0.45rem;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  background: #f8fafc;
  position: relative;
}

.attachment-preview__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.attachment-preview__remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  border: none;
  background: #111827;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* City select modal */
.city-select__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.6rem;
  border-radius: 0.5rem;
  border: 1px solid #d1d5db;
  background: #fff;
  font-size: 0.9rem;
  color: #111827;
  cursor: pointer;
}

.city-select__value.is-empty {
  color: #9ca3af;
}

.city-select__arrow {
  font-size: 0.8rem;
  color: #6b7280;
}

.city-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.45);
  z-index: 50;
}

.city-modal.is-open {
  display: flex;
}

.city-modal__panel {
  width: min(520px, 100%);
  max-height: 85vh;
  background: #fff;
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.15);
}

.city-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  font-weight: 600;
  border-bottom: 1px solid #e5e7eb;
}

.city-modal__close {
  border: none;
  background: transparent;
  font-size: 1rem;
  cursor: pointer;
}

.city-modal__list {
  flex: 1;
  overflow: auto;
  padding: 0.6rem 0.85rem;
}

.city-modal__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
}

.city-modal__footer {
  padding: 0.65rem 0.85rem;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

.city-modal__confirm {
  width: 100%;
  border: none;
  border-radius: 9999px;
  background: #f97316;
  color: #fff;
  font-size: 0.95rem;
  padding: 0.5rem 0.9rem;
  cursor: pointer;
}

.thread-message__text {
  font-size: 0.9rem;
  white-space: pre-line;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Blog */
.blog-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.blog-category {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.8rem;
  border-radius: 9999px;
  border: 1px solid #cbd5f5;
  background: #f8fafc;
  color: #0f172a;
  text-decoration: none;
  font-size: 0.85rem;
}

.blog-category.is-active {
  background: #0b174c;
  border-color: #0b174c;
  color: #fff;
}

.blog-list {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.blog-card {
  display: block;
  background: #fff;
  border-radius: 0.9rem;
  padding: 0.75rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  text-decoration: none;
  color: #0f172a;
}

.blog-card__meta {
  font-size: 0.8rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.blog-card__dot {
  font-size: 0.7rem;
  line-height: 1;
}

.blog-card__body {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.blog-card__media {
  flex: 0 0 42%;
  max-width: 42%;
}

.blog-card__media img,
.blog-card__placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 0.6rem;
  display: block;
  object-fit: cover;
  background: #e2e8f0;
}

.blog-card__placeholder {
  color: #64748b;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.blog-card__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.blog-card__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card__excerpt {
  margin: 0;
  font-size: 0.9rem;
  color: #4b5563;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card__more {
  margin-top: auto;
  align-self: flex-end;
  color: #f59e0b;
  font-weight: 600;
  font-size: 0.85rem;
}

/* Ad preview card */
.ad-card {
  background: #fff;
  border-radius: 0.75rem;
  padding: 0.75rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ad-card.is-inactive {
  opacity: 0.55;
  filter: grayscale(0.6);
}

.ad-card__title-link {
  display: block;
  padding: 0.15rem 0;
  text-decoration: none;
  color: #111827;
}

.ad-card__title {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ad-card__info {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto auto auto;
  column-gap: 0.6rem;
  row-gap: 0.25rem;
  align-items: start;
}

.ad-card__info[data-ad-url] {
  cursor: pointer;
}

.ad-card__company-category {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.6rem;
  min-width: 0;
}

.ad-card__company-link,
.ad-card__category,
.ad-card__meta-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: #6b7280;
  text-decoration: none;
  min-width: 0;
  padding: 0.1rem 0;
}

.ad-card__company-link {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ad-card__meta-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ad-card__icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex: 0 0 auto;
}

.ad-card__meta-row--city {
  grid-column: 1;
  grid-row: 2;
}

.ad-card__meta-row--views {
  grid-column: 1;
  grid-row: 3;
}

.ad-card__meta-date {
  grid-column: 1;
  grid-row: 4;
  font-size: 0.85rem;
  color: #6b7280;
}

.ad-card__view-btn {
  grid-column: 2;
  grid-row: 3 / span 1;
  align-self: stretch;
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.6rem;
  border-radius: 2px;
  background: #0b174c;
  border: 1px solid #d1d5db;
  font-size: 0.8rem;
  text-decoration: none;
  color: #fff;
  text-align: center;
}

.ad-card__price {
  grid-column: 2;
  grid-row: 4;
  justify-self: end;
  font-weight: 600;
  font-size: 0.95rem;
}

.ad-card__actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.ad-card__action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.6rem;
  border-radius: 0.6rem;
  border: none;
  text-decoration: none;
  font-size: 0.85rem;
  color: #fff;
  cursor: pointer;
  text-align: center;
}

.ad-card__action-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex: 0 0 auto;
}

.ad-card__action-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}

.ad-card__action-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.ad-card__action-title {
  font-size: 0.85rem;
  font-weight: 600;
}

.ad-card__action-sub {
  font-size: 0.7rem;
  font-weight: 500;
}

.ad-card__action-btn--message {
  background: #16a34a;
}

.ad-card__action-btn--call {
  background: #2563eb;
}

.ad-card__action-btn--disabled {
  opacity: 0.6;
  pointer-events: none;
}

.ad-card__utilities {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.5rem;
  margin-top: 0.35rem;
  align-items: center;
}

.favorite-toggle__wrapper {
  margin: 0;
  display: flex;
  align-items: center;
}

.favorite-toggle {
  --favorite-color: #f97316;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: none;
}

.favorite-toggle__icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.favorite-toggle__icon path {
  stroke: var(--favorite-color);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.favorite-toggle.is-active .favorite-toggle__icon path {
  fill: var(--favorite-color);
}

.ad-card__share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: none;
  padding: 0.2rem 0;
  color: #6b7280;
  font-size: 0.8rem;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.ad-card__share-btn img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex: 0 0 auto;
  opacity: 0.7;
}

.ad-share-toast {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1.25rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.6rem;
  background: #0f172a;
  color: #fff;
  font-size: 0.85rem;
  text-align: center;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 1200;
}

.ad-share-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.contact-link {
  color: #2563eb;
  text-decoration: none;
  display: inline-block;
  padding: 0.1rem 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .blog-card__body {
    flex-direction: column;
  }

  .blog-card__media {
    max-width: 100%;
  }

  .blog-card__more {
    align-self: flex-start;
  }
}
