/* Hanifi Ozturk Emlak - v13 UI Stabilization Layer
   Final public-facing layout overrides. Loaded after legacy theme layers. */
:root{
  --v13-header:82px;
  --v13-safe:clamp(15px,3vw,28px);
  --v13-card:#101316;
  --v13-card-2:#0c0f12;
  --v13-line:rgba(255,255,255,.085);
  --v13-gold:#dfc083;
}
html{scroll-padding-top:calc(var(--v13-header) + 18px)}
body{overflow-x:hidden;min-width:320px}
img{max-width:100%;height:auto}
button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}
button,input,select,textarea{max-width:100%}
.container{max-width:1180px}

/* Header: deterministic sizing and no overlap between brand/nav/actions. */
.site-header{height:var(--v13-header);isolation:isolate}
.header-inner{gap:18px;min-width:0}
.brand{min-width:210px;max-width:265px;flex:0 1 auto;overflow:hidden}
.brand-mark{flex:0 0 48px;width:48px;height:48px}
.brand-mark img{width:100%!important;height:100%!important;object-fit:contain!important}
.brand-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.brand-name small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.nav{gap:18px;min-width:0}
.nav a{font-size:11.5px}
.header-cta{flex:0 0 auto;white-space:nowrap}
.header-search,.header-fav,.menu-btn{flex:0 0 auto}
.header-search,.header-fav{width:42px;height:42px}

