/* ================================================== */
/* Основные стили сайта */
/* ================================================== */
/* -------------------------------------------------- */

/* ================================================== */
/* Шапка */
/* ================================================== */

/* -------------------------------------------------- */

/* ================================================== */
/* Контент */
/* ================================================== */
/* -------------------------------------------------- */

/* ================================================== */
/* Регистрация */
/* ================================================== */


/* -------------------------------------------------- */

/* ================================================== */
/* Подвал */
/* ================================================== */



/* -------------------------------------------------- */

/* ================================================== */
/* Элементы формы */
/* ================================================== */
form {
	margin: 0;
	padding: 0;
}
.textbox {
	border: 1px solid #6b6b6b;
	background: #ffffff;
	font-family: Arial;
	font-size: 12px;
	color: #6b6b6b;
	padding: 2px 2px 3px 2px;
	margin: 0;
}
.textbox_search {
	border: 1px solid #b0b0b0;
	background: #ffffff;
	font-family: Arial;
	font-size: 12px;
	padding: 2px 2px 3px 2px;
	margin: 0;
}
.textbox_error {
	border: 1px solid #ff0000;
	background: #ffffff;
	font-family: Arial;
	font-size: 12px;
	color: #6b6b6b;
	padding: 2px 2px 3px 2px;
	margin: 0;
}
.textarea {
	border: 1px solid #6b6b6b;
	background: #ffffff;
	font-family: Arial;
	font-size: 12px;
	color: #6b6b6b;
}
.select {
	font-family: Arial;
	font-size: 13px;
	color: #6b6b6b;
	padding: 2px;
}
.button {
	border: 1px solid #6b6b6b;
	background: #ffffff;
	font-family: Arial;
	font-size: 12px;
	color: #6b6b6b;
	height: 22px;
	margin: 0;
}


.b2b_block{
	position: relative;
}

.href_b2b{
	position: absolute; 
	top: 0px;
	left: 0px;
	/*margin: 36px 10px 0 0;*/
	display: block; 
	width: 150px; 
	height: 97px; 
	padding: 0; 
	padding-top:35px;
	margin: 0;
}
/* -------------------------------------------------- */


