/* Frvoya_Recherche - Search panel (premium, Athlete2-friendly)
   Inspired by large retailers (flat columns, clear separators, clean typography).
*/

/* Backdrop overlay - z-index:9 allows header/search bar to stay above */
.frvoya-search-backdrop{
  position:fixed;inset:0;
  background:rgba(0,0,0,.18);
  z-index:9;
  display:none;
}

/* Autocomplete container: it must be positionable by JS near the search bar.
   IMPORTANT: do NOT set inset:0 here, otherwise it becomes a full-screen overlay
   and the panel looks like a popup in the middle of the page.
*/
.frvoya-search-autocomplete.search-autocomplete{
  position:fixed;
  z-index:99999;
  display:none;
  margin:0;
  padding:0;
  background:transparent;
  /* allow JS to control left/top/width */
  top:auto;
  left:auto;
  right:auto;
  bottom:auto;
}

.frvoya-search-autocomplete.search-autocomplete ul li {
padding: 10px 10px 10px 10px !important;
}

/* Panel shell */
.frvoya-search-panel{
  color:#111;
  --frvoya-bg:var(--frvoya-search-bg,#fff);
  --frvoya-border:rgba(0,0,0,.10);
  --frvoya-shadow:0 26px 80px rgba(0,0,0,.22);
  --frvoya-radius:var(--frvoya-search-radius,16px);
  --frvoya-accent:var(--frvoya-search-accent,#034991);

  position:relative;
  width:100%;
  margin:0;
  box-sizing:border-box;

  background:var(--frvoya-bg);
  border:1px solid var(--frvoya-border);
  border-radius:var(--frvoya-radius);
  box-shadow:var(--frvoya-shadow);

  display:flex;
  flex-direction:column;

  max-height:min(76vh, 780px);
  overflow:hidden;          /* no horizontal scrollbars */
}

/* Close button (keep it simple and impossible to break) */
.frvoya-search-close{
  position:absolute;
  top:14px;
  right:14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:12px;
  border-radius:999px;
  border:0;
  min-width:0;
  min-height:0;
  width:auto !important;
  height:auto !important;
  box-sizing:border-box;
  -webkit-appearance:none;
  appearance:none;
  background:var(--frvoya-accent);
  color:#fff;
  cursor:pointer;
  font-size:26px;
  line-height:0 !important;
  text-align:center;
  box-shadow:0 10px 26px rgba(0,0,0,.22);
  z-index:5;
}
.frvoya-search-close:hover{filter:brightness(0.96)}
.frvoya-search-close:focus{outline:2px solid rgba(3,73,145,.35);outline-offset:2px}

/* Scroll area */
.frvoya-search-grid{
  flex:1 1 auto;
  min-height:0;
  display:grid;
  grid-template-columns: 1.15fr 1.15fr minmax(320px, 360px);
  gap:0;
  overflow:auto;
  overflow-x:hidden;
}

/* Columns */
.frvoya-col{min-width:0;padding:22px 24px;overflow-x:hidden}
.frvoya-col-left,.frvoya-col-middle{border-right:1px solid rgba(0,0,0,.08)}
.frvoya-col-right{background:rgba(0,0,0,.015)}

/* Sections */
.frvoya-section{min-width:0}
.frvoya-section + .frvoya-section{
  margin-top:18px;
  padding-top:18px;
  border-top:1px solid rgba(0,0,0,.07);
}
.frvoya-section-title{
  font-weight:800;
  font-size:12px;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:rgba(0,0,0,.55);
  margin:0 0 10px;
}

/* Lists (flat, like Bricorama) */
.frvoya-list,
.frvoya-product-list{
  list-style:none;
  margin:0;
  padding:0;
}

/* Generic rows (top searches, suggestions, categories, recent) */
.frvoya-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  padding:8px 0;
  min-width:0;
}
.frvoya-row a{
  color:inherit;
  text-decoration:none;
  flex:1;
  min-width:0;
  white-space:normal;
  overflow:hidden;
  text-overflow:clip;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  line-height:1.25;
  word-break:break-word;
}
.frvoya-row a:hover{text-decoration:underline}
.frvoya-empty{padding:8px 0;color:rgba(0,0,0,.55)}

/* tiny remove button (recent) */
.frvoya-x{
  line-height:0 !important;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px;
  border-radius:999px;
  border:1px solid rgba(0,0,0,.14);
  background:#fff;
  min-width:0;
  min-height:0;
  width:auto !important;
  height:auto !important;
  box-sizing:border-box;
  -webkit-appearance:none;
  appearance:none;
  cursor:pointer;
  line-height:0 !important;
  text-align:center;
color: #d1d1d1;
}
.frvoya-x:hover{background:rgba(0,0,0,.03)}

/* Products */
.frvoya-product{padding:10px 0}
.frvoya-product + .frvoya-product{border-top:1px solid rgba(0,0,0,.08)}
.frvoya-product-link{
  display:flex;
  align-items:flex-start;
  gap:12px;
  padding:10px 10px;
  border-radius:12px;
  text-decoration:none;
  color:inherit;
  min-width:0;
}
.frvoya-product-link:hover{background:rgba(0,0,0,.04)}
.frvoya-thumb{
  width:46px;height:46px;
  border-radius:12px;
  border:1px solid rgba(0,0,0,.10);
  object-fit:cover;
  background:#fff;
  flex:0 0 auto;
}
.frvoya-product-meta{display:flex;flex-direction:column;gap:4px;min-width:0}
.frvoya-product-name{
  font-weight:800;
  white-space:normal;
  overflow:hidden;
  text-overflow:clip;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  line-height:1.25;
  word-break:break-word;
}
.frvoya-product-sku{font-size:12px;color:rgba(0,0,0,.55)}
.frvoya-product-price{font-weight:900;color:var(--frvoya-accent)}

/* Keyboard active */
.frvoya-active{background:rgba(0,0,0,.06)}

/* Footer CTA */
.frvoya-search-footer{
  padding:14px 18px;
  border-top:1px solid rgba(0,0,0,.08);
  background:#fff;
}
.frvoya-view-all{
  display:block;
  text-align:center;
  border:1px solid rgba(0,0,0,.16);
  border-radius:12px;
  padding:12px 14px;
  text-decoration:none;
  font-weight:900;
  color:var(--frvoya-accent);
}
.frvoya-view-all:hover{background:rgba(0,0,0,.03)}

/* Safety: keep links readable even if theme forces colors */
.frvoya-search-panel a{color:#111 !important}
.frvoya-search-panel a:hover{color:var(--frvoya-accent) !important}

/* =============================================================================
   RESPONSIVE - MOBILE LAYOUT
   ============================================================================= */
@media (max-width: 980px){
  .frvoya-search-panel{width:100%;max-height:calc(100vh - 32px)}
  
  /* MOBILE UX FIX: Use flexbox to reorder columns
     Products appear FIRST on mobile for better UX! */
  .frvoya-search-grid{
    display: flex;
    flex-direction: column;
  }
  
  /* PRODUCTS FIRST (most important on mobile!) */
  .frvoya-col-right{
    order: 1;
    background: transparent;
    border-right: 0;
  }
  
  /* CATEGORIES SECOND */
  .frvoya-col-middle{
    order: 2;
    border-right: 0;
  }
  
  /* SUGGESTIONS/TOP SEARCHES LAST */
  .frvoya-col-left{
    order: 3;
    border-right: 0;
  }
}