/* ===========================
   Secondary Home — FINAL CSS
   =========================== */

/* Container (centered, wider) */
.secondary-home{
  max-width:1440px;
  margin:0 auto;
  padding:24px;
}

/* -------- Hero -------- */
.novo-hero{
  display:grid;
  grid-template-columns:1.4fr 1fr 160px;
  gap:16px;
  align-items:center;
  background:#f6f8fb;
  border-radius:16px;
  padding:24px;
  margin-bottom:24px;
}
.novo-hero__title h1{
  margin:0 0 8px;
  font-size:36px;
  line-height:1.25;
  font-weight:800;
  word-break:break-word;
}
.novo-hero__badges{display:flex;gap:10px;flex-wrap:wrap}
.novo-badge{
  display:inline-flex;align-items:center;gap:6px;
  height:36px;padding:0 14px;border-radius:12px;font-weight:700;font-size:14px
}
.novo-badge--yellow{background:#ffeaa7;color:#3b3b3b}
.novo-badge--dark{background:#2d3436;color:#fff}
.novo-hero__agent{display:flex;justify-content:flex-end}
.novo-hero__agent img{width:160px;height:auto;border-radius:12px;object-fit:cover}

/* -------- Search box -------- */
.novo-search{
  background:#fff;border:1px solid #e8ecf2;border-radius:16px;padding:16px;width:100%
}
.novo-form{display:flex;flex-direction:column;gap:16px}
.novo-row{display:flex;flex-wrap:wrap;gap:14px;align-items:center} /* a bit more breathing room */
.field{display:flex;align-items:center}

/* Unified control height + base sizes */
.novo-input,.chip,.seg,select,.btn{
  height:40px;                     /* unified height */
  border-radius:10px;
  font-size:14px;
  line-height:1.2;
}

/* Inputs / selects */
.novo-input{
  display:block;width:100%;min-width:140px;
  padding:0 12px;
  border:1px solid #d1d5db;background:#fff;
  outline:none
}
.novo-input:focus{border-color:#2563eb;box-shadow:0 0 0 2px rgba(37,99,235,.2)}
/* match native select to inputs exactly */
select.novo-input{
  height:40px;line-height:40px;padding-right:32px;
  -webkit-appearance:none;-moz-appearance:none;appearance:none;
}

.field--kw .novo-input{min-width:380px;flex:1}
.field--action .novo-input{min-width:180px}
.field--type .novo-input{min-width:220px}
.field--city .novo-input{min-width:200px}
.field--area .novo-input{min-width:220px}
.field--price-low .novo-input,
.field--price-high .novo-input,
.field--size-low .novo-input,
.field--size-high .novo-input{min-width:170px}

/* Pairs (Цена от/до, Площадь от/до) */
.field-group{display:flex;gap:12px;flex-wrap:nowrap}
.field-group .field{flex:1}

/* Chips */
.chip-group{display:flex;gap:8px}
.chip{
  padding:0 12px;border:1px solid #d1d5db;background:#f9fafb;cursor:pointer;transition:.15s
}
.chip:hover{background:#f1f5f9}
.chip.is-active{background:#2563eb;color:#fff;border-color:#2563eb}
.chip:focus-visible{outline:2px solid rgba(37,99,235,.35);outline-offset:2px}

/* Segmented toggle (за всё / за м²) */
.seg-toggle{display:inline-flex;border:1px solid #d1d5db;border-radius:10px;overflow:hidden;height:40px}
.seg{padding:0 14px;background:#f9fafb;border:0;cursor:pointer;transition:.15s;height:38px;line-height:38px}
.seg.is-active{background:#2563eb;color:#fff}
.seg + .seg{border-left:1px solid #d1d5db}

/* Buttons */
.btns{display:flex;gap:10px}
.btn{
  display:inline-flex;align-items:center;justify-content:center;
  padding:0 16px;border:1px solid transparent;text-decoration:none;cursor:pointer
}
.btn:focus-visible{outline:2px solid rgba(37,99,235,.35);outline-offset:2px}
/* Slightly stronger buttons */
.btn-primary{background:#2563eb;color:#fff;border-color:#2563eb;font-weight:600;font-size:15px}
.btn-primary:hover{background:#1e4ed8}
.btn-dark{background:#111827;color:#fff;border-color:#111827;font-weight:600;font-size:15px}
.btn-dark:hover{background:#000}
.btn-outline{background:#fff;border-color:#cfd6e4;color:#111}
/* small separation from last input on desktop */
.field--actions{margin-left:8px}

/* Links row */
.field--links a{font-size:14px;color:#2563eb;text-decoration:none;margin-right:12px}
.field--links a:hover{text-decoration:underline}

/* Advanced wrap hidden */
.advanced-wrap.is-hidden{display:none}

/* Sections */
.section-title{margin:32px 0 16px;font-size:22px;font-weight:800}

/* A11y utility */
.sr-only{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
  clip:rect(0,0,0,0);white-space:nowrap;border:0
}

/* Hide numeric spinners */
.novo-input[type=number]::-webkit-outer-spin-button,
.novo-input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.novo-input[type=number]{-moz-appearance:textfield}

/* -------- Responsive: Title size -------- */
@media (max-width:1200px){
  .novo-hero__title h1{font-size:32px;line-height:1.3}
}

/* -------- Mobile stack (properly scoped) -------- */
@media (max-width:768px){
  .secondary-home{padding:16px}
  .novo-form{gap:12px}
  .novo-row{flex-direction:column;gap:12px;align-items:stretch}
  .field,.field .novo-input,.seg-toggle,.chip-group{width:100%}

  /* pairs stack cleanly */
  .field-group{flex-wrap:wrap;gap:12px}
  .field-group .field{flex:1 1 100%}

  /* chips wrap */
  .chip-group{flex-wrap:wrap;gap:8px}
  .chip{flex:1 1 calc(25% - 8px);min-width:70px;justify-content:center}

  /* segmented toggle full width */
  .seg-toggle{width:100%}
  .seg{flex:1 1 50%;text-align:center}

  /* buttons stack full width */
  .btns{flex-direction:column;width:100%}
  .btns .btn{width:100%}

  /* avoid iOS zoom on focus */
  .novo-input{font-size:16px}

  /* long select text ellipsis */
  .novo-input{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

  /* no left nudge on mobile */
  .field--actions{margin-left:0}
} /* <-- important closing brace */

/* -------- Safety reset for desktop/tablet -------- */
@media (min-width:769px){
  .secondary-home .novo-row{display:flex;flex-wrap:wrap}
  .secondary-home .novo-row .field,
  .secondary-home .novo-row .seg-toggle,
  .secondary-home .novo-row .chip-group{width:auto}
}

/* -------- Laptop-friendly shrinking (guarded) -------- */
@media (min-width:769px) and (max-width:1366px){
  .secondary-home .novo-row{gap:12px}
  .secondary-home .novo-row .field{flex:1 1 150px;min-width:120px}
  .secondary-home .field-group .field{flex:1 1 140px;min-width:120px}

  .secondary-home .novo-input,
  .secondary-home select.novo-input,
  .secondary-home .chip,
  .secondary-home .seg,
  .secondary-home .btn{height:38px;font-size:13.5px}
  .secondary-home .seg{line-height:36px;padding:0 12px}
  .secondary-home .chip{padding:0 10px}
  .secondary-home .btn{padding:0 14px}
}

@media (min-width:769px) and (max-width:1200px){
  .secondary-home .novo-row .field{flex:1 1 130px;min-width:105px}
  .secondary-home .field-group .field{flex:1 1 130px;min-width:105px}

  .secondary-home .novo-input,
  .secondary-home select.novo-input,
  .secondary-home .chip,
  .secondary-home .seg,
  .secondary-home .btn{height:36px;font-size:13px}
  .secondary-home .seg{line-height:34px}
}

/* keep action buttons from cramping on mid widths */
@media (min-width:1025px) and (max-width:1366px){
  .secondary-home .field--actions{margin-left:6px}
}



/* --- FINAL tweak: force uniform shrink on laptops --- */
@media (min-width:769px) and (max-width:1366px){
  /* make all .field elements equal flex children */
  .secondary-home .novo-row .field,
  .secondary-home .field-group .field {
    flex:1 1 0;
    min-width:120px;  /* keep them from collapsing too far */
    max-width:1fr;    /* let them distribute evenly */
  }

  /* inputs + selects uniform width behavior */
  .secondary-home .novo-input,
  .secondary-home select.novo-input {
    width:100%;   /* full width inside field */
  }
}


