/*
Theme Name: Ravi Mobile Gallery
Theme URI: https://example.com
Author: MobileShop
Description: Storefront for Ravi Mobile Gallery. New phones, second-hand phones, accessories and laptops, with a sell-your-phone quote engine, repair booking, EMI and offers, comparison, wishlist and price alerts, IMEI stock entry, billing and reports. No WooCommerce, no page builder.
Version: 1.6.0
Requires at least: 6.0
Requires PHP: 8.0
License: GPL v2 or later
Text Domain: ravimobile
*/

:root{
  color-scheme:light;

  /* Brand — from the identity sheet.
     #2F2B63 indigo · #E8B45C gold · #1B1A18 black · #FBFAF8 paper */
  --brand:#2F2B63;
  --brand-dark:#232052;
  --brand-soft:#5A55A0;
  --gold:#E8B45C;
  --price:#E8B45C;
  --on-gold:#22160A;   /* fixed: gold does not flip, so its text must not either */

  --ink:#1B1A18;
  --ink-2:#3B3A36;
  --mute:#6E6A63;
  --line:#E6E2DA;
  --bg:#FBFAF8;
  --bg-2:#F3F1EC;
  --card:#FFFFFF;

  /* The dark card the identity sheet shows the logo on. Header, hero,
     footer and the quote meter all sit on it, in both colour modes. */
  --deep:#1A1830;
  --deep-2:#2A2650;
  --on-deep:#EFECF7;
  --on-deep-2:#C3BEDC;
  --on-deep-3:#8F8AAF;

  --trust:#0B7548;
  --warn:#C4341C;

  /* Tinted panels. Kept as tokens so dark mode can restate them rather
     than inverting a hard-coded pastel into mud. */
  --tint-gold:#FDF4E2;
  --tint-gold-line:var(--gold);
  --tint-trust:#E7F6EF;
  --tint-trust-2:#F3FBF7;
  --tint-brand:#EEECF8;
  --tint-neutral:#F1EFEA;
  --tint-exchange:#FBF0D6;
  --tint-exchange-ink:#7A5A00;
  --shade:rgba(255,255,255,.94);
  --shadow:0 3px 14px rgba(27,26,24,.18);

  --r:10px;
  --r-lg:16px;
  --wrap:1180px;

  /* Manrope for the interface, per the sheet. The stack degrades to the
     system font, so a slow connection loses the typeface, not the page. */
  --f:"Manrope",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  --f-display:"Cormorant Garamond",Georgia,"Times New Roman",serif;
}

/* Dark mode.
   Not an inversion. The page goes to a warm near-black that sits under the
   brand's indigo, the gold stays exactly as it is because it is legible on
   both, and the indigo lifts to a lighter tint — #2F2B63 on a dark page is
   almost invisible, so using it unchanged would fail on contrast. */
:root[data-theme="dark"]{
  color-scheme:dark;

  --brand:#9B93E8;
  --brand-dark:#B7B0F2;
  --brand-soft:#7D75C9;

  --ink:#F2EFEA;
  --ink-2:#CFCAC1;
  --mute:#9C968C;
  --line:#2E2B38;
  --bg:#121118;
  --bg-2:#1B1A23;
  --card:#1B1A23;

  --deep:#0E0D16;
  --deep-2:#221F42;

  --trust:#4FC98F;
  --warn:#F08A6E;

  --tint-gold:#2E2616;
  --tint-trust:#12301F;
  --tint-trust-2:#15271E;
  --tint-brand:#211E38;
  --tint-neutral:#232129;
  --tint-exchange:#2E2616;
  --tint-exchange-ink:#E8B45C;
  --shade:rgba(18,17,24,.92);
  --shadow:0 3px 14px rgba(0,0,0,.5);
}

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;font-family:var(--f);color:var(--ink);background:var(--bg);
  font-size:15px;line-height:1.55;-webkit-font-smoothing:antialiased;
}
img{max-width:100%;height:auto;display:block}
a{color:var(--brand);text-decoration:none}
button{font:inherit}
:focus-visible{outline:3px solid var(--price);outline-offset:2px}

.wrap{max-width:var(--wrap);margin:0 auto;padding:0 16px;
  padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right))}
.stack>*+*{margin-top:12px}

