/* =========================================================
   RENTARO24 – RESULTS PAGE (Full Replace)
   Map + Panel + Gate + Drawer (Booking)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap');

/* --- Preboot: nur auf Seite mit #rentaro-map --- */
body:has(#rentaro-map){ --header-h:80px; }
body:has(#rentaro-map) .site-footer,
body:has(#rentaro-map) footer{ visibility:hidden; }
body.app-ready:has(#rentaro-map) .site-footer,
body.app-ready:has(#rentaro-map) footer{ visibility:visible; }

/* --- Base --- */
body.rentaro-map-full{
  --accent:#f26609;
  --ink:#0f1724;
  --radius:16px;
  --shadow:0 22px 45px rgba(15,23,42,.16), 0 8px 20px rgba(15,23,42,.10);
  --sheet-peek:62px;
  font-family:Inter,system-ui,Segoe UI,Roboto,Arial,sans-serif;
  background:#f3f5f9;
  overflow-x:hidden;
  margin:0;
}
body.rentaro-map-full *{ box-sizing:border-box; }

.rentaro-results-root{
  position:relative;
  left:50%;
  right:50%;
  margin-left:-50vw;
  margin-right:-50vw;
  width:100vw;
  height:calc(100vh - var(--header-h));
}

/* Smooth-appear für Desktop */
.rentaro-left,
.rentaro-right{
  opacity:0;
  transform:translateY(6px);
  transition:opacity .18s ease, transform .18s ease;
}
body.rentaro-map-full.app-ready .rentaro-left,
body.rentaro-map-full.app-ready .rentaro-right{
  opacity:1;
  transform:none;
}

/* Map hidden until ready (Desktop) */
body.rentaro-map-full:not(.app-ready) .rentaro-map{ visibility:hidden; }

/* -------- Gate (hell) -------- */
.rs-gate{
  position:fixed;
  inset:0;
  z-index:9999;
  display:none;
  align-items:center;
  justify-content:center;
  background:rgba(245,247,250,.92);
}
body:has(#rentaro-map):not(.app-ready) .rs-gate{ display:flex !important; }

.gate-inner{
  min-width:min(640px,92vw);
  border:1px solid rgba(16,24,40,.12);
  border-radius:20px;
  background:#fff;
  box-shadow:var(--shadow);
  padding:22px;
  text-align:center;
}
.gate-brand{
  font-weight:800;
  letter-spacing:-0.02em;
  font-size:clamp(1.4rem,1.8vw,1.8rem);
  color:#0f1724;
  margin-bottom:6px;
}
.gate-msg{
  font-weight:700;
  color:#0f1724;
  margin:6px 0 10px;
}
.gate-progress{
  height:10px;
  border-radius:999px;
  background:#e6edf6;
  overflow:hidden;
  border:1px solid #d5deea;
}
.gate-bar{
  height:100%;
  width:0%;
  background:linear-gradient(90deg,#f26609,#ff9647);
  transition:width .2s ease;
}
.gate-sub{
  margin-top:10px;
  color:#54627b;
  font-size:12px;
}

/* Skeletonliste während Gate */
.rentaro-skeletons{ display:none; }
body.rentaro-map-full:not(.app-ready) .rentaro-skeletons{
  display:grid;
  gap:12px;
  margin:6px 0 12px;
}
.sk-item{
  display:flex;
  gap:12px;
  align-items:center;
  background:linear-gradient(180deg,#ffffff,#f9fbfe);
  border:1px solid #e8eef7;
  border-radius:14px;
  padding:12px;
}
.sk-thumb{
  width:132px;
  height:90px;
  border-radius:12px;
  background:linear-gradient(90deg,#eef3f9,#f4f8ff,#eef3f9);
  animation:sh 1.4s linear infinite;
}
.sk-lines{ flex:1; }
.sk-line{
  height:12px;
  border-radius:8px;
  margin:8px 0;
  background:linear-gradient(90deg,#eef3f9,#f4f8ff,#eef3f9);
  animation:sh 1.4s linear infinite;
}
.sk-line.w1{ width:60%; }
.sk-line.w2{ width:86%; }
.sk-line.w3{ width:40%; }

@keyframes sh{
  0%{background-position:-120px 0}
  100%{background-position:120px 0}
}

/* -------- Map / Panel Desktop -------- */
.rentaro-right{
  position:absolute;
  inset:0;
}
.rentaro-map{
  width:100%;
  height:100%;
}

.rentaro-left{
  position:absolute;
  top:12px;
  left:12px;
  bottom:12px;
  width:clamp(340px,28vw,480px);
  background:rgba(255,255,255,.96);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:16px;
  overflow:auto;
  border:1px solid rgba(16,24,40,.08);
}
.rentaro-right::before{
  content:"";
  position:absolute;
  inset:0 auto 0 0;
  width:26px;
  pointer-events:none;
  box-shadow: inset 14px 0 28px rgba(16,24,40,.10);
}

/* -------------------------------------------------
   Toolbar / Summary-Card
   ------------------------------------------------- */

.r24-left-head{
  position:absolute;
  top:0;
  left:0;
  right:0;
  height:0;
  padding:0;
  margin:0;
  background:transparent;
  border:none;
  box-shadow:none;
}
.r24-left-head .r24-left-title{
  display:none;
}

/* Back-Button */
.r24-left-back{
  width:34px;
  height:34px;
  border-radius:999px;
  border:0;
  background:#f5f6f8;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 4px 12px rgba(15,23,42,.16);
  cursor:pointer;
  padding:0;
  position:absolute;
  top:26px;
  left:26px;
  z-index:4;
}
.r24-left-back svg{
  width:18px;
  height:18px;
  fill:none;
  stroke:#0f1724;
  stroke-width:2;
}
@media (min-width:981px){
  .r24-left-back{ display:none; }
}

/* Top-Karte */
.rs-toolbar{
  position:relative;
  z-index:2;
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-bottom:12px;           /* etwas kompakter */
  padding:16px 18px 12px 62px;
  border-radius:22px;
  background:#ffffff;
  border:1px solid #dbe3ee;
  box-shadow:var(--shadow);
}
.rs-toolbar::after{
  content:"";
  position:absolute;
  left:18px;
  right:18px;
  top:54px;
  border-bottom:1px solid #e5e7eb;
}
.rs-toolbar.rs-toolbar-compact{
  padding:10px 14px 8px 58px;
  gap:6px;
}
.rs-toolbar.rs-toolbar-compact::after{
  top:46px;
}

.rs-summary{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:800;
  letter-spacing:-0.02em;
  color:var(--ink);
  font-size:18px;
  line-height:1.2;
  margin-bottom:6px;
}
.rs-toolbar.rs-toolbar-compact .rs-summary{
  font-size:16px;
}

.rs-summary-text{
  flex:1;
  min-width:0;
}
.rs-summary-text strong{
  display:block;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.rs-reset{
  flex:0 0 auto;
  width:32px;
  height:32px;
  border-radius:999px;
  border:1px solid #cfd8e5;
  background:#fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path d="M3 11.5L11.5 3a1.2 1.2 0 0 1 1.7 0l.8.8a1.2 1.2 0 0 1 0 1.7L5.5 14H3v-2.5z" fill="none" stroke="%230f1724" stroke-width="1.6" stroke-linejoin="round"/><path d="M3 13h2.5" stroke="%230f1724" stroke-width="1.6" stroke-linecap="round"/></svg>') no-repeat center / 16px 16px;
  text-indent:-9999px;
  overflow:hidden;
  cursor:pointer;
  padding:0;
  background-color:#fff;
  transition:background-color .15s ease,border-color .15s ease,box-shadow .15s ease;
}
.rs-reset:hover{
  background-color:#f9fafb;
  border-color:#c1ccdd;
  box-shadow:0 0 0 1px rgba(15,23,36,.03);
}
.rs-toolbar.rs-toolbar-compact .rs-reset{
  width:28px;
  height:28px;
}

/* Kriterien-Zeilen */
.rs-chips{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin:2px 0 0;
  padding-top:6px;
}
.rs-toolbar.rs-toolbar-compact .rs-chips{
  gap:4px;
}
.chip{
  border:0;
  border-radius:0;
  padding:0;
  background:transparent;
  font-weight:400;
  font-size:14px;
  color:#111827;
  display:flex;
  align-items:flex-start;
  gap:10px;
  line-height:1.4;
}
.rs-toolbar.rs-toolbar-compact .chip{
  font-size:13px;
}
.chip::before{
  content:"";
  flex:0 0 20px;
  height:20px;
  margin-top:2px;
  border-radius:6px;
  border:1px solid #cfd4e3;
  background:
    radial-gradient(circle at 50% 50%,#cfd4e3 1px,transparent 1px)
    center/60% 60% no-repeat;
}
.chip-active{
  font-weight:600;
}
.r24-criteria{
  display:none !important;
}

/* Sortieren / Actions */
.rs-actions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  font-size:12px;
  margin-bottom:6px;     /* etwas weniger Luft */
}
.rs-sort{
  display:flex;
  align-items:center;
  gap:6px;
  flex:1;
  min-width:0;
}
.rs-sort span{
  font-size:12px;
  color:#6b7280;
  white-space:nowrap;
}
.rs-sort select{
  flex:1;
  min-width:0;
  appearance:none;
  border:1px solid #cfd8e5;
  border-radius:12px;
  padding:6px 26px 6px 9px;
  background:#fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8"><path d="M1 1l5 6 5-6" stroke="%2354627b" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>') no-repeat right 8px center / 12px 8px;
  font-weight:600;
  font-size:12px;
}

/* -------------------------------------------------
   Ergebnisliste
   ------------------------------------------------- */
.rentaro-list{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.rentaro-item{
  background:#fff;
  border-radius:14px;
  box-shadow:0 8px 18px rgba(16,24,40,.06);    /* softerer Shadow */
  padding:12px;
  outline:2px solid transparent;
  transition:.15s transform,.2s outline-color,.2s box-shadow;
}
.rentaro-item:hover{
  transform:translateY(-3px);
  box-shadow:0 10px 22px rgba(16,24,40,.10);
}
.rentaro-selected{
  outline-color:var(--accent);
  background:#fff9f4;
}

.item-inner{
  display:flex;
  gap:12px;
  align-items:center;
}
.item-thumb img{
  width:132px;
  height:90px;
  object-fit:cover;
  border-radius:12px;
  display:block;
}
.item-main{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.item-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
}
.item-title{
  margin:0;
  font-weight:700;
  font-size:17px;               /* minimal größer */
  letter-spacing:-0.01em;       /* etwas kompakter */
  color:var(--ink);
}
.item-price{
  color:#118a3a;
  font-weight:800;
  white-space:nowrap;
}
.item-meta{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  color:#54627b;
  font-size:12px;
}
.item-distance{
  color:#c53030;                /* etwas dunkler, weniger schrill */
  font-weight:700;              /* minimal schwächer als Preis */
}
.item-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:2px;
}
.btn{
  appearance:none;
  border:0;
  border-radius:10px;
  padding:10px 14px;
  font-weight:800;
  font-size:14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  cursor:pointer;
  box-shadow:0 2px 8px rgba(16,24,40,.08);
  transition:transform .15s ease;
}
.btn:hover{ transform:translateY(-2px); }
.btn-dark{ background:#1f2937; color:#fff; }
.btn-accent{ background:#f26609; color:#fff; }

.rentaro-iw img{
  width:240px;
  height:150px;
  object-fit:cover;
  border-radius:10px;
  display:block;
}
.rentaro-iw .ttl{
  font-weight:800;
  margin:8px 0 4px;
}

/* -------------------------------------------------
   Drawer (Booking Wizard)
   ------------------------------------------------- */
.rs-drawer{
  position:fixed;
  inset:0;
  z-index:99999;
  display:none;
  align-items:stretch;
  justify-content:flex-end;
}
.rs-drawer.on{ display:flex; }

.rs-drawer-overlay{
  position:absolute;
  inset:0;
  background:rgba(15,23,36,.42);
  backdrop-filter:saturate(1.2) blur(2px);
}
.rs-drawer-panel{
  position:relative;
  width:min(480px,96vw);
  max-width:480px;
  height:100%;
  background:#fff;
  box-shadow:-18px 0 40px rgba(16,24,40,.18);
  transform:translateX(100%);
  transition:transform .24s ease;
  display:flex;
  flex-direction:column;
}
.rs-drawer.on .rs-drawer-panel{ transform:none; }

.rs-drawer-close{
  position:absolute;
  top:10px;
  right:10px;
  width:40px;
  height:40px;
  border:0;
  border-radius:10px;
  background:#f3f5f9;
  cursor:pointer;
}
.rs-drawer-close .x{
  display:block;
  width:16px;
  height:16px;
  margin:auto;
  position:relative;
}
.rs-drawer-close .x:before,
.rs-drawer-close .x:after{
  content:"";
  position:absolute;
  inset:0;
  width:16px;
  height:2px;
  background:#0f1724;
  top:7px;
  left:0;
}
.rs-drawer-close .x:before{ transform:rotate(45deg); }
.rs-drawer-close .x:after{ transform:rotate(-45deg); }

.rs-drawer-content{
  padding:18px;
  overflow:auto;
  height:100%;
}

.rs-drawer-skel .ph{
  border-radius:10px;
  background:linear-gradient(90deg,#eef3f9,#f4f8ff,#eef3f9);
  animation:sh 1.4s linear infinite;
}
.rs-drawer-skel .ph-img{ height:180px; margin-bottom:12px; }
.rs-drawer-skel .ph-line{ height:12px; margin:10px 0; }
.rs-drawer-skel .ph-line.w1{ width:60%; }
.rs-drawer-skel .ph-line.w2{ width:85%; }
.rs-drawer-skel .ph-line.w3{ width:40%; }
.rs-drawer-skel .ph-slot{ height:36px; margin:8px 0; }

/* -------------------------------------------------
   Mobile: Map vollbreit, Panel als Overlay, KEIN Reinfallen
   ------------------------------------------------- */
@media (max-width:980px){

  /* Root: volle Höhe unter Header */
  .rentaro-results-root{
    height:calc(100vh - var(--header-h,80px));
  }

  /* Map-Wrapper & Map: immer sichtbar, volle Fläche */
  .rentaro-map-wrap,
  .results-map,
  .rs-map,
  .rentaro-map,
  #rentaro-map{
    display:block !important;
    visibility:visible !important;
    opacity:1 !important;
    position:relative;
    width:100%;
    height:100%;
    min-height:100%;
  }

  /* KEIN visibility-hide für Map auf Mobile */
  body.rentaro-map-full:not(.app-ready) .rentaro-map{
    visibility:visible !important;
  }

  /* Map-Container ohne Animation */
  .rentaro-right{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    opacity:1 !important;
    transform:none !important;
    transition:none !important;
  }

  /* Panel als Vollbild-Overlay – kompakteres Padding */
  .rentaro-left,
  .rs-left,
  .results-left,
  .results-sidebar{
    position:fixed;
    top:var(--header-h,80px);
    left:0;
    right:0;
    bottom:0;
    width:100vw;
    height:auto;
    border-radius:0;
    padding:14px 10px 18px;   /* vorher 12px → mehr Breite für Cards */
    box-shadow:none;
    background:#f3f5f9;

    transform:translateX(100%);
    opacity:0;
    visibility:hidden;

    transition:transform .32s ease, opacity .18s ease;
    z-index:2;
  }

  .r24-left-visible{
    transform:translateX(0) !important;
    opacity:1 !important;
    visibility:visible !important;
  }
  .r24-left-hidden{
    transform:translateX(100%) !important;
    opacity:0 !important;
    visibility:hidden !important;
  }

  .sheet-grip{ display:none; }

  /* Drawer von unten */
  .rs-drawer{
    align-items:flex-end;
  }
  .rs-drawer-panel{
    width:100%;
    max-width:none;
    height:85vh;
    border-radius:16px 16px 0 0;
    transform:translateY(100%);
    transition:transform .24s ease;
  }
  .rs-drawer.on .rs-drawer-panel{ transform:none; }

  /* Summary-Card Mobile leicht getuned */
  .rs-toolbar{
    margin-bottom:8px;
    padding:14px 14px 10px 62px;
    box-shadow:0 18px 38px rgba(16,24,40,.18);
  }
  .rs-toolbar::after{
    top:50px;
    left:14px;
    right:14px;
  }
  .rs-summary{
    font-size:18px;
  }
  .rs-toolbar.rs-toolbar-compact{
    padding:10px 12px 6px 58px;
    box-shadow:0 10px 20px rgba(16,24,40,.12);
  }
  .rs-toolbar.rs-toolbar-compact .rs-summary{
    font-size:16px;
  }
  .rs-toolbar.rs-toolbar-compact .rs-chips{
    display:none;
  }
  .rs-sort span{
    display:none;
  }
}

/* Fokus */
.rentaro-item:focus{ outline-color:#3b82f6; }

/* show footer again once ready */
body.app-ready .rs-gate{ display:none !important; }

/* Immer volle Höhe links – unabhängig von der Trefferanzahl (Desktop) */
@media (min-width:981px){
  .rentaro-left{
    min-height: calc(100vh - var(--header-h) - 24px);
  }
}
