/* styles.css
   Комментарии: здесь лежат базовые стили для всех страниц.
   Используется mobile-first подход: сначала мобильные стили, затем медиа-запросы.
*/

/* --- Базовые переменные --- */
:root{
  --bg: #f6f7fb;
  --card: #ffffff;
  --muted: #6b7280;
  --accent: #0ea5a4; /* teal */
  --shadow: 0 6px 20px rgba(13,18,26,0.08);
  --radius: 12px;
  --max-width: 1100px;
  --container-padding: 16px;
  --gap: 12px;
}

/* --- Ресет и базовая типографика --- */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background:var(--bg);
  color:#111827;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height:1.45;
}

/* --- Контейнер центровки --- */
.container{
  max-width:var(--max-width);
  margin:0 auto;
  padding:0 var(--container-padding);
}
/* --- Хедер --- */
.header {
  height: 500px; /* задай нужную высоту */
  background-image: url("../img/header-background-img.jpg"); /* путь к картинке */
  background-size: cover; /* растянуть на весь header */
  background-position: center; /* центрирование */
  position: relative; /* чтобы absolute работал относительно header */
  overflow: hidden;
}

/* --- вверх хедера --- */
.top_header {
  background: linear-gradient(90deg, rgba(255,255,255,0.6), rgba(255,255,255,0.4));
  padding: 18px 0;
  box-shadow: var(--shadow);
  position: sticky; /* "прилипает" к верху при скролле */
  top: 0;
  z-index: 20; /* поверх картинки */
  display: flex;
  width: 85%;
  max-width: var(--max-width);
  margin: 0 auto;
  border-radius: 12px;
}

.header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}


/* --- середина хедера надпись --- */
.m_header{
  position:absolute;
  left:50%; top:65%; transform:translate(-50%,-50%);
  margin:0;
  font-size: clamp(80px, 25vw, 320px);
  font-weight:900;
  color: rgba(255,255,255,0.95); /* белый */
  text-shadow: 0 8px 30px rgba(0,0,0,0.35);
  z-index:2;
  pointer-events:none;
}
/* --- низ хедера --- */
.under_header {
  position: absolute;  /* фиксируем внизу header */
  bottom: 20px;        /* чуть выше низа картинки */
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;         /* поверх картинки */
  width: 85%;
  max-width: var(--max-width);
}
/* --- Лого название --- */
.text-name{
  position: relative;
  left: 0%;
  font-family: 'Rosso One', sans-serif;
  font-size: 48px;
  text-transform:  uppercase;
  background: linear-gradient(90deg, #0ea5a4, #065f5b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
} 
/* --- Поисковая панель --- */
.search-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--card);
  padding: 8px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  flex: 1;
}

.search-bar input {
  border: 0;
  outline: none;
  font-size: 14px;
  flex: 1;
  background: transparent;
}


/* --- Карточки категорий (гориз.) --- */
.categories{
  display:flex;
  gap:10px;
  overflow:auto;
  padding:12px 0;
}
.category{
  background:var(--card);
  padding:10px 14px;
  border-radius:12px;
  box-shadow:var(--shadow);
  white-space:nowrap;
  cursor:pointer;
}
.category:hover{ transform:translateY(-4px); transition:all .18s }

/* --- Секция последних объявлений (грид) --- */
.grid{
  display:grid;
  grid-template-columns:1fr;
  gap:var(--gap);
  margin-top:16px;
}
.card{
  background:var(--card);
  border-radius:var(--radius);
  overflow:hidden;
  box-shadow:var(--shadow);
  display:flex;
  gap:12px;
}
/* изображение карточки */
.card .thumb{
  width:120px;
  height:90px;
  flex-shrink:0;
  object-fit:cover;
}
/* содержание карточки */
.card .meta{
  padding:12px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:6px;
}
.card .title{ font-weight:600 }
.card .price{ color:var(--accent); font-weight:700 }

/* --- Кнопки --- */
.btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:10px;
  background:var(--accent);
  color:white;
  text-decoration:none;
  border:0; cursor:pointer;
  box-shadow:0 6px 18px rgba(14,165,164,0.12);
}
.btn.secondary{
  background:transparent; color:var(--accent); border:1px solid rgba(14,165,164,0.12);
}

/* --- Форма добавления --- */
.form{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:14px;
  background:var(--card);
  border-radius:10px;
  box-shadow:var(--shadow);
}
.input, textarea, select{
  padding:10px 12px;
  border-radius:8px;
  border:1px solid #e6e9ee;
  font-size:14px;
  outline:none;
}
textarea{ min-height:120px; resize:vertical }

/* --- Простейший футер --- */
.footer{
  margin-top:28px;
  padding:20px 0;
  color:var(--muted);
  font-size:14px;
  text-align:center;
}

/* --- Адаптив: для планшета/десктопа --- */
@media(min-width:768px){
  .grid{ grid-template-columns: repeat(2, 1fr); }
}
@media(min-width:1100px){
  .grid{ grid-template-columns: repeat(3, 1fr); }
  .header .inner{ gap:20px }
}
