/**
 * CPN Real Estate v1.6.12 — targeted compatibility and UI refinements.
 * Author: CProjects Network — https://www.cprojectsnetwork.com
 * Keep all rules scoped to the plugin; do not override the WordPress theme.
 */

/* Property Studio: history edits are a genuine four-field layout with an
 * unobtrusive remove action, not a large red browser-style button. */
.cpn-re-studio .cpn-re-history-edit-row{
  display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:13px!important;align-items:end!important;padding:16px!important;
  border:1px solid #dfe8f4!important;border-radius:19px!important;
  background:linear-gradient(145deg,#f8fbff,#f3f7ff)!important;
}
.cpn-re-studio .cpn-re-history-edit-row label{
  display:flex!important;flex-direction:column!important;gap:8px!important;
  min-width:0!important;color:#324966!important;font:700 12px/1.4 Inter,Poppins,system-ui,sans-serif!important;
}
.cpn-re-studio .cpn-re-history-edit-row label input:not([type=hidden]),
.cpn-re-studio .cpn-re-history-edit-row .cpn-ui-trigger{
  display:flex!important;box-sizing:border-box!important;width:100%!important;
  min-width:0!important;min-height:45px!important;height:45px!important;
  padding:10px 13px!important;background:#fff!important;border:1px solid #d6e2f2!important;
  border-radius:13px!important;box-shadow:none!important;color:#18304f!important;
  font:600 13px/1.4 Inter,Poppins,system-ui,sans-serif!important;
}
.cpn-re-studio .cpn-re-history-edit-row .cpn-re-history-note{grid-column:1/4!important}
.cpn-re-studio .cpn-re-history-edit-row .cpn-re-history-remove{
  grid-column:4!important;justify-self:end!important;align-self:end!important;
  display:grid!important;place-items:center!important;width:40px!important;height:40px!important;
  min-width:40px!important;min-height:40px!important;max-width:40px!important;
  margin:0 0 2px!important;padding:0!important;border:1px solid #e7dce3!important;
  border-radius:13px!important;background:#fff!important;color:#8f6070!important;
  box-shadow:none!important;cursor:pointer!important;font-size:16px!important;
}
.cpn-re-studio .cpn-re-history-edit-row .cpn-re-history-remove:hover{
  background:#fff0f3!important;color:#bf3157!important;border-color:#f0b8c7!important;
}
.cpn-re-studio .cpn-re-history-edit-row .cpn-re-history-remove:focus-visible{
  outline:3px solid #91b6f8!important;outline-offset:2px!important;
}
@media(max-width:1000px){
 .cpn-re-studio .cpn-re-history-edit-row{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 .cpn-re-studio .cpn-re-history-edit-row .cpn-re-history-note{grid-column:1/2!important}
 .cpn-re-studio .cpn-re-history-edit-row .cpn-re-history-remove{grid-column:2!important}
}
@media(max-width:520px){
 .cpn-re-studio .cpn-re-history-edit-row{grid-template-columns:minmax(0,1fr)!important;padding:12px!important}
 .cpn-re-studio .cpn-re-history-edit-row .cpn-re-history-note,
 .cpn-re-studio .cpn-re-history-edit-row .cpn-re-history-remove{grid-column:1!important}
}

/* The in-place row preview replaces the detached panel: clicking any row
 * expands complete, readable summary information directly below that row. */
.cpn-re.cpn-re-archive .cpn-re-feed-table>.cpn-re-table-preview{display:none!important}
.cpn-re.cpn-re-archive .cpn-re-feed-table tr.cpn-re-table-inline-details,
.cpn-re.cpn-re-archive .cpn-re-feed-table tr.cpn-re-table-inline-details:hover{
 background:#f4f8ff!important;cursor:auto!important;
}
.cpn-re.cpn-re-archive .cpn-re-feed-table tr.cpn-re-table-inline-details>td{
 position:static!important;display:table-cell!important;width:auto!important;max-width:none!important;
 background:transparent!important;padding:12px 18px 18px!important;
 border:0!important;white-space:normal!important;
}
.cpn-re.cpn-re-archive .cpn-re-feed-table .cpn-re-table-inline-details .cpn-re-table-preview-card{
 width:100%;max-width:100%;border:1px solid #dae6f6;border-radius:17px;
 overflow:hidden;background:#fff;grid-template-columns:minmax(170px,225px) minmax(0,1fr);
}
.cpn-re.cpn-re-archive .cpn-re-feed-table [data-cpn-row-id][aria-expanded="true"] td{
 border-top:2px solid var(--cpn-accent,#2563eb)!important;
}
@media(max-width:680px){
 .cpn-re.cpn-re-archive .cpn-re-feed-table .cpn-re-table-inline-details .cpn-re-table-preview-card{
   grid-template-columns:minmax(0,1fr)!important;
 }
}

/* Full-screen Map is portaled outside .cpn-re; price pin styling must survive.
 * Otherwise the Leaflet/Google marker becomes a bare icon or invisible label. */
body>.cpn-re-map-panel.cpn-re-fullscreen-panel .cpn-re-leaflet-icon{
 background:none!important;border:0!important;box-shadow:none!important;
}
body>.cpn-re-map-panel.cpn-re-fullscreen-panel .cpn-re-leaflet-pin{
 display:flex!important;align-items:center;justify-content:center;position:relative;
 width:max-content;min-width:66px;max-width:110px;min-height:34px;
 padding:7px 10px;border:2px solid #fff;border-radius:13px;
 color:#fff;background:var(--cpn-accent,#2563eb);
 font:850 11px/1 Inter,Poppins,system-ui,sans-serif;
 box-shadow:0 4px 17px #092c5960;white-space:nowrap;
 transform:translateX(calc((76px - 100%) / 2));
}
body>.cpn-re-map-panel.cpn-re-fullscreen-panel .cpn-re-leaflet-pin:after{
 content:"";position:absolute;bottom:-5px;left:calc(50% - 4px);width:8px;height:8px;
 transform:rotate(45deg);border-right:2px solid white;border-bottom:2px solid white;
 background:var(--cpn-accent,#2563eb);
}
body>.cpn-re-map-panel.cpn-re-fullscreen-panel .cpn-re-google-price-pin{
 display:flex!important;align-items:center;justify-content:center;white-space:nowrap;
 padding:9px 13px;border:2px solid #fff;border-radius:24px;
 background:var(--cpn-accent,#2563eb);color:#fff;font-weight:850;font-size:12px;
 box-shadow:0 5px 18px #10254840;cursor:pointer;
}
body>.cpn-re-map-panel.cpn-re-fullscreen-panel .cpn-re-google-info{
 display:grid;gap:5px;min-width:160px;color:#17304b;
 font:600 13px/1.45 Inter,Poppins,system-ui,sans-serif;
}
body>.cpn-re-map-panel.cpn-re-fullscreen-panel .cpn-re-google-info span{
 color:var(--cpn-accent,#2563eb);font-size:15px;font-weight:850;
}
body>.cpn-re-map-panel.cpn-re-fullscreen-panel .cpn-re-google-info a{
 color:var(--cpn-accent,#2563eb);font-weight:800;
}

/* Restore a reliable Split viewport; never cut off the top of the feed. */
@media(min-width:980px){
 .cpn-re.cpn-re-has-map[data-cpn-view="split"] .cpn-re-market-layout{
   align-items:start!important;height:calc(100dvh - 24px)!important;
   min-height:520px!important;max-height:calc(100dvh - 24px)!important;
 }
 .cpn-re.cpn-re-has-map[data-cpn-view="split"] .cpn-re-map-panel,
 .cpn-re.cpn-re-has-map[data-cpn-view="split"] .cpn-re-list-panel{
   align-self:start!important;height:100%!important;min-height:0!important;
 }
 .cpn-re.cpn-re-has-map[data-cpn-view="split"] .cpn-re-list-panel{
   overflow-y:auto!important;overflow-x:hidden!important;
   scroll-padding-top:8px!important;overscroll-behavior:contain;
 }
}