.top	{
color:#fff;
font-family: Arial;
font-size: 16px;
font-weight:bold;
}

    .custom-legend {
//        width: 800px;           /* та сама ширина, що і карта */
        width:100%;
        margin: 0 auto 20px;    /* центруємо під картою, знизу відступ до таблиці */
        padding: 8px 12px;
        background: #fff;
        border: 1px solid #ccc;
        border-radius: 4px;
        box-sizing: border-box;
        font-size: 0.8em;       /* менший шрифт */
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px;
    }

    /* Кольорова мітка */
    .custom-legend .legend-item {
        display: flex;
        align-items: center;
        gap: 4px;
    }
    .custom-legend .legend-item i {
        width: 16px;
        height: 16px;
        display: inline-block;
        border: 1px solid #aaa;
    }

    .custom-popup {
        font-family: Arial, sans-serif;
        line-height: 1.5;
        padding: 8px;
        pointer-events: auto;
        max-width: 250px;
    }
    .country-name {
        font-weight: bold;
        color: #0057b7;
        margin-bottom: 5px;
    }
    .ad-price {
        font-weight: bold;
    }
    .ad-author {
        margin-top: 5px;
        font-style: italic;
    }
    .ad-date {
        font-size: 0.8em;
        color: #6c757d;
    }
    .legend {
        padding: 10px;
        background: white;
        border-radius: 5px;
        box-shadow: 0 0 10px rgba(0,0,0,0.2);
        line-height: 1.5;
    }
    .legend i {
        width: 20px;
        height: 20px;
        float: left;
        margin-right: 8px;
        opacity: 0.7;
    }
    .country-link {
        color: #0057b7;
        text-decoration: none;
    }
    .country-link:hover {
        text-decoration: underline;
    }

    /* контейнер-рядок */
    .country-table {
        display: flex;
        flex-wrap: wrap;
        margin: 20px auto;
        max-width: 100%;
        justify-content: center;
    }
    /* кожна «клітинка» */
    .country-cell {
        box-sizing: border-box;
        flex: 1 1 200px;       /* мінімальна ширина 200px, а якщо вміщається більше — розтягуватиметься */
        margin: 5px;
        padding: 10px;
        border: 1px solid #ccc;
        border-radius: 4px;
        background: #fafafa;
    }
    .country-cell .country-name {
        font-weight: bold;
        margin-bottom: 6px;
    }
    .country-cell .country-info {
        white-space: pre-line; /* переносити рядки в <br> */
    }



 :root{
    --bg:#f6f8fc;
    --card:#ffffff;
    --text:#0f172a;
    --muted:#64748b;
    --border:#e5e7eb;
    --primary:#158597;
    --primary2:#6366f1;
    --radius:16px;
    --shadow: 0 10px 30px rgba(15,23,42,.08);
  }
  *{box-sizing:border-box}
  body{
    background:linear-gradient(180deg, #eef2ff 0%, var(--bg) 35%, #fff 100%);
    color:var(--text);
  }
  .container{max-width:1180px;margin:0 auto;padding:0 16px}
  .card{
    background:var(--card);
    border:1px solid var(--border);
    border-radius:var(--radius);
    box-shadow: var(--shadow);
  }
  .btn{
    display:inline-flex;align-items:center;justify-content:center;gap:8px;
    padding:12px 16px;border-radius:14px;border:1px solid transparent;
    font-weight:700;cursor:pointer;user-select:none;
    transition:transform .08s ease, background .15s ease, border-color .15s ease;
    white-space:nowrap;
  }
  .btn:active{transform:translateY(1px)}
  .btn-primary{background:var(--primary);color:#fff}
  .btn-primary:hover{background:var(--primary2)}
  .btn-ghost{background:#fff;border-color:var(--border);color:var(--text)}
  .btn-ghost:hover{border-color:#cbd5e1}
  .badge{
    display:inline-flex;align-items:center;
    padding:6px 10px;border-radius:999px;
    font-size:12px;font-weight:700;
    border:1px solid var(--border);
    background:#fff;color:var(--muted);
  }
  .link{color:var(--primary);font-weight:800;text-decoration:none}
  .link:hover{text-decoration:underline}

  /* Hero */
  .hero{padding:18px 0 12px}
  .h1{
    font-size: clamp(26px, 3.4vw, 44px);
    line-height:1.05;margin:0;letter-spacing:-0.02em;
  }
  .subtitle{margin:10px 0 0;color:var(--muted);font-size:16px;line-height:1.4;max-width:760px}
  .hero-row{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}
  .search{
    flex:1 1 320px;display:flex;align-items:center;gap:10px;
    padding:12px 14px;border:1px solid var(--border);
    border-radius:14px;background:#fff;min-width:260px;
  }
  .search input{border:0;outline:0;width:100%;font-size:15px}
  .icon{width:18px;height:18px;opacity:.65;flex:0 0 auto}

  /* Mobile tabs */
  .tabs{
    display:flex;gap:8px;background:#fff;border:1px solid var(--border);
    border-radius:14px;padding:6px;margin-top:14px;
  }
  .tab{
    flex:1;padding:10px 12px;border-radius:12px;border:1px solid transparent;
    background:transparent;font-weight:900;color:var(--muted);cursor:pointer;
  }
  .tab[aria-selected="true"]{
    background:#eef2ff;border-color:#c7d2fe;color:#3730a3;
  }
  .hide{display:none!important}

  /* Layout */
  .main-grid{display:grid;grid-template-columns:1fr;gap:14px;margin:14px 0 18px}
  .map-wrap{padding:12px}
  .map-header{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
  .map-frame{
    border-radius:14px;overflow:hidden;border:1px solid var(--border);
    background:#f1f5f9;
    min-height:420px;
  }

  /* IMPORTANT: your map container should fill the frame */
  #map{
    width:100%;
    height:420px;          /* desktop default */
    min-height:420px;
  }

  /* Legend container (keep your JS) */
  .legend-wrap{
    margin-top:10px;
    padding:10px 12px;
    border:1px solid var(--border);
    border-radius:14px;
    background:#fff;
  }
  /* Optional: make existing legend nicer without changing its logic */
  #legend.custom-legend{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    align-items:center;
  }

  /* Sidebar */
  .side{display:grid;gap:14px}
  .side .card{padding:14px}
  .side h3{margin:0 0 10px;font-size:16px}

  /* All countries section wrapper */
  .section{margin:18px 0}
  .section-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
  .section-title h2{margin:0;font-size:20px}

  /* Country table mount styling (you keep its inner HTML) */
  #country-table.country-table{
    width:100%;
  }

  /* Desktop breakpoint */
  @media (min-width: 920px){
    .tabs{display:none}
    #panelMap, #panelList{display:block!important}
    .main-grid{grid-template-columns:1fr 360px;align-items:start}
    #map{height:460px;min-height:460px}
  }

  /* Mobile map height tuning */
  @media (max-width: 919px){
    #map{height:60vh;min-height:380px}
  }


/* ===== All Countries: grid/cards ===== */

#country-table.country-table{
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  align-items: stretch;
}

/* Tablet */
@media (min-width: 560px){
  #country-table.country-table{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* Desktop */
@media (min-width: 920px){
  #country-table.country-table{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
/* Large desktop */
@media (min-width: 1200px){
  #country-table.country-table{
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.country-cell{
  position: relative;
  border: 1px solid rgba(229,231,235,.95);
  border-radius: 16px;
  padding: 14px 14px 12px;
  min-height: 92px;

  /* важливо: backgroundColor ставиться inline з JS — лишаємо */
  box-shadow: 0 10px 30px rgba(15,23,42,.06);

  transition: transform .08s ease, box-shadow .15s ease, border-color .15s ease;
  overflow: hidden;
}

.country-cell:hover{
  transform: translateY(-1px);
  box-shadow: 0 16px 40px rgba(15,23,42,.10);
  border-color: rgba(203,213,225,.95);
}

.country-cell .country-name{
  display: inline-block;
  font-weight: 900;
  font-size: 15px;
  color: #0f172a;
  text-decoration: none;
  line-height: 1.1;
  padding-right: 72px; /* місце під кнопку */
}

.country-cell .country-name:hover{
  text-decoration: underline;
}

/* Інфо — робимо акуратно, щоб multiline виглядало норм */
.country-cell .country-info{
  margin-top: 8px;
  font-size: 13px;
  color: rgba(15,23,42,.72);
  line-height: 1.25;
  white-space: pre-line; /* зберігає перенос рядків з template string */
}

/* Кнопка-дія справа зверху: Claim/Outbid */
.country-cell .country-cta{
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(229,231,235,.95);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(6px);
  font-weight: 900;
  font-size: 12px;
  color: #4f46e5;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease;
}

.country-cell .country-cta:hover{
  background: #fff;
  border-color: rgba(199,210,254,.95);
}

/* Бейдж статусу (опційно) */
.country-cell .country-badge{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 800;
  color: rgba(100,116,139,.95);
}

/* Мобільна оптимізація: більше щільності */
@media (max-width: 420px){
  .country-cell{
    padding: 12px;
    border-radius: 14px;
  }
  .country-cell .country-name{
    font-size: 14px;
    padding-right: 64px;
  }
  .country-cell .country-info{
    font-size: 12.5px;
  }
  .country-cell .country-cta{
    top: 10px; right: 10px;
    padding: 7px 9px;
  }
}

.search-results a.result-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border:1px solid rgba(229,231,235,.95);
  border-radius:14px;
  background:#fff;
  text-decoration:none;
}

.search-results a.result-item:hover{
  border-color: rgba(199,210,254,.95);
}

.search-results .result-left{
  display:flex;
  flex-direction:column;
  gap:2px;
}

.search-results .result-name{
  font-weight:900;
  color:#0f172a;
}

.search-results .result-meta{
  font-size:12px;
  color:rgba(100,116,139,.95);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width: 70vw;
}

.search-results .result-cta{
  font-weight:900;
  color:#4f46e5;
  white-space:nowrap;
}



.feed{display:grid;gap:10px}
.feed-item{
  display:flex;align-items:center;justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border:1px solid rgba(229,231,235,.95);
  border-radius:14px;
  background:#fff;
}
.feed-item .meta{color:var(--muted);font-size:12px}
.feed-item .name{font-weight:900}
.badge{
  display:inline-flex;align-items:center;
  padding:6px 10px;border-radius:999px;
  font-size:12px;font-weight:800;
  border:1px solid var(--border);
  background:#fff;color:var(--muted);
}
.status-owned{background:#fff7ed;color:#9a3412;border-color:#fed7aa}