/* Hero and page headers: balanced content width and readable overlays. */
.hero{min-height:min(790px,100svh);padding-top:clamp(138px,15vh,176px);padding-bottom:72px}
.hero:after{background:linear-gradient(90deg,rgba(5,6,7,.94) 0%,rgba(5,6,7,.76) 43%,rgba(5,6,7,.26) 76%,rgba(5,6,7,.16) 100%),linear-gradient(0deg,#090a0b 0%,rgba(9,10,11,.34) 42%,transparent 74%)}
.hero-content{width:min(880px,100%);max-width:none}
.hero h1{font-size:clamp(54px,6.5vw,98px);overflow-wrap:break-word}
.hero .lead{max-width:650px;line-height:1.65}
.hero-search{width:min(930px,100%)}
.hero-search label,.field,.field-v2{min-width:0}
.hero-search input,.hero-search select,.field input,.field select,.field-v2 input,.field-v2 select{min-width:0}
.hero-stats{width:min(760px,100%);gap:16px}
.hero-stats>div{min-width:0}
.page-hero{min-height:500px}
.page-hero .hero-content{padding-right:min(8vw,100px)}

/* Cards and sections: stop fixed-width content from pushing the viewport. */
.grid>*{min-width:0}
.property-card,.service-card,.glass,.detail-block,.contact-card{min-width:0}
.property-card{height:100%}
.property-media{background:#17191c}
.property-media img{display:block}
.property-title,.property-loc,.property-price{overflow-wrap:anywhere}
.section-head>*{min-width:0}
.section-head h2{overflow-wrap:break-word}
.split>*{min-width:0}
.footer-grid>*{min-width:0}

/* Listing filters. */
.filter-shell{isolation:isolate}
.filter-grid,.filter-grid-v2{min-width:0}
.filter-grid>*,.filter-grid-v2>*{min-width:0}
.filter-toolbar{min-width:0;flex-wrap:wrap}
.filter-toolbar .chips{min-width:0}
.listing-tools{flex-wrap:wrap;gap:10px}

/* Detail pages: prevent horizontal overflow and floating-action collisions. */
.detail-top>*{min-width:0}
.detail-price strong{white-space:normal;overflow-wrap:anywhere}
.gallery,.gallery-side,.detail-layout,.facts,.features{min-width:0}
.gallery img{display:block}
.fact{min-width:0}
.advisor{z-index:2}
.v5-presentation-btn{display:none!important}
.v5-notebook-fab{left:24px!important;bottom:24px!important;z-index:94!important}
.v7-detail-bar{margin-top:16px;border-radius:14px;overflow:hidden}

/* One coherent floating-control system. Old launchers remain in DOM for v11 routing. */
.v4-tools,.v5-assistant-fab,.v6-collection-fab,.v7-tools-fab,.v8-admin-link,.v8-status-pill{display:none!important}
.live-agent{display:none!important}
.install-prompt{z-index:120!important}
.floating-actions{right:20px!important;bottom:20px!important}
.v11-tools-fab{right:20px!important;bottom:82px!important;z-index:121!important}
.v11-tools-panel{right:20px!important;bottom:136px!important;z-index:122!important}
.v11-tools-panel,.fav-drawer,.quick-search-dialog,.compare-dialog,.v4-dialog,.v5-assistant-panel,.v6-collections-card,.v7-tools,.v7-owner-card{max-width:calc(100vw - 24px)}
.v6-speed{z-index:119!important;padding-bottom:max(4px,env(safe-area-inset-bottom))}
.compare-bar{max-width:calc(100vw - 24px)}
.toast-stack{pointer-events:none}.toast-stack>*{pointer-events:auto}

/* Forms, drawers and modals. */
.contact-form input,.contact-form textarea,.contact-form select{font-size:16px}
.fav-list,.quick-search-results,.v5-chat{overscroll-behavior:contain}
.v4-modal,.compare-modal,.quick-search{overscroll-behavior:contain}

/* Footer spacing and legibility. */
.footer{overflow:hidden}
.footer-grid{gap:32px}
.footer-links a,.contact-list{line-height:1.65}
.footer-bottom{gap:18px;flex-wrap:wrap}

@media (min-width:1101px) and (max-width:1280px){
  .container{width:min(1180px,calc(100% - 36px))}
  .header-inner{gap:12px}
  .brand{min-width:190px;max-width:215px}
  .brand-name{font-size:16px}
  .nav{gap:13px}
  .nav a{font-size:10.5px}
  .header-cta{padding:11px 13px;font-size:11px}
}

@media(max-width:1100px){
  :root{--v13-header:76px}
  .container{width:min(1180px,calc(100% - 34px))}
  .site-header{height:var(--v13-header)}
  .header-inner{gap:10px}
  .brand{min-width:0;max-width:min(265px,calc(100vw - 165px));margin-right:auto}
  .nav{inset:calc(var(--v13-header) + 8px) 17px auto!important;max-height:calc(100dvh - var(--v13-header) - 26px);overflow:auto;padding:12px!important;border-radius:18px!important;box-shadow:0 28px 90px rgba(0,0,0,.58)}
  .nav a{padding:13px 14px!important;border-radius:10px}
  .nav a:hover,.nav a.active{background:rgba(216,180,122,.08)}
  .grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .facts{grid-template-columns:repeat(4,minmax(0,1fr))}
  .fact{border-bottom:1px solid var(--line2)}
}

@media(max-width:760px){
  :root{--v13-header:70px}
  html{scroll-padding-top:84px}
  body{padding-bottom:0!important}
  .container{width:calc(100% - 28px)}
  .site-header{height:var(--v13-header)}
  .site-header.scrolled{background:rgba(8,9,10,.94)}
  .header-inner{gap:7px}
  .brand{max-width:calc(100vw - 142px);gap:8px}
  .brand-mark{width:40px;height:40px;flex-basis:40px;font-size:22px}
  .brand-name{font-size:14px;letter-spacing:.02em}
  .header-search,.header-fav,.menu-btn{width:39px;height:39px}
  .header-search{display:none!important}
  .nav{inset:calc(var(--v13-header) + 7px) 10px auto!important;padding:9px!important;border-radius:15px!important}
  .nav a{font-size:13px!important;padding:11px 12px!important}

  .hero{min-height:auto;padding:118px 0 52px;align-items:flex-end}
  .hero:before{background-position:center!important;animation:none}
  .hero:after{background:linear-gradient(90deg,rgba(5,6,7,.91),rgba(5,6,7,.62)),linear-gradient(0deg,#090a0b 0%,rgba(9,10,11,.28) 53%,rgba(9,10,11,.15) 100%)}
  .hero h1{font-size:clamp(42px,13vw,60px);line-height:.98;letter-spacing:-.04em}
  .hero .lead{font-size:15px;line-height:1.65;margin-top:18px}
  .hero-actions{margin-top:24px;display:grid;grid-template-columns:1fr 1fr;gap:9px}
  .hero-actions .btn{min-height:48px;padding:0 13px;text-align:center}
  .hero-search{grid-template-columns:1fr!important;margin-top:24px;padding:7px}
  .hero-search label{padding:9px 11px!important;border-right:0!important;border-bottom:1px solid var(--line2)}
  .hero-search button{min-height:48px}
  .hero-stats{grid-template-columns:repeat(2,minmax(0,1fr));margin-top:30px;gap:12px 18px;padding-top:18px}
  .hero-stats strong{font-size:27px}
  .hero-stats span{font-size:10px;line-height:1.4;display:block}
  .page-hero{min-height:410px;padding-bottom:48px}
  .page-hero .hero-content{padding-right:0}

  .section{padding:62px 0}
  .section-head{margin-bottom:30px;gap:12px}
  .section-head h2{font-size:clamp(36px,11vw,50px)}
  .grid,.grid-2,.grid-3,.grid-4{grid-template-columns:1fr!important;gap:14px}
  .property-media{height:230px}
  .card-pad{padding:22px}

  .filter-shell{margin-top:-28px;padding:12px}
  .filter-grid,.filter-grid-v2{grid-template-columns:1fr!important;gap:8px}
  .field,.field-v2{height:58px}
  .filter-btn{height:50px;min-width:0;width:100%}
  .filter-toolbar{display:grid;grid-template-columns:1fr;gap:12px}
  .filter-toolbar .chips{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;width:100%}
  .filter-toolbar .chip{text-align:center;white-space:normal}
  .filter-result{width:100%;white-space:normal}

  .detail-header{padding-top:96px}
  .detail-top{padding:18px 0;gap:14px}
  .detail-top h1{font-size:clamp(38px,11vw,54px)}
  .detail-price strong{font-size:30px!important}
  .gallery{grid-template-columns:1fr!important;gap:8px}
  .gallery-main{height:310px!important}
  .gallery-side{grid-template-columns:1fr 1fr!important;gap:8px}
  .gallery-side>div{height:132px!important}
  .facts{grid-template-columns:repeat(2,minmax(0,1fr))!important;border-radius:12px}
  .fact{padding:15px 10px!important;border-right:1px solid var(--line2)!important}
  .fact:nth-child(2n){border-right:0!important}
  .detail-layout{grid-template-columns:1fr!important;gap:14px}
  .detail-block{padding:22px}
  .features{grid-template-columns:1fr!important}
  .advisor{position:static!important}
  .v7-detail-bar{grid-template-columns:1fr 1fr!important}
  .v5-notebook-fab{display:none!important}

  .v6-speed{left:8px!important;right:8px!important;bottom:max(8px,env(safe-area-inset-bottom))!important;width:auto!important;border-radius:16px!important}
  .v11-tools-fab{right:14px!important;bottom:82px!important;padding:7px!important}
  .v11-tools-fab b{display:none!important}
  .v11-tools-panel{right:10px!important;bottom:130px!important;width:min(310px,calc(100vw - 20px))!important}
  .floating-actions{display:none!important}
  .compare-bar{left:10px!important;right:10px!important;bottom:78px!important;width:auto!important}
  body.detail-page .compare-bar{bottom:78px!important}
  .install-prompt{left:10px!important;right:10px!important;bottom:78px!important;max-width:none!important}

  .footer{padding-top:42px}
  .footer-grid{grid-template-columns:1fr!important;gap:28px}
  .footer-bottom{display:grid!important;grid-template-columns:1fr;gap:8px}
  .footer:before{font-size:120px}
  .footer{padding-bottom:86px!important}
}

@media(max-width:430px){
  .container{width:calc(100% - 22px)}
  .brand-name{font-size:13px}
  .brand-name small{display:none!important}
  .hero-actions{grid-template-columns:1fr}
  .hero h1{font-size:clamp(40px,13vw,54px)}
  .hero-stats{gap:12px}
  .property-media{height:215px}
  .gallery-main{height:270px!important}
  .gallery-side>div{height:110px!important}
  .v7-detail-bar{grid-template-columns:1fr!important}
  .quick-search-dialog,.compare-dialog,.v4-dialog,.v5-assistant-panel,.v6-collections-card,.v7-tools,.v7-owner-card{max-width:calc(100vw - 12px)!important}
}

@media(prefers-reduced-motion:reduce){
  .hero:before,.brand-mark:after,.hero-content:after{animation:none!important}
}

/* Reliability over animation: content must remain visible even when a legacy observer fails. */
.reveal{opacity:1!important;transform:none!important;filter:none!important}
.preloader{animation:v13-preloader-failsafe .01s 3s forwards}
@keyframes v13-preloader-failsafe{to{opacity:0;visibility:hidden}}
/* v13.4 admin live-preview locator */
.cms-highlight-target{outline:4px solid #e7bc5c!important;outline-offset:7px!important;box-shadow:0 0 0 12px rgba(231,188,92,.18),0 0 80px rgba(231,188,92,.38)!important;position:relative;z-index:35;transition:box-shadow .25s ease,outline .25s ease}


/* v13.4 opaque scrolled header: prevent moving content from bleeding through the fixed navigation. */
@media(min-width:761px){
  .site-header.scrolled{
    background:rgba(6,8,9,.975)!important;
    -webkit-backdrop-filter:blur(20px) saturate(120%);
    backdrop-filter:blur(20px) saturate(120%);
    border-bottom:1px solid rgba(216,180,122,.14)!important;
    box-shadow:0 12px 38px rgba(0,0,0,.34);
  }
}
@media(max-width:760px){
  .site-header.scrolled{background:rgba(6,8,9,.985)!important}
}
/* v14.7.2 overlay coordination: quick tools must never float over the assistant drawer. */
body.v5-assistant-open{overflow:hidden!important}
body.v5-assistant-open .v11-tools-fab,
body.v5-assistant-open .v11-tools-panel{opacity:0!important;visibility:hidden!important;pointer-events:none!important;transform:translateY(10px)!important}
body.v5-assistant-open .v11-tools-panel.open{opacity:0!important;pointer-events:none!important}
