/* ============================================================
   preowned.css — Pre-owned Cars page
   Load AFTER css/style.css. Everything is scoped to .po-* / body.po-page
   (own prefix, so it can never collide with classes in style.css).
   Mobile-first; tablet >=768px; desktop >=1024px.
   No <header>/<section>/<footer> elements are used in the page (style.css styles those tags globally).
   The budget slider is built from buttons, NOT <input type=range>, so the site-wide input[type=range] rule in style.css can't touch it.
   ============================================================ */

body.po-page{
  --po-green:#18A76B;
  --po-grey:#F1F1EF;
  --po-muted:#7F7F78;
  --po-line:#E6E6E2;
  --po-header-h:70px;
  background:#ECECEC;
  padding-bottom:0;
}
.po-page [hidden]{display:none !important;}
.po-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}
body.po-modal-open{overflow:hidden;}

/* ---------- Header: same .header-v2-overlay as every page + a dark band behind it ---------- */
.po-main{position:relative;padding:calc(var(--po-header-h) + 26px) 16px 56px;}
.po-main::before{content:'';position:absolute;top:0;left:0;right:0;height:var(--po-header-h);background:var(--green-dark,#0A2318);}
.po-wrap{max-width:1280px;margin:0 auto;}
.po-title{margin:0;font-family:var(--display);font-weight:800;font-size:2.3rem;line-height:1.05;color:#16181B;}
.po-sub{margin:10px 0 0;font-size:1rem;color:var(--po-muted);}

/* ---------- Hero ---------- */
.po-hero{
  position:relative;overflow:hidden;margin-top:26px;border-radius:22px;min-height:230px;
  background:#1B1F1D;color:#fff;display:flex;align-items:flex-end;
}
.po-hero-img{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;object-position:62% 40%;}
.po-hero::after{content:'';position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;
  background:linear-gradient(0deg,rgba(18,20,19,.94) 0%,rgba(18,20,19,.7) 42%,rgba(18,20,19,0) 85%);}
.po-hero-copy{position:relative;z-index:2;padding:22px 20px;}
.po-hero-copy h2{margin:0;font-family:var(--display);font-weight:800;font-size:1.6rem;line-height:1.05;text-transform:uppercase;}
.po-hero-copy p{margin:8px 0 0;font-size:.95rem;}

.po-grid{margin-top:20px;}

/* ---------- Filters ---------- */
.po-side{margin-bottom:16px;}
.po-filters{background:#fff;border-radius:26px;padding:6px 18px 20px;}
.po-filters > summary{list-style:none;}
.po-filters > summary::-webkit-details-marker{display:none;}
.po-filters-head{display:flex;align-items:center;justify-content:space-between;padding:18px 0 12px;cursor:pointer;}
.po-filters-title{display:flex;align-items:center;font-family:var(--display);font-weight:700;font-size:1.5rem;color:#16181B;}
.po-active-n{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:24px;margin-left:10px;padding:0 7px;border-radius:12px;background:var(--po-green);font-family:inherit;font-size:.78rem;font-weight:700;color:#fff;}
.po-clear{font-size:.9rem;font-weight:700;color:var(--po-green);}
.po-clear:hover{text-decoration:underline;}
.po-set{border:0;margin:20px 0 0;padding:0;min-width:0;}
.po-label{display:block;margin:0 0 12px;padding:0;font-size:1rem;font-weight:700;color:#16181B;}
.po-chips{display:flex;flex-wrap:wrap;margin:0 -3px;}
.po-chip{position:relative;display:block;margin:0 3px 7px;cursor:pointer;}
.po-chip input{position:absolute;top:0;left:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer;z-index:1;}
.po-chip span{display:block;padding:10px 11px;border-radius:13px;background:var(--po-grey);border:1px solid var(--po-line);font-size:.84rem;font-weight:500;color:#16181B;transition:background .1s;}
.po-chip:hover span{background:#E9E9E6;}
.po-chip input:checked + span{background:var(--yellow);border-color:var(--yellow);font-weight:700;}
.po-chip input:focus-visible + span{outline:2.5px solid #16181B;outline-offset:2px;}

/* budget: a two-handle slider made of plain buttons */
.po-budget-head{display:flex;justify-content:space-between;align-items:baseline;}
.po-budget-out{font-weight:700;font-size:.95rem;color:var(--po-green);}
.po-dual{position:relative;height:34px;margin:2px 12px 0;--lo:0%;--hi:100%;touch-action:pan-y;cursor:pointer;}
.po-dual-track{position:absolute;left:-12px;right:-12px;top:14px;height:6px;border-radius:3px;background:#E3E3E0;}
.po-dual-fill{position:absolute;top:14px;height:6px;left:var(--lo);right:calc(100% - var(--hi));background:var(--po-green);}
.po-thumb{
  position:absolute;top:5px;width:24px;height:24px;margin:0 0 0 -12px;padding:0;border-radius:50%;
  background:#fff;border:3px solid var(--po-green);box-sizing:border-box;box-shadow:0 1px 4px rgba(0,0,0,.25);
  cursor:grab;touch-action:none;
}
.po-thumb::before{content:'';position:absolute;top:-10px;right:-10px;bottom:-10px;left:-10px;}   /* a 44px target for fingers */
#poThumbMin{left:var(--lo);}
#poThumbMax{left:var(--hi);}
.po-thumb:focus-visible{outline:3px solid #16181B;outline-offset:2px;}
.po-dual.is-dragging .po-thumb{cursor:grabbing;}
.po-ends{display:flex;justify-content:space-between;margin-top:4px;font-size:.78rem;color:var(--po-muted);}

.po-apply{display:block;width:100%;height:58px;margin-top:26px;border-radius:16px;background:var(--yellow);font-weight:700;font-size:1.02rem;color:#16181B;text-align:center;cursor:pointer;}
.po-apply:hover{filter:brightness(.97);}
.po-apply:focus-visible{outline:2.5px solid #16181B;outline-offset:3px;}

/* ---------- Results ---------- */
.po-results-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px;}
.po-count{margin:0;font-family:var(--display);font-weight:700;font-size:1.5rem;color:#16181B;}
.po-sort{display:flex;align-items:center;height:50px;padding-left:16px;border:1px solid var(--po-line);border-radius:14px;background:#fff;}
.po-sort-label{margin:0 4px 0 0;font-size:.92rem;font-weight:500;color:#16181B;white-space:nowrap;}
.po-select{position:relative;}
.po-select select{
  display:block;height:48px;padding:0 40px 0 0;border:0;border-radius:0 14px 14px 0;background:transparent;
  font-family:inherit;font-size:.92rem;font-weight:500;color:#16181B;-webkit-appearance:none;appearance:none;cursor:pointer;
}
.po-select select:focus-visible{outline:2.5px solid #16181B;outline-offset:2px;}
.po-select::after{content:'';position:absolute;right:16px;top:50%;width:8px;height:8px;margin-top:-6px;pointer-events:none;border-right:2px solid #16181B;border-bottom:2px solid #16181B;transform:rotate(45deg);}

.po-cars{list-style:none;display:flex;flex-wrap:wrap;margin:0 -8px;padding:0;}
.po-card{flex:1 1 280px;min-width:0;margin:0 8px 16px;overflow:hidden;border-radius:26px;background:#fff;display:flex;flex-direction:column;}
.po-card-img{position:relative;height:200px;background:#DEE2E9;display:flex;align-items:center;justify-content:center;}
.po-card:nth-child(3n+2) .po-card-img{background:#D8DFE5;}
.po-card:nth-child(3n) .po-card-img{background:#E4E1D6;}
.po-card-img img{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;}
.po-ph{font-size:.9rem;color:#8A9098;}
.po-badge{position:absolute;top:14px;left:14px;z-index:1;padding:8px 16px;border-radius:999px;background:var(--yellow);font-size:.82rem;font-weight:700;color:#16181B;}
.po-card-body{padding:20px 22px 22px;flex:1 1 auto;display:flex;flex-direction:column;}
.po-card-title{margin:0;font-family:var(--display);font-weight:700;font-size:1.2rem;line-height:1.25;color:#16181B;}
.po-card-meta{margin:6px 0 0;font-size:.88rem;color:var(--po-muted);}
.po-card-foot{display:flex;align-items:flex-end;justify-content:space-between;margin-top:auto;padding-top:22px;}
.po-price{display:block;font-family:var(--display);font-weight:800;font-size:1.55rem;line-height:1.1;color:#16181B;}
.po-emi{display:block;margin-top:5px;font-size:.8rem;color:var(--po-muted);}
.po-view{flex:0 0 auto;margin-left:10px;padding:14px 22px;border-radius:16px;background:var(--yellow);font-weight:700;font-size:.92rem;color:#16181B;white-space:nowrap;}
.po-view:hover{filter:brightness(.97);}
.po-view:focus-visible{outline:2.5px solid #16181B;outline-offset:2px;}
.po-empty{padding:34px 26px;border-radius:26px;background:#fff;font-size:1rem;color:var(--po-muted);}
.po-empty p{margin:0 0 6px;}
.po-empty strong{color:#16181B;}
.po-empty a{text-decoration:underline;color:#16181B;}

.po-pages{display:flex;flex-wrap:wrap;margin:6px -4px 0;}
.po-pg{display:flex;align-items:center;justify-content:center;width:46px;height:46px;margin:0 4px 8px;border-radius:14px;background:#fff;border:1px solid var(--po-line);font-weight:700;font-size:.95rem;color:#16181B;}
a.po-pg:hover{background:#F6F6F4;}
.po-pg.is-active{background:var(--yellow);border-color:var(--yellow);}
.po-pg-gap,.po-pg.is-off{background:transparent;border-color:transparent;color:#9A9A93;}
.po-pg-arrow{font-size:1.2rem;}
a.po-pg:focus-visible{outline:2.5px solid #16181B;outline-offset:2px;}
.po-note{margin:14px 4px 0;font-size:.8rem;line-height:1.45;color:var(--po-muted);}

/* ---------- View Details window ---------- */
.po-modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:300;display:flex;align-items:center;justify-content:center;padding:16px;}
.po-backdrop{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(14,16,15,.6);}
.po-dialog{position:relative;width:100%;max-width:520px;max-height:calc(100vh - 32px);overflow-y:auto;padding:0 0 24px;border-radius:26px;background:#fff;box-shadow:0 20px 60px rgba(0,0,0,.35);}
.po-dialog:focus{outline:none;}
.po-x{position:absolute;top:12px;right:12px;z-index:3;width:40px;height:40px;border-radius:50%;background:#fff;font-size:1.5rem;line-height:1;color:#16181B;box-shadow:0 1px 6px rgba(0,0,0,.25);}
.po-dimg{position:relative;height:210px;background:#DEE2E9;display:flex;align-items:center;justify-content:center;border-radius:26px 26px 0 0;overflow:hidden;}
.po-dimg img{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;}
.po-dtitle{margin:20px 22px 0;font-family:var(--display);font-weight:700;font-size:1.4rem;line-height:1.2;color:#16181B;}
.po-dprice{display:flex;flex-wrap:wrap;align-items:baseline;margin:8px 22px 0;}
.po-dprice strong{margin-right:12px;font-family:var(--display);font-weight:800;font-size:1.6rem;color:#16181B;}
.po-dprice span{font-size:.85rem;color:var(--po-muted);}
.po-specs{margin:16px 22px 0;padding:6px 16px;border-radius:14px;background:var(--po-grey);}
.po-specs > div{display:flex;justify-content:space-between;padding:9px 0;font-size:.9rem;}
.po-specs > div + div{border-top:1px solid #E4E4E0;}
.po-specs dt{margin:0;color:var(--po-muted);}
.po-specs dd{margin:0 0 0 14px;font-weight:700;text-align:right;color:#16181B;}
#poForm{margin:0 22px;}
.po-ftitle{margin:22px 0 12px;font-family:var(--display);font-weight:700;font-size:1.1rem;color:#16181B;}
.po-field{margin-bottom:12px;}
.po-field label{display:block;margin:0 0 6px 2px;font-size:.78rem;font-weight:600;color:var(--po-muted);}
.po-opt{font-weight:400;}
.po-field input{display:block;width:100%;height:50px;padding:0 16px;border:0;border-radius:12px;background:var(--po-grey);font-family:inherit;font-size:.95rem;color:#16181B;-webkit-appearance:none;appearance:none;}
.po-field input::placeholder{color:#8F8F88;}
.po-field input:focus{outline:2.5px solid #16181B;outline-offset:2px;}
.po-field input.is-invalid{outline:2px solid #B3261E;}
.po-error{margin:6px 0 0 4px;font-size:.78rem;line-height:1.3;color:#B3261E;}
.po-error a{text-decoration:underline;}
.po-error-form{margin:6px 0 0;padding:10px 12px;background:#FBEAE8;border-radius:10px;}
.po-hp{position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden;}
.po-check{position:relative;display:flex;align-items:flex-start;margin:4px 0 4px;cursor:pointer;font-size:.84rem;line-height:1.4;color:#6B6B64;}
.po-check input{position:absolute;top:0;left:0;width:26px;height:26px;margin:0;opacity:0;cursor:pointer;}
.po-check-box{position:relative;flex:0 0 26px;width:26px;height:26px;margin-right:12px;border-radius:7px;border:2px solid #B9B9B2;background:#fff;box-sizing:border-box;}
.po-check input:checked + .po-check-box{background:var(--po-green);border-color:var(--po-green);}
.po-check input:checked + .po-check-box::after{content:'';position:absolute;left:7px;top:2px;width:7px;height:12px;border:solid #fff;border-width:0 2.5px 2.5px 0;transform:rotate(45deg);}
.po-check input:focus-visible + .po-check-box{outline:2.5px solid #16181B;outline-offset:3px;}
.po-check-text{padding-top:2px;}
.po-submit{display:block;width:100%;height:54px;line-height:54px;margin-top:14px;border-radius:14px;background:var(--yellow);font-weight:700;font-size:1rem;color:#16181B;text-align:center;cursor:pointer;}
.po-submit:hover{filter:brightness(.97);}
.po-submit[disabled]{opacity:.6;cursor:wait;}
#poDone{padding:30px 22px 0;}
#poDone .po-dtitle{margin:0 44px 8px 0;}
#poDone p{margin:0 0 12px;font-size:.98rem;line-height:1.5;color:#3A3A36;}
.po-ref strong{display:inline-block;margin-left:6px;padding:4px 10px;border-radius:8px;background:var(--yellow);font-size:1rem;letter-spacing:.04em;}

/* ============================================================
   TABLET (>=768px)
   ============================================================ */
@media (min-width:768px){
  .po-main{padding-left:32px;padding-right:32px;}
  .po-title{font-size:3rem;}
  .po-sub{font-size:1.1rem;}
  .po-hero{min-height:230px;border-radius:26px;align-items:center;}
  .po-hero-img{left:auto;right:0;width:auto;height:100%;max-width:none;object-fit:fill;
    -webkit-mask-image:linear-gradient(90deg,transparent 0,#000 26%);mask-image:linear-gradient(90deg,transparent 0,#000 26%);}
  .po-hero::after{background:linear-gradient(90deg,rgba(18,20,19,.94) 0%,rgba(18,20,19,.72) 38%,rgba(18,20,19,0) 78%);}
  .po-hero-copy{padding:34px 44px;}
  .po-hero-copy h2{font-size:2.4rem;}
  .po-hero-copy p{font-size:1.1rem;}
  .po-filters{padding:8px 26px 26px;border-radius:30px;}
  .po-card{flex:1 1 calc(50% - 16px);max-width:calc(50% - 16px);}
}

/* ============================================================
   DESKTOP (>=1024px): filters on the left, three cards across
   ============================================================ */
@media (min-width:1024px){
  body.po-page{--po-header-h:132px;}
  .po-main{padding:calc(var(--po-header-h) + 34px) 40px 80px;}
  .po-title{font-size:3.5rem;}
  .po-hero{min-height:297px;border-radius:28px;margin-top:40px;}
  .po-hero-copy{padding:40px 48px;}
  .po-hero-copy h2{font-size:3rem;max-width:620px;}
  .po-hero-copy p{font-size:1.25rem;}
  .po-grid{display:flex;align-items:flex-start;margin-top:34px;}
  .po-side{flex:0 0 22.6%;max-width:22.6%;margin:0 28px 0 0;}
  .po-filters{padding:12px 20px 26px;border-radius:30px;}
  .po-filters-head{cursor:default;}
  .po-results{flex:1 1 0;min-width:0;}
  .po-card{flex:1 1 calc(33.333% - 16px);max-width:calc(33.333% - 16px);}
  .po-card-img{height:210px;}
}