/* ---------- header ---------- */
.hdr{position:sticky;top:0;z-index:50;background:var(--deep);color:#fff}
.hdr-in{display:flex;align-items:center;gap:12px;height:56px}
.logo{display:flex;align-items:center;line-height:0;flex:none}
.hdr-search{flex:1;position:relative;min-width:0}
.hdr-search input{
  width:100%;height:38px;border:0;border-radius:var(--r);
  padding:0 12px;font-size:14px;background:var(--card);color:var(--ink)
}
.hdr-ico{background:none;border:0;color:#fff;padding:6px;cursor:pointer;line-height:0}
.nav{background:var(--ink-2);overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none}
.nav::-webkit-scrollbar{display:none}
.nav ul{display:flex;gap:2px;list-style:none;margin:0;padding:0;white-space:nowrap}
.nav a{display:block;padding:11px 14px;color:var(--on-deep-2);font-size:13.5px;font-weight:600}
.nav a:hover,.nav a[aria-current]{color:#fff;box-shadow:inset 0 -3px 0 var(--price)}

/* ---------- hero ---------- */
.hero{background:linear-gradient(160deg,var(--deep) 0%,var(--deep-2) 100%);color:#fff;padding:28px 0 34px}
.hero h1{margin:0 0 6px;font-size:26px;line-height:1.2;letter-spacing:-.02em;font-weight:800}
.hero p{margin:0 0 18px;color:var(--on-deep-2);font-size:14.5px;max-width:44ch}
.quote-box{background:var(--card);border-radius:var(--r-lg);padding:14px;color:var(--ink)}
.quote-box h2{margin:0 0 4px;font-size:16px;font-weight:800}
.quote-box small{color:var(--mute);display:block;margin-bottom:12px}
.qsel{display:grid;gap:8px;grid-template-columns:1fr 1fr}
.qsel select,.qsel button{color:var(--ink);height:44px;border-radius:var(--r);border:1px solid var(--line);padding:0 10px;font-size:14px;background:var(--card);width:100%}
.qsel button{grid-column:1/-1;border:0;background:var(--price);color:var(--on-gold);font-weight:800;cursor:pointer}
.qsel button:hover{background:#D9A247}
.qsel button:disabled{opacity:.5;cursor:not-allowed}

/* ---------- sections ---------- */
.sec{padding:26px 0}
.sec-alt{background:var(--bg-2)}
.sec-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:14px}
.sec-head h2{margin:0;font-size:19px;font-weight:800;letter-spacing:-.015em}
.sec-head a{font-size:13.5px;font-weight:700}

/* ---------- product grid ---------- */
.grid{display:grid;gap:10px;grid-template-columns:repeat(2,1fr)}
@media(min-width:620px){.grid{grid-template-columns:repeat(3,1fr);gap:14px}}
@media(min-width:900px){.grid{grid-template-columns:repeat(4,1fr)}}

.card{
  background:var(--card);border:1px solid var(--line);border-radius:var(--r);
  overflow:hidden;display:flex;flex-direction:column;position:relative
}
.card-img{aspect-ratio:1;background:var(--bg-2);position:relative}
.card-img img,.card-img svg{width:100%;height:100%;object-fit:contain;padding:8px;display:block}
.card-body{padding:9px 10px 11px;display:flex;flex-direction:column;flex:1}
.card-brand{font-size:11px;color:var(--mute);font-weight:700;margin-bottom:2px}
.card-name{font-size:13.5px;font-weight:600;line-height:1.3;margin:0 0 7px;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.card-price{margin-top:auto;display:flex;align-items:baseline;gap:6px;flex-wrap:wrap}
.price{font-size:17px;font-weight:800;letter-spacing:-.02em}
.price-was{font-size:12px;color:var(--mute);text-decoration:line-through}
.price-off{font-size:11.5px;font-weight:800;color:var(--trust)}

.badge{
  position:absolute;top:7px;left:7px;z-index:2;
  font-size:10.5px;font-weight:800;padding:3px 7px;border-radius:5px;
  background:var(--ink);color:#fff
}
.badge-used{background:var(--trust)}
.badge-grade{background:var(--price);color:var(--on-gold)}

.cmp{
  position:absolute;top:5px;right:5px;z-index:2;width:28px;height:28px;
  border-radius:7px;border:1px solid var(--line);background:var(--card);
  color:var(--mute);font-size:15px;font-weight:800;cursor:pointer;line-height:1
}
.cmp[aria-pressed="true"]{background:var(--brand);color:#fff;border-color:var(--brand)}

/* ---------- single product ---------- */
.pdp{padding:16px 0 30px}
.pdp-grid{display:grid;gap:20px}
@media(min-width:860px){.pdp-grid{grid-template-columns:1.05fr 1fr;gap:34px}}
.gallery{background:var(--bg-2);border-radius:var(--r-lg);overflow:hidden}
.gallery img,.gallery svg{width:100%;height:auto;aspect-ratio:1;object-fit:contain;padding:14px;display:block}
.thumbs{display:flex;gap:7px;padding:8px;overflow-x:auto}
.thumbs img{width:54px;height:54px;border-radius:7px;border:1px solid var(--line);background:var(--card);padding:3px;cursor:pointer;flex:none}
.pdp h1{margin:0 0 8px;font-size:22px;line-height:1.25;letter-spacing:-.02em;font-weight:800}
.pdp-price{display:flex;align-items:baseline;gap:9px;margin:10px 0 14px;flex-wrap:wrap}
.pdp-price .price{font-size:27px}

.speclist{width:100%;border-collapse:collapse;font-size:14px;margin:14px 0}
.speclist th,.speclist td{text-align:left;padding:9px 0;border-bottom:1px solid var(--line);vertical-align:top}
.speclist th{color:var(--mute);font-weight:600;width:42%}

.condition{background:var(--bg-2);border-radius:var(--r);padding:12px 14px;margin:14px 0}
.condition h3{margin:0 0 8px;font-size:14px;font-weight:800}
.condition dl{margin:0;display:grid;grid-template-columns:auto 1fr;gap:5px 14px;font-size:13.5px}
.condition dt{color:var(--mute)}
.condition dd{margin:0;font-weight:600}

.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  height:48px;padding:0 20px;border-radius:var(--r);border:0;
  font-size:15px;font-weight:800;cursor:pointer;width:100%
}
.btn-wa{background:var(--trust);color:#fff}
.btn-wa:hover{background:#0B6E46}
.btn-call{background:var(--ink);color:#fff}
.btn-ghost{background:var(--card);color:var(--ink);border:1.5px solid var(--line)}
.btn-ig{background:linear-gradient(80deg,#F9A03F 0%,#E4405F 45%,#9C36B5 100%);color:#fff}
.btn-ig:hover{filter:brightness(.94)}
.btn-ig svg{flex:0 0 auto}
.btn-price{background:var(--price);color:var(--on-gold)}
.btn-row{display:grid;gap:9px;grid-template-columns:1fr 1fr;margin:16px 0}
.btn-row .btn{padding:0 10px;font-size:14px}

.trustbar{display:flex;gap:16px;flex-wrap:wrap;padding:12px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);margin:16px 0;font-size:12.5px;color:var(--ink-2)}
.trustbar b{display:block;font-size:13px}

/* ---------- sell wizard ---------- */
.wiz{max-width:620px;margin:0 auto;padding:20px 0 40px}
.wiz-bar{display:flex;gap:5px;margin-bottom:18px}
.wiz-bar i{height:4px;flex:1;border-radius:2px;background:var(--line)}
.wiz-bar i.on{background:var(--brand)}
.wiz h2{margin:0 0 4px;font-size:20px;font-weight:800;letter-spacing:-.02em}
.wiz p.sub{margin:0 0 16px;color:var(--mute);font-size:14px}
.opts{display:grid;gap:8px}
.opt{
  display:flex;align-items:center;gap:11px;padding:13px 14px;
  border:1.5px solid var(--line);border-radius:var(--r);background:var(--card);
  cursor:pointer;text-align:left;width:100%;font-size:14.5px
}
.opt:hover{border-color:var(--brand)}
.opt[aria-pressed="true"]{border-color:var(--brand);background:var(--tint-brand)}
.opt b{font-weight:700}
.opt small{display:block;color:var(--mute);font-weight:400;font-size:12.5px;margin-top:1px}
.opt-tick{margin-left:auto;color:var(--brand);font-weight:800;opacity:0}
.opt[aria-pressed="true"] .opt-tick{opacity:1}

.quote-result{background:var(--deep);color:#fff;border-radius:var(--r-lg);padding:22px;text-align:center;margin-bottom:18px}
.quote-result small{display:block;color:var(--on-deep-2);font-size:13px;margin-bottom:5px}
.quote-amt{font-size:38px;font-weight:800;color:var(--price);letter-spacing:-.03em;line-height:1.1}
.quote-note{font-size:12px;color:var(--on-deep-2);margin-top:9px;line-height:1.45}

.field{margin-bottom:12px}
.field label{display:block;font-size:13px;font-weight:700;margin-bottom:5px}
.field input,.field textarea,.field select{
  width:100%;border:1.5px solid var(--line);border-radius:var(--r);
  padding:11px 12px;font-size:15px;font-family:inherit;background:var(--card)
}
.field input:focus,.field textarea:focus{border-color:var(--brand);outline:none}
.err{color:var(--warn);font-size:12.5px;margin-top:4px}

/* ---------- compare ---------- */
.cmp-bar{
  position:fixed;left:0;right:0;bottom:0;z-index:60;background:var(--deep);color:#fff;
  padding:10px 16px;padding-bottom:calc(10px + env(safe-area-inset-bottom));
  display:none;align-items:center;gap:10px
}
.cmp-bar.on{display:flex}
.cmp-bar .n{background:var(--price);color:var(--on-gold);font-weight:800;border-radius:20px;padding:2px 9px;font-size:12.5px}
.cmp-bar button{margin-left:auto;background:var(--price);color:var(--on-gold);border:0;border-radius:var(--r);padding:9px 16px;font-weight:800;cursor:pointer}
.cmp-bar a.clear{color:var(--on-deep-2);font-size:13px}

.cmp-table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;margin:0 -16px;padding:0 16px}
.cmp-table{border-collapse:collapse;font-size:13.5px;min-width:100%}
.cmp-table th,.cmp-table td{border:1px solid var(--line);padding:10px;text-align:left;min-width:150px;vertical-align:top}
.cmp-table thead th{background:var(--bg-2);font-weight:800}
.cmp-table th:first-child,.cmp-table td:first-child{
  position:sticky;left:0;background:var(--card);z-index:1;color:var(--mute);font-weight:600;min-width:112px
}
.cmp-table thead th:first-child{background:var(--bg-2)}

/* ---------- misc ---------- */
.empty{text-align:center;padding:50px 16px;color:var(--mute)}
.empty b{display:block;color:var(--ink);font-size:16px;margin-bottom:5px}
.notice{background:var(--tint-gold);border:1px solid var(--tint-gold-line);border-radius:var(--r);padding:12px 14px;font-size:13.5px;margin:14px 0}
.filters{display:flex;gap:8px;overflow-x:auto;padding:12px 0;scrollbar-width:none}
.filters::-webkit-scrollbar{display:none}
.chip{
  flex:none;border:1.5px solid var(--line);background:var(--card);border-radius:20px;
  padding:7px 14px;font-size:13px;font-weight:600;cursor:pointer;color:var(--ink-2)
}
.chip[aria-pressed="true"]{background:var(--ink);color:#fff;border-color:var(--ink)}

.ftr{background:var(--deep);color:var(--on-deep-2);padding:26px 0;margin-top:30px;font-size:13.5px}
.ftr h4{color:#fff;margin:0 0 8px;font-size:14px}
.ftr a{color:var(--on-deep-2);display:block;padding:3px 0}
.ftr-grid{display:grid;gap:20px;grid-template-columns:1fr 1fr}
@media(min-width:700px){.ftr-grid{grid-template-columns:repeat(4,1fr)}}
.ftr-addr{font-style:normal;margin:0 0 8px;line-height:1.7}
.ftr-social{display:inline-flex!important;align-items:center;gap:7px;margin-top:8px;
  padding:7px 12px!important;border-radius:999px;background:var(--deep-2);color:#fff!important;font-weight:700}
.ftr-social:hover{background:var(--brand-soft)}
.ftr-btm{border-top:1px solid var(--deep-2);margin-top:20px;padding-top:14px;font-size:12.5px}

.wa-float{
  position:fixed;right:calc(14px + env(safe-area-inset-right));
  bottom:calc(14px + env(safe-area-inset-bottom));z-index:55;width:52px;height:52px;border-radius:50%;
  background:var(--trust);color:#fff;display:flex;align-items:center;justify-content:center;
  box-shadow:var(--shadow)
}
body.has-cmp .wa-float{bottom:74px}

@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* ==========================================================
   Inspection explainer (sell wizard)
   ========================================================== */
.inspect{background:var(--bg-2);border-radius:var(--r);padding:14px 16px;margin-bottom:16px}
.inspect b{display:block;font-size:14px;font-weight:800;margin-bottom:8px}
.inspect ol{margin:0;padding-left:18px;font-size:13.5px;color:var(--ink-2)}
.inspect li{margin-bottom:5px;line-height:1.45}
.inspect li:last-child{margin-bottom:0}

/* ==========================================================
   RESPONSIVE
   Covers: Flip cover screens, Fold cover screens, ordinary
   phones, Flip unfolded (tall + narrow), Fold unfolded
   (wide + short), tablets, desktop.
   Base styles above are written mobile-first.
   ========================================================== */

/* --- Very narrow: Fold cover screen, older small phones (≤340px) --- */
@media (max-width:340px){
  body{font-size:14px}
  .wrap{padding:0 10px}
  .grid{grid-template-columns:repeat(2,1fr);gap:7px}
  .card-name{font-size:12.5px}
  .price{font-size:15px}
  .hero{padding:18px 0 22px}
  .hero h1{font-size:21px}
  .nav a{padding:10px 10px;font-size:12.5px}
  .btn-row{grid-template-columns:1fr}
  .qsel{grid-template-columns:1fr}
  .pdp h1{font-size:19px}
  .pdp-price .price{font-size:23px}
  .quote-amt{font-size:27px}
}

/* --- Galaxy Z Flip unfolded: narrow but very tall (~344 x 882) ---
   Extra vertical room, so give the wizard and hero more air and keep
   two product columns rather than collapsing to one. */
@media (min-width:341px) and (max-width:400px) and (min-height:750px){
  .hero{padding:32px 0 34px}
  .wiz{padding:26px 0 44px}
  .opt{padding:15px 14px}
  .grid{gap:9px}
}

/* --- Galaxy Fold unfolded / small tablet portrait (~717-820px) ---
   Often short in landscape, so trim vertical padding and widen the grid. */
@media (min-width:620px) and (max-width:819px){
  .grid{grid-template-columns:repeat(3,1fr)}
  .hero h1{font-size:30px}
  .hero p{font-size:15.5px}
  .qsel{grid-template-columns:1fr 1fr auto}
  .qsel button{grid-column:auto;padding:0 22px}
  .btn-row{max-width:430px}
}

/* --- Short viewports: Fold open in landscape, phones in landscape --- */
@media (max-height:520px) and (orientation:landscape){
  .hdr{position:static}
  .hero{padding:16px 0 18px}
  .hero h1{font-size:22px;margin-bottom:4px}
  .hero p{margin-bottom:12px;font-size:13.5px}
  .sec{padding:18px 0}
  .wiz{padding:14px 0 26px}
}

/* --- Foldable hinge awareness ---
   When the browser reports two viewport segments the device is open
   across a hinge. Keep content out of the seam. */
@media (horizontal-viewport-segments:2){
  .wrap{padding-left:26px;padding-right:26px}
  .pdp-grid{gap:44px}
  .grid{gap:18px}
}
@media (vertical-viewport-segments:2){
  .cmp-bar{padding-bottom:16px}
  .wiz{padding-bottom:56px}
}

/* --- Tablet portrait (820-1023px) --- */
@media (min-width:820px) and (max-width:1023px){
  body{font-size:15.5px}
  .grid{grid-template-columns:repeat(3,1fr);gap:16px}
  .hero{padding:40px 0 44px}
  .hero h1{font-size:34px}
  .hero p{font-size:16px;margin-bottom:22px}
  .quote-box{max-width:560px}
  .qsel{grid-template-columns:1fr 1fr auto}
  .qsel button{grid-column:auto;padding:0 26px}
  .sec{padding:34px 0}
  .sec-head h2{font-size:22px}
  .pdp-grid{grid-template-columns:1fr 1fr;gap:30px}
  .btn-row{max-width:460px}
  .wiz{max-width:640px}
}

/* --- Desktop (1024px+) --- */
@media (min-width:1024px){
  body{font-size:16px;line-height:1.6}
  .hdr-in{height:64px;gap:18px}
  .hdr-search{max-width:460px}
  .hdr-search input{height:42px}
  .nav a{padding:13px 16px;font-size:14px}

  .hero{padding:52px 0 56px}
  .hero h1{font-size:40px;line-height:1.12}
  .hero p{font-size:17px;margin-bottom:26px}
  .quote-box{max-width:600px;padding:18px}
  .quote-box h2{font-size:18px}
  .qsel{grid-template-columns:1fr 1fr auto}
  .qsel select,.qsel button{height:48px}
  .qsel button{grid-column:auto;padding:0 30px}

  .sec{padding:44px 0}
  .sec-head h2{font-size:24px}
  .grid{grid-template-columns:repeat(4,1fr);gap:18px}
  .card-name{font-size:15px}
  .price{font-size:19px}

  .pdp{padding:28px 0 52px}
  .pdp-grid{grid-template-columns:1.05fr 1fr;gap:48px}
  .pdp h1{font-size:30px}
  .pdp-price .price{font-size:34px}
  .btn-row{max-width:480px}
  .btn{height:52px}

  .wiz{max-width:680px;padding:34px 0 60px}
  .wiz h2{font-size:26px}
  .opt{padding:16px 18px;font-size:15.5px}
  .quote-amt{font-size:48px}

  .wa-float{right:24px;bottom:24px;width:58px;height:58px}
  body.has-cmp .wa-float{bottom:86px}
  .cmp-bar{padding:12px 24px}
}

/* --- Wide desktop --- */
@media (min-width:1400px){
  :root{--wrap:1320px}
  .grid{grid-template-columns:repeat(5,1fr)}
}

/* --- Pointer devices: hover only where it means something --- */
@media (hover:hover){
  .card:hover{border-color:var(--brand-dark)}
  .card-name a:hover{color:var(--brand)}
}

/* --- Touch: bigger tap targets, no hover lag --- */
@media (hover:none){
  .chip,.opt,.btn{min-height:44px}
  .cmp{width:32px;height:32px}
}

/* ================================================================
   EMI, offers, wishlist, alerts and repair — added in v1.1
   ================================================================ */

/* ---------- EMI block ---------- */
.emi{border:1px solid var(--line);border-radius:var(--r);padding:12px 14px;margin:14px 0}
.emi-head{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.emi-from{font-size:14px;color:var(--ink-2)}
.emi-from b{color:var(--ink);font-size:15.5px}
.emi-badge{background:var(--tint-trust);color:var(--trust);font-size:11.5px;font-weight:800;
  padding:3px 8px;border-radius:20px;letter-spacing:.01em}
.emi details{margin-top:8px}
.emi summary{cursor:pointer;color:var(--brand);font-size:13.5px;font-weight:700;
  list-style:none;padding:4px 0}
.emi summary::-webkit-details-marker{display:none}
.emi summary::after{content:" ↓";font-size:12px}
.emi details[open] summary::after{content:" ↑"}
.emi-down{font-size:13px;color:var(--ink-2);margin:8px 0 0}
.emi-table{width:100%;border-collapse:collapse;font-size:13px;margin-top:10px}
.emi-table th,.emi-table td{border-bottom:1px solid var(--line);padding:8px 6px;text-align:left}
.emi-table thead th{font-size:11.5px;text-transform:uppercase;letter-spacing:.04em;color:var(--mute);font-weight:700}
.emi-table tr.is-nocost{background:var(--tint-trust-2)}
.emi-table small{color:var(--mute)}
.emi-zero{color:var(--trust);font-weight:700}
.emi-note{font-size:12px;color:var(--mute);line-height:1.5;margin:10px 0 0}

/* ---------- offers ---------- */
.offers{background:var(--bg-2);border-radius:var(--r);padding:13px 15px;margin:14px 0}
.offers h3{margin:0 0 9px;font-size:14px;font-weight:800}
.offers ul{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.offers li{font-size:13.5px;line-height:1.45}
.offers li b{display:block;font-weight:700}
.offers li small{display:block;color:var(--mute);font-size:12.5px}
.offers code{background:var(--card);border:1px dashed var(--line);border-radius:5px;padding:1px 6px;font-size:12px}
.offer-tag{display:inline-block;font-size:10.5px;font-weight:800;text-transform:uppercase;
  letter-spacing:.04em;padding:2px 7px;border-radius:4px;margin-bottom:3px}
.offer-bank{background:var(--tint-brand);color:var(--brand-dark)}
.offer-cashback{background:var(--tint-trust);color:var(--trust)}
.offer-exchange{background:var(--tint-exchange);color:var(--tint-exchange-ink)}
.offer-shop{background:var(--tint-neutral);color:var(--ink-2)}
.offers-note{font-size:11.5px;color:var(--mute);margin:10px 0 0}

/* ---------- wishlist ---------- */
.card{position:relative}
.wish{
  position:absolute;top:8px;right:8px;z-index:3;width:32px;height:32px;padding:0;
  display:grid;place-items:center;border:1px solid var(--line);border-radius:50%;
  background:var(--shade);color:var(--mute);cursor:pointer;line-height:0;
}
[data-wish] svg{fill:none;stroke:currentColor;stroke-width:2;stroke-linejoin:round}
[data-wish]:hover{color:var(--warn);border-color:var(--warn)}
[data-wish].on{color:var(--warn);border-color:var(--warn)}
[data-wish].on svg{fill:currentColor}
.card .cmp{right:46px}

.pdp-actions{display:flex;gap:9px;margin-bottom:6px;flex-wrap:wrap}
.pdp-actions .btn{flex:1;min-width:150px}
.wish-btn{position:static;width:auto;height:44px;border-radius:var(--r);
  display:inline-flex;align-items:center;justify-content:center;gap:8px;background:none}
.wish-btn::after{content:"Save for later"}
.wish-btn.on::after{content:"Saved"}

.hdr-wish{position:relative;display:inline-flex;align-items:center;gap:3px}
.hdr-wish span{font-size:11.5px;font-weight:800;color:var(--price)}
.card-emi{font-size:11.5px;color:var(--mute);margin-top:3px}
.wl-note{font-size:13px;color:var(--mute);margin:0 0 14px}
.badge-sold{background:var(--mute);color:#fff}

/* ---------- alerts ---------- */
.alertbox{border:1px solid var(--line);border-radius:var(--r);padding:14px;margin-top:18px}
.alertbox h3{margin:0 0 4px;font-size:14px;font-weight:800}
.alertbox-sub{margin:0 0 12px;font-size:12.5px;color:var(--mute);line-height:1.5}
.sold-note{background:var(--tint-gold);border:1px solid var(--tint-gold-line);border-radius:var(--r);
  padding:11px 13px;font-size:13.5px;margin:14px 0 0;line-height:1.5}

/* ---------- repair ---------- */
.opt-price{margin-left:auto;padding-left:10px;font-size:12.5px;font-weight:700;
  color:var(--ink-2);white-space:nowrap;text-align:right}
.opt[aria-pressed="true"] .opt-price{color:var(--brand)}
.rp-total{background:var(--bg-2);border-radius:var(--r);padding:11px 13px;
  font-size:13px;margin:14px 0;line-height:1.5}
.repair-nudge{
  display:flex;align-items:center;gap:16px;flex-wrap:wrap;justify-content:space-between;
  background:var(--bg-2);border-radius:var(--r-lg);padding:16px 18px;margin-top:30px
}
.repair-nudge b{display:block;font-size:15px}
.repair-nudge span{font-size:13.5px;color:var(--ink-2)}
.repair-nudge .btn{max-width:210px;margin:0}

@media (min-width:720px){
  .emi-from{font-size:15px}
  .repair-nudge{padding:20px 24px}
}

/* ================================================================
   Trade-in wizard and quote pages — added in v1.2
   ================================================================ */

/* The quote meter. This is the one element that should hold attention:
   it stays put, it moves as you answer, and it says why it moved. */
.qmeter{
  position:sticky;top:56px;z-index:30;margin:0 -16px 18px;
  background:var(--deep);color:var(--on-deep);padding:14px 16px 12px;
}
.qmeter-label{margin:0 0 2px;font-size:12px;color:var(--on-deep-3)}
.qmeter-row{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.qmeter-amt{
  font-size:34px;font-weight:800;color:var(--price);letter-spacing:-.03em;line-height:1.05;
  font-variant-numeric:tabular-nums;font-feature-settings:"tnum" 1;
}
.qmeter-amt.is-range{font-size:23px;letter-spacing:-.02em}
.qmeter-sub{margin:5px 0 0;font-size:12.5px;color:var(--on-deep-3)}
.qmeter-delta{
  font-size:12.5px;font-weight:700;padding:3px 9px;border-radius:20px;white-space:nowrap;
  background:rgba(196,52,28,.22);color:#FFC2AF;
  opacity:0;transform:translateY(-3px);transition:opacity .25s,transform .25s;
}
.qmeter-delta.on{opacity:1;transform:none}
.qmeter-delta.up{background:rgba(14,143,92,.26);color:#8FE3BC}

.wiz-step{margin:0 0 2px;font-size:12.5px;color:var(--mute)}
.wiz-q{margin:18px 0 2px;font-size:15.5px;font-weight:700}
.wiz-back{background:none;border:0;color:var(--mute);font-size:13.5px;padding:6px 0;
  cursor:pointer;display:block}

.opts-grid{grid-template-columns:1fr 1fr}
.opts-grid .opt{padding:12px;min-height:48px}
.opts-grid .opt b{font-size:13.5px}
.opts-grid .opt-tick{margin-left:6px}

.numbox{background:var(--bg-2);border-radius:var(--r);padding:16px}
.numbox input{
  width:100%;font:inherit;font-size:30px;font-weight:800;text-align:center;
  border:0;background:none;color:var(--ink);padding:6px 0;
  font-variant-numeric:tabular-nums;
}
.numbox input:focus{outline:none}
.numband{text-align:center;font-size:13px;color:var(--mute);margin:6px 0 0}

.pin-ok{color:var(--trust);font-weight:700;font-size:13.5px;margin:4px 0 0}

/* The working. Every line here must add up to the total — a breakdown whose
   arithmetic does not close is worse than showing none. */
.working{background:var(--bg-2);border-radius:var(--r);padding:4px 16px;margin:16px 0}
.working h2{font-size:13.5px;font-weight:800;margin:14px 0 6px}
.wl{display:flex;justify-content:space-between;gap:14px;padding:8px 0;font-size:14px;
  border-bottom:1px solid var(--line)}
.wl:last-of-type{border-bottom:0}
.wl span{color:var(--ink-2);flex:1}
.wl b{font-weight:700;white-space:nowrap;font-variant-numeric:tabular-nums}
.wl.neg b{color:var(--warn)}
.wl.pos b{color:var(--trust)}
.wl.total{border-top:2px solid var(--line);border-bottom:0;margin-top:4px;
  padding-top:11px;padding-bottom:14px}
.wl.total span,.wl.total b{color:var(--ink);font-weight:800;font-size:16px}

.halt{background:var(--tint-gold);border:1px solid var(--tint-gold-line);border-left:4px solid var(--warn);
  border-radius:var(--r);padding:16px 18px;margin-bottom:14px}
.halt h2{margin:0 0 8px;font-size:17px;font-weight:800}
.halt p{margin:0 0 10px;font-size:14px;color:var(--ink-2);line-height:1.55}

/* Shared quote page — /quote/TQ-XXXXXX/ */
.quote-card{background:var(--deep);color:#fff;border-radius:var(--r-lg);
  padding:26px 22px;text-align:center;margin:20px 0}
.quote-ref{margin:0;font-size:12.5px;color:var(--on-deep-3);letter-spacing:.06em}
.quote-for{margin:6px 0 0;font-size:14px;color:var(--on-deep-2)}
.quote-big{margin:6px 0 4px;font-size:44px;font-weight:800;color:var(--price);
  letter-spacing:-.03em;line-height:1;font-variant-numeric:tabular-nums}
.quote-exp{margin:6px 0 0;font-size:13px;color:var(--on-deep-3)}
.quote-exp.is-expired{color:#FFC2AF}

@media (min-width:720px){
  .qmeter{margin-left:0;margin-right:0;border-radius:0 0 var(--r) var(--r)}
  .qmeter-amt{font-size:40px}
}
@media (prefers-reduced-motion: reduce){
  .qmeter-delta{transition:none}
}


/* ================================================================
   Identity — logo, colour switch, brand type (v1.3)
   ================================================================ */

/* Clear space, as the identity sheet specifies it: free space equal to the
   mark's width on every side. The mark is 46.5 of the lockup's 275 units, so
   at a 34px lockup that is about 22px. */
.logo{padding-right:8px}
.logo-lockup{height:34px;width:auto;display:block}
.logo-mark{display:none;flex:none}

/* Both lockups are in the DOM so the switch works without a reload. */
:where(:root[data-theme="light"]) .logo-lockup.is-dark,
:where(:root[data-theme="dark"])  .logo-lockup.is-light{display:none}

/* The sheet sets a 120px minimum for the lockup; below that, the mark alone.
   The header is dark in both colour modes, so the dark lockup is the one that
   belongs there. */
.hdr .logo-lockup.is-light{display:none}
.hdr .logo-lockup.is-dark{display:block}

@media (max-width:420px){
  /* Both halves named explicitly: ".hdr .logo-lockup" alone scores lower than
     the ".hdr .logo-lockup.is-dark" rule above and would never take effect. */
  .hdr .logo-lockup.is-light,
  .hdr .logo-lockup.is-dark,
  .hdr .logo-lockup{display:none}
  .hdr .logo-mark{display:block}
  .logo{padding-right:2px}
}

.ftr-brand{margin-bottom:12px}
.ftr-brand .logo-lockup{height:32px}
.ftr-brand .logo-lockup.is-light{display:none}
.ftr-brand .logo-lockup.is-dark{display:block}

/* Colour switch. One button, three states; the icon shows what you would get
   by tapping, not what you already have. */
.ms-theme{position:relative;display:inline-flex;align-items:center;justify-content:center}
.ms-theme span{display:none;line-height:0}
.ms-theme .ms-theme-sun{display:block}   /* shown before JS sets data-mode */
.ms-theme[data-mode="light"] .ms-theme-moon{display:block}
.ms-theme[data-mode="dark"]  .ms-theme-sun{display:block}
.ms-theme[data-mode="system"] .ms-theme-sun{display:block;opacity:.62}
.ms-theme[data-mode="system"]::after{
  content:"";position:absolute;right:3px;bottom:3px;width:5px;height:5px;
  border-radius:50%;background:var(--gold)
}

/* Brand typography. Cormorant Garamond is for the name and for headings that
   carry it; everything functional stays in Manrope, which is what the sheet
   asks for. */
.has-brand-fonts h1,
.has-brand-fonts .hero h1,
.has-brand-fonts .sec-h h2{font-family:var(--f-display);font-weight:600;letter-spacing:0}
.has-brand-fonts .hero h1{font-size:clamp(28px,7vw,44px);line-height:1.1}

/* Money is never set in the display serif — figures need to line up. */
.price,.qmeter-amt,.quote-amt,.quote-big,.wl b{font-family:var(--f)}

/* Dark mode touch-ups for surfaces that were designed on white. */
:root[data-theme="dark"] .shot{filter:brightness(.94)}
:root[data-theme="dark"] .btn-ig{filter:saturate(.9)}
:root[data-theme="dark"] .numbox input{color:var(--ink)}

/* Printed paperwork is always light, whatever the screen is set to. */
@media print{
  :root[data-theme="dark"]{
    color-scheme:light;
    --bg:#FFFFFF;--bg-2:#FFFFFF;--card:#FFFFFF;--ink:#1B1A18;--ink-2:#3B3A36;
    --mute:#6E6A63;--line:#DDD8CF;--brand:#2F2B63;--deep:#1A1830;
  }
  .hdr,.ftr,.ms-theme,.cmp-bar{display:none!important}
}

/* Explanatory small print under the offer, the quote page and the repair
   page. Referenced from three places since v1.2 and never actually styled,
   so it was rendering as full-size body text. */
.note{font-size:12.5px;color:var(--mute);line-height:1.55;margin:12px 0 0;max-width:62ch}

.screen-reader-text{position:absolute;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* ================================================================
   Home page — 3D scene, illustration, motion (v1.4)

   One orchestrated moment on load and one thing that reacts to the
   pointer. Everything else on the page stays still: motion scattered
   over every section is noise, and on a mid-range Android it is also
   dropped frames.
   ================================================================ */

.hero{position:relative;overflow:hidden}

/* Illustration: two soft lights and a faint grid, drawn in CSS so there is
   no image to download and nothing to go wrong on a slow connection. */
.hero-glow{position:absolute;inset:-30% -10% auto -10%;height:150%;pointer-events:none;
  background:
    radial-gradient(38% 46% at 78% 32%,rgba(232,180,92,.30),transparent 68%),
    radial-gradient(44% 52% at 14% 12%,rgba(123,112,214,.34),transparent 70%);
}
.hero::after{content:"";position:absolute;inset:0;pointer-events:none;opacity:.30;
  background-image:linear-gradient(rgba(255,255,255,.055) 1px,transparent 1px),
                   linear-gradient(90deg,rgba(255,255,255,.055) 1px,transparent 1px);
  background-size:38px 38px;
  -webkit-mask-image:radial-gradient(70% 62% at 50% 34%,#000 25%,transparent 78%);
          mask-image:radial-gradient(70% 62% at 50% 34%,#000 25%,transparent 78%);
}
.hero-in{position:relative;z-index:1}

.hero-points{list-style:none;margin:16px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.hero-points li{font-size:12.5px;font-weight:600;color:var(--on-deep);
  background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.16);
  border-radius:999px;padding:6px 12px}

/* ---------- the 3D handset ---------- */
.hero-art{display:none}
.scene{position:relative;perspective:1100px;perspective-origin:60% 40%;
  display:grid;place-items:center;min-height:430px}

.phone3d{
  position:relative;width:216px;height:432px;transform-style:preserve-3d;
  /* Set by the pointer handler; the animation adds a slow drift on top. */
  --rx:0deg; --ry:-19deg;
  transform:rotateX(var(--rx)) rotateY(var(--ry));
  animation:float 7s ease-in-out infinite;
}
@keyframes float{
  0%,100%{transform:rotateX(calc(var(--rx) + 1deg)) rotateY(var(--ry)) translateY(0)}
  50%    {transform:rotateX(calc(var(--rx) - 1deg)) rotateY(calc(var(--ry) + 2deg)) translateY(-12px)}
}

.p-body{position:absolute;inset:0;border-radius:30px;background:linear-gradient(150deg,#3A3570,#1A1830);
  box-shadow:0 40px 70px -28px rgba(0,0,0,.75),0 0 0 1px rgba(255,255,255,.09) inset;
  transform:translateZ(9px)}
/* The slab's edge, which is what actually sells the depth. */
.p-side{position:absolute;inset:0;border-radius:30px;background:#12101F;transform:translateZ(-9px)}
.p-glow{position:absolute;inset:16% -22% -14% -22%;border-radius:50%;filter:blur(30px);
  background:radial-gradient(closest-side,rgba(232,180,92,.42),transparent 72%);
  transform:translateZ(-40px)}

.p-screen{position:absolute;inset:9px;border-radius:23px;overflow:hidden;
  background:linear-gradient(170deg,#221E44 0%,#14121F 62%);padding:30px 16px 16px;
  display:flex;flex-direction:column;gap:12px}
.p-cam{position:absolute;top:12px;left:50%;transform:translateX(-50%);
  width:9px;height:9px;border-radius:50%;background:#0A0912;box-shadow:0 0 0 2px rgba(255,255,255,.07)}

.p-meter small{display:block;font-size:10px;color:var(--on-deep-3);margin-bottom:2px}
.p-meter b{display:block;font-size:30px;font-weight:800;color:var(--gold);letter-spacing:-.03em;
  font-variant-numeric:tabular-nums;line-height:1}
.p-delta{display:inline-block;margin-top:7px;font-size:9.5px;font-weight:600;
  background:rgba(196,52,28,.24);color:#F0B4A2;border-radius:999px;padding:3px 8px}

.p-rows{display:grid;gap:7px;margin-top:2px}
.p-rows i{height:9px;width:var(--w);border-radius:5px;background:rgba(255,255,255,.13)}

.p-btn{margin-top:auto;text-align:center;font-size:11px;font-weight:800;color:#22160A;
  background:var(--gold);border-radius:9px;padding:9px}

/* Chips orbit the handset in front of and behind it, which is what makes the
   scene read as 3D rather than as a photo pasted on a gradient. */
.hchip{position:absolute;font-size:11.5px;font-weight:700;white-space:nowrap;
  background:#FBFAF8;color:#2F2B63;border-radius:999px;
  padding:7px 13px;box-shadow:0 10px 24px -10px rgba(0,0,0,.6);
  animation:float 7s ease-in-out infinite}
.hchip-1{top:12%;left:2%;animation-delay:-1.2s}
.hchip-2{top:46%;right:0;animation-delay:-3.4s}
.hchip-3{bottom:12%;left:8%;animation-delay:-5.1s}

/* ---------- entrance ---------- */
.rise{opacity:0;transform:translateY(14px);animation:rise .55s cubic-bezier(.2,.7,.3,1) forwards;
  animation-delay:var(--d,0ms)}
@keyframes rise{to{opacity:1;transform:none}}

/* Sections fade in once, as they are reached. JS adds .in. */
.reveal{opacity:0;transform:translateY(16px);
  transition:opacity .5s ease,transform .5s cubic-bezier(.2,.7,.3,1)}
.reveal.in{opacity:1;transform:none}

@media (prefers-reduced-motion: reduce){
  .rise,.hchip,.phone3d{animation:none}
  .rise{opacity:1;transform:none}
  .reveal{opacity:1;transform:none;transition:none}
  .phone3d{transform:rotateY(-14deg)}
}

/* ================================================================
   Layout for the new pieces across every screen (v1.4)

   Written against real device widths rather than round numbers:
   280 Fold cover · 344 Flip open · 360-430 phones · 540 Flip cover
   717 Fold open · 768-1024 tablets · 1280+ desktop
   ================================================================ */

/* The footer map. Tall and thin on a phone, wide and short on a desktop,
   because a map is only useful if you can see the streets around the pin. */
.ftr-map{position:relative;margin-top:22px;border-radius:var(--r-lg);overflow:hidden;
  background:var(--deep-2);min-height:200px}
.ftr-map iframe{display:block;width:100%;height:230px;border:0;filter:saturate(.9)}
:root[data-theme="dark"] .ftr-map iframe{filter:saturate(.75) brightness(.86)}
.ftr-map-card{padding:14px 16px 16px;display:grid;gap:4px;background:var(--deep-2)}
.ftr-map-card b{color:#fff;font-size:14.5px}
.ftr-map-card span{color:var(--on-deep-2);font-size:12.5px;line-height:1.45}
.ftr-map-card .btn{margin-top:8px}

/* --- 280-360px: Fold cover screen and the smallest phones still in use --- */
@media (max-width:360px){
  .hero-points li{font-size:11.5px;padding:5px 10px}
  .ftr-map iframe{height:190px}
  .opts-grid{grid-template-columns:1fr}
  .qmeter-amt{font-size:29px}
  .qmeter-amt.is-range{font-size:19px}
  .wl{font-size:13px}
  .wl span{min-width:0;overflow-wrap:anywhere}
}

/* Nothing may push the page sideways. On a 280px cover screen a single
   over-wide element turns the whole site into a horizontal scroll.

   `clip` rather than `hidden`, and on body alone: overflow-x:hidden on an
   ancestor creates a scroll container, which silently kills position:sticky —
   and the header and the quote meter both depend on it. */
body{overflow-x:clip}
img,svg,iframe,video{max-width:100%}
.wl span,.card-name,.opt b{overflow-wrap:anywhere}

/* --- Flip cover screen: wide, very short (roughly 540 x 400) --- */
@media (min-width:430px) and (max-height:440px) and (orientation:landscape){
  .hero{padding:14px 0 16px}
  .hero-points{display:none}
  .qmeter{position:static}
  .ftr-map iframe{height:150px}
}

/* --- Fold open / tablet portrait: room for the scene beside the copy --- */
@media (min-width:720px){
  .ftr-map{display:grid;grid-template-columns:1.6fr 1fr;align-items:stretch}
  .ftr-map iframe{height:100%;min-height:240px}
  .ftr-map-card{align-content:center}
}

@media (min-width:900px){
  .hero{padding:44px 0 50px}
  .hero-in{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);
    gap:38px;align-items:center}
  .hero-art{display:block}
  .hero-copy{max-width:560px}
  .quote-box{max-width:470px}
}

@media (min-width:1024px){
  .hero-in{gap:56px}
  .phone3d{width:236px;height:472px}
  .scene{min-height:500px}
}

@media (min-width:1400px){
  .hero{padding:58px 0 64px}
  .phone3d{width:252px;height:504px}
  .scene{min-height:540px}
  .hchip{font-size:12.5px}
}

/* A pointer that can hover gets the tilt; a touch screen does not, because
   there is nothing to hover with and the handler would only cost battery. */
@media (hover:none){
  .scene{pointer-events:none}
}

/* Desktop lockup, declared after the base rule so it actually applies. */
@media (min-width:1024px){
  .hdr .logo-lockup{height:38px}
}
