/* style.css — очищено от неиспользуемых блоков */

body {
  font-family: sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f5f5f5;
  color: #333;
}

header {
  background-color: #005baa;
  color: white;
  padding: 1rem;
}

footer {
  background-color: #c5c5c9;
  color: white;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  position: relative;
  padding: 0 1.2rem;
}

#footer-email {
  text-align: left;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  position: relative;
}

.logo-block {
  display: flex;
  align-items: center;
}

.logo {
  height: 50px;
  width: auto;
  margin-right: 10px;
}

.header-inner h1 {
  font-size: 1.5rem;
  margin: 0;
  flex-shrink: 0;
}

.header-inner > div:last-child {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.add-button {
  color: white;
  text-decoration: none;
  font-weight: bold;
  background-color: #007acc;
  padding: 0.3rem 0.6rem;
  border-radius: 5px;
  font-size: 0.85rem;
}

.login-button {
  background-color: #ffffff;
  color: #005baa;
  border: none;
  padding: 0.3rem 0.6rem;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.85rem;
}

.container {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

.sidebar {
  width: 270px;
  background-color: white;
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  margin-right: 1rem;
  flex-shrink: 0;
}

.sidebar form fieldset {
  border: none;
  margin-bottom: 1.5rem;
  padding: 0;
}

.sidebar legend {
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.sidebar label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.radio-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 5px;
}

.radio-options label {
  font-weight: normal;
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-pair {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.input-pair label {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.input-pair input {
  width: 30px;
}

.sidebar input[type="text"],
.sidebar select,
.sidebar input[type="number"] {
  width: 100%;
  padding: 0.4rem;
  margin: 0.2rem 0 0.8rem;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.sidebar input.short-number {
  width: 60px;
}

.sidebar button[type="button"] {
  margin-top: 0.3rem;
  background: #ddd;
  padding: 0.2rem 0.6rem;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.85rem;
}

.search-button {
  width: 100%;
  background-color: #005baa;
  color: white;
  padding: 0.6rem;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

.search-button:hover {
  background-color: #004a90;
}

.listings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  align-items: start;
}

.listing {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 180px;
  overflow: hidden;
  line-height: 1.2;
}

.listing img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.listing h3,
.listing p {
  margin: 0.1rem 0;
  font-size: 0.8rem;
}

.card-description {
  font-size: 0.9rem;
  color: #333;
  margin-top: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-comment {
  font-style: italic;
  color: #666;
  margin-top: 0.5rem;
}

.listings-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1rem;
}

.listing-card {
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 1rem;
  width: 300px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.listing-card img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}


.form-page h1 {
  text-align: center;
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
}

#exchange-form {
  background: #f8f8f8;
  padding: 1rem;
  border-radius: 8px;
  max-width: 1200px;
  margin: 2rem auto;
  font-size: 0.95rem;
  line-height: 1.8;
  box-sizing: border-box;
  overflow-x: hidden;
  padding-right: 1rem;
}

#exchange-form fieldset {
  border: 1px solid #ccc;
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 5px;
}

#exchange-form legend {
  font-weight: bold;
  margin-bottom: 0.5rem;
}

#exchange-form input[type="number"] {
  width: 50px;
}

#exchange-form input[type="text"] {
  min-width: 300px;
  height: 20px;
}

#exchange-title {
  font-size: 1.1rem;
  padding: 0.6rem;
  min-height: 3rem;
  width: 100%;
  max-width: 700px;
  border-radius: 6px;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

#exchange-comment {
  font-size: 1rem;
  min-height: 60px;
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  resize: vertical;
}

#contact-phone, #contact-email {
min-width: 300px;
height: 20px;
}

/*  Пример стилизации placeholder  */
input::placeholder {
  font-family: Arial, sans-serif; /*  Например, Arial  */
  font-size: 14px; /*  Например, 14 пикселей  */
  color: gray; /*  Например, серый цвет  */
}

/* Вендорные префиксы для разных браузеров */
::-webkit-input-placeholder { /* WebKit, Blink, Edge */
  font-family: Arial, sans-serif;
  font-size: 14px;
  color: gray;
}

::-moz-placeholder { /* Mozilla Firefox */
  font-family: Arial, sans-serif;
  font-size: 14px;
  color: gray;
}

:-ms-input-placeholder { /* Internet Explorer 10-11 */
  font-family: Arial, sans-serif;
  font-size: 14px;
  color: gray;
}

::-ms-input-placeholder { /* Microsoft Edge */
  font-family: Arial, sans-serif;
  font-size: 14px;
  color: gray;
}

.gallery-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.gallery-preview img,
.preview-thumb {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
}

.preview-container {
  position: relative;
  display: inline-block;
  margin: 5px;
}

.remove-photo {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #ff5c5c;
  border: none;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  cursor: pointer;
}


textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  resize: vertical;
}

.suggestions {
  max-height: 300px;
  overflow-y: auto;
  list-style: none;
  padding: 0;
  margin-top: 2px;
  background: white;
  position: absolute;
  z-index: 10;
  width: 250px;
  box-sizing: border-box;
}

.suggestions li {
  cursor: pointer;
  font-size: 1rem;
  padding: 0,2
}

.suggestions li:hover {
  background-color: #f0f0f0;
}

.selected-tags {
  margin-top: 5px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  box-sizing: border-box;
  width: 100%;
  overflow-x: auto;
}

.tag {
  background-color: #e0f0ff;
  padding: 4px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  font-size: 14px;
}

.tag button {
  margin-left: 6px;
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
}

.listing-slider {
  position: relative;
  width: 100%;
  height: 150px;
  overflow: hidden;
}

.listing-slider img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: none;
}

.listing-slider button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  color: white;
  border: none;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
}

.mini-prev { left: 5px; }
.mini-next { right: 5px; }

@media (min-width: 1024px) {
  .listings {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 600px) and (max-width: 1023px) {
  .listings {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 599px) {
  .listings {
    grid-template-columns: 1fr;
  }

  main {
    flex-direction: column;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-inner > div:last-child {
    position: static;
    align-self: flex-end;
    margin-top: 0.5rem;
  }

  .header-inner h1 {
    margin-top: 0.5rem;
  }
}
