/* style.css - Стили для страницы поисковых результатов */

/* --------- Базовые переменные темы --------- */
:root{
  --accent:#3f37ff;          /* основной акцент (кнопка) */
  --accent-ink:#2a2a9a;      /* тёмный для заголовков */
  --ink:#202124;             /* основной текст */
  --muted:#5f6368;           /* вторичный текст */
  --border:#c9ccff;          /* рамки карточек */
  --bg:#fff;                 /* фон карточек/страницы */
  --success:#3c8041;         /* «зелёный URL» */
  --radius:18px;
}

/* --------- Общая раскладка --------- */
* { box-sizing: border-box; }
html, body { margin:0; padding:0; background:#fafbff; color:var(--ink); }

.search-container {
    font-family: Arial, sans-serif;
    max-width: 860px;
    margin: 0 auto;
    padding: 0 16px 40px;
}

/* --------- Поисковая строка --------- */
.search-box {
    width: 100%;
    margin: 20px 0 14px;
    display: flex;
    gap:0;
}

.search-input {
    flex: 1;
    padding: 12px 15px;
    font-size: 16px;
    border: 1.5px solid #dfe1f5;
    border-right: 0;
    border-radius: 12px 0 0 12px;
    outline: none;
    background:#fff;
}
.search-input:focus { border-color:#b8bbff; }

.search-button {
    padding: 12px 20px;
    font-size: 16px;
    background-color: var(--accent);
    color: white;
    border: 0;
    border-radius: 0 12px 12px 0;
    cursor: pointer;
    font-weight:700;
}
.search-button:hover { filter:brightness(.96); }

/* --------- Подписи секций --------- */
.ads-label,
.product-label {
    font-size: 12px;
    color: #7a7fb3;
    margin: 6px 2px 8px;
    display: block;
    letter-spacing:.08em;
    text-transform:uppercase;
}

/* --------- Карточки рекламных объявлений (текстовые) --------- */
.ads-container{
  display:flex;
  flex-direction:column;
  gap:22px;
  margin-top:10px;
}

.ad-card{
  border:2px solid var(--border);
  border-radius:var(--radius);
  background:var(--bg);
  padding:18px 20px 18px;
  box-shadow:0 0 0 rgba(0,0,0,0);
  transition:box-shadow .15s ease, transform .06s ease;
}
.ad-card:hover{ box-shadow:0 6px 24px rgba(63,55,255,.12); transform:translateY(-1px); }

.ad-head{
  display:flex; align-items:center; gap:10px; margin-bottom:10px; color:#8186c1;
  font-size:12px; letter-spacing:.08em; text-transform:uppercase; user-select:none;
}
.ad-head .sponsor-dot{
  width:18px; height:18px; display:inline-flex; align-items:center; justify-content:center;
  border-radius:50%; border:1.5px solid var(--border); font-size:12px; line-height:1;
}

.ad-title{
  margin:0 0 6px 0; line-height:1.25;
}
.ad-title a{
  color:var(--accent-ink); text-decoration:none; font-size:22px; font-weight:800;
}
.ad-title a:hover{ text-decoration:underline; }

.ad-url{
  display:flex; align-items:center; gap:8px; color:var(--success);
  font-size:13px; margin-bottom:8px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.ad-url img{
  width:14px; height:14px; border-radius:3px; object-fit:cover; flex:0 0 14px;
}

.ad-desc{
  color:var(--muted); font-size:15px; line-height:1.55;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
  margin:0 0 14px 0;
}

.ad-chips{
  display:flex; flex-wrap:wrap; gap:12px; margin-bottom:16px;
}
.ad-chip{
  font-size:14px; color:var(--accent-ink); text-decoration:none;
  display:inline-flex; align-items:center; gap:6px;
}
.ad-chip:after{ content:"›"; font-size:16px; line-height:1; }

.ad-cta{
  display:inline-block; width:100%;
  text-align:center; border-radius:999px; padding:14px 18px; font-weight:800;
  background:var(--accent); color:#fff; text-decoration:none; font-size:16px;
  box-shadow:inset 0 -3px 0 rgba(0,0,0,.08);
}
.ad-cta:hover{ filter:brightness(0.96); }

/* --------- Product Ads (горизонтальная карусель) --------- */
.product-ads-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    margin-bottom: 25px;
    overflow-x: auto;
    padding: 6px 2px 10px;
    -webkit-overflow-scrolling: touch;
}
.product-ads-container::-webkit-scrollbar { height: 8px; }
.product-ads-container::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }
.product-ads-container::-webkit-scrollbar-track { background: #f5f5f5; }

.product-ad-item {
    border: 2px solid var(--border);
    padding: 12px;
    border-radius: 14px;
    min-width: 190px;
    width: 190px;
    transition: box-shadow .15s ease, transform .06s ease;
    background:#fff;
}
.product-ad-item:hover { box-shadow:0 6px 24px rgba(63,55,255,.12); transform:translateY(-1px); }

.product-image {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}
.product-image img { max-width: 100%; max-height: 140px; object-fit: contain; }

.product-title {
    font-size: 14px;
    line-height: 1.25;
    height: 38px;
    overflow: hidden;
    margin: 0 0 8px 0;
}
.product-title a{ color:var(--accent-ink); text-decoration:none; font-weight:700; }
.product-title a:hover{ text-decoration:underline; }

.product-price {
    color: #111;
    font-weight: bold;
    font-size: 16px;
    margin: 4px 0 2px;
}
.seller-name {
    color: #777;
    font-size: 12px;
}

/* --------- Органика (если появится) --------- */
.organic-results { margin-top: 10px; }
.result-item { margin-bottom: 25px; }
.result-title { font-size: 18px; margin: 0 0 5px 0; }
.result-title a { color: #1a0dab; text-decoration: none; }
.result-title a:hover { text-decoration: underline; }
.result-url { color: var(--success); font-size: 14px; margin: 0 0 5px 0; }
.result-description { color: #444; line-height: 1.4; }

/* --------- Адаптив --------- */
@media (max-width: 640px) {
    .ad-title a { font-size: 18px; }
    .ad-cta { font-size:15px; padding:12px 16px; }
    .product-ad-item { min-width: 170px; width:170px; }
}
