/* Creddo — вітрина v2 (24.11.2026). Стилі поверх оригінального блоку офера (components/offer_block.php). */
:root{
  --ground:#F2F4F0;
  --ink:#0D1512;
  --ink2:#3F4A45;
  --muted:#5A645F;
  --line:#E3E7E1;
  --card:#FFFFFF;
  --cta:#1FCB63;
  --cta-ink:#06210F;
  --ok:#12A150;
}

*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{
  font-family:'Manrope',system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  color:var(--ink);
  background:var(--ground);
  line-height:1.4;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
img{max-width:100%}
button{font-family:inherit}
[hidden]{display:none!important}
a:focus-visible,button:focus-visible{outline:3px solid #2F6BFF;outline-offset:2px}

.cw-page{min-height:100vh;display:flex;flex-direction:column}
.cw-wrap{width:100%;max-width:1120px;margin:0 auto;padding-left:16px;padding-right:16px}

/* ---------- шапка ---------- */
.cw-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-top:12px;padding-bottom:12px}
.cw-logo{display:flex;align-items:center;gap:8px;color:var(--ink);text-decoration:none}
.cw-logo-mark{width:32px;height:32px;border-radius:10px;background:var(--ink);color:var(--cta);display:flex;align-items:center;justify-content:center;font-weight:800;font-size:19px;line-height:1}
.cw-logo-word{font-weight:800;font-size:20px;letter-spacing:-.02em}
.cw-free{display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 10px;border-radius:999px;background:#E1F3E7;color:#0B5A2E;font-size:12.5px;font-weight:700;white-space:nowrap}
.cw-free svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}

/* ---------- перший екран ---------- */
.cw-hero{display:flex;flex-direction:column;gap:14px;padding-top:8px}
.cw-hero h1{font-size:clamp(27px,4vw,44px);line-height:1.12;letter-spacing:-.03em;font-weight:800;text-wrap:balance}
.cw-tracker{display:flex;flex-direction:column;gap:8px;max-width:560px}
.cw-tracker p{font-size:15px;line-height:1.4;color:var(--ink2);text-wrap:pretty}
.cw-segs{display:flex;gap:6px}
.cw-segs span{flex:1;height:6px;border-radius:3px;background:#D5DAD3;transition:background .3s}
.cw-segs span.on{background:var(--ok)}
.cw-amount{display:flex;flex-direction:column;gap:8px;max-width:420px}
.cw-amount-label{font-size:13px;font-weight:700;color:var(--ink2)}
.cw-chips{display:flex;gap:8px}
.cw-chip{flex:1 1 0;min-width:0;height:44px;border-radius:12px;border:1px solid #D5DAD3;background:#FFFFFF;color:var(--ink);font-size:15px;font-weight:700;cursor:pointer;-webkit-tap-highlight-color:transparent}
.cw-chip[aria-pressed="true"]{background:var(--ink);border-color:var(--ink);color:#FFFFFF}
.cw-chip:active{transform:scale(.98)}

/* ---------- список оферів ---------- */
.cw-offers{display:flex;flex-direction:column;gap:10px;padding-top:20px}
.cw-list-head{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.cw-list-head h2{font-size:15px;font-weight:800;letter-spacing:-.01em}
.cw-list-head span{font-size:12px;color:var(--muted);white-space:nowrap}

#offers{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(330px,100%),1fr));gap:10px;align-items:start;position:relative}
#offers:empty::before,#offers:empty::after{content:"";display:block;border-radius:20px;background:#E3E7E1;animation:cwPulse 1.2s ease-in-out infinite}
#offers:empty::before{height:226px;border-radius:22px}
#offers:empty::after{height:176px}
#offers>p{grid-column:1/-1;font-size:15px;color:var(--ink2);padding:12px 0}

.offer{
  position:relative;min-width:0;cursor:pointer;
  background:var(--card);border:1px solid var(--line);border-radius:20px;padding:14px;
  display:grid;grid-template-columns:112px minmax(0,1fr);
  grid-template-areas:"logo info" "btn btn" "apr apr" "links links";
  column-gap:12px;row-gap:12px;align-items:center;
  -webkit-tap-highlight-color:transparent;
}
.offer-logo{grid-area:logo;min-width:0}
.offer-logo a{display:block;line-height:0}
.offer-logo img{display:block;width:112px;height:57px;object-fit:contain}

.offer-info{grid-area:info;list-style:none;display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:baseline;row-gap:4px;min-width:0;text-align:right}
.offer-info li{font-size:13px;color:#4A5450;white-space:nowrap}
.offer-info .text{display:none}
.offer-info li:first-child{flex:0 0 100%}
.offer-info li:first-child .value{font-size:22px;font-weight:800;letter-spacing:-.02em;line-height:1.05;color:var(--ink);text-transform:lowercase}
.offer-info li:nth-child(3) .value::before{content:"\00a0· ставка "}

.offer-button{grid-area:btn}
.offer-button .btn{
  display:flex;align-items:center;justify-content:center;gap:8px;width:100%;height:50px;
  border-radius:14px;background:var(--cta);color:var(--cta-ink);text-decoration:none;
  font-size:16px;font-weight:800;letter-spacing:-.01em;transition:transform .12s ease;
}
.offer-button .btn::after{content:"";flex:none;width:18px;height:18px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2306210F' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat}
.offer-button .btn:active{transform:scale(.98)}

.offer-present{grid-area:apr;display:flex;flex-wrap:wrap;column-gap:4px;font-size:11.5px;line-height:1.35;color:var(--muted);margin-top:-2px}
.offer-present-text::after{content:":"}
.offer-present-inner{display:flex;column-gap:4px}
.offer-links{grid-area:links;display:flex;flex-wrap:wrap;column-gap:14px;font-size:11.5px;line-height:1.35;margin-top:-8px;margin-bottom:-4px}
.offer-links a{color:var(--ink2);text-decoration:underline;padding:4px 0}
.offer-links a:hover{color:var(--ink)}

/* менша сума, ніж обрано */
.offer.is-less .offer-info::before{content:"менша сума";font-size:11px;font-weight:700;line-height:1.3;color:#7A4300;background:#FFF1DC;border-radius:6px;padding:2px 7px}

/* головна картка — наступна найкраща пропозиція */
.offer.is-top{
  background:var(--ink);border-color:var(--ink);color:#FFFFFF;border-radius:22px;padding:16px;
  grid-template-columns:124px minmax(0,1fr);
  grid-template-areas:"badge badge" "logo info" "btn btn" "apr apr" "links links";
  row-gap:14px;box-shadow:0 14px 34px rgba(13,21,18,.22);
}
.offer.is-top::before{
  content:attr(data-cw-badge);grid-area:badge;
  font-size:12px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;line-height:14px;color:var(--cta);
  padding-left:20px;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%231FCB63'%3E%3Cpath d='M12 3.5l2.6 5.4 5.9.8-4.3 4.1 1 5.9-5.2-2.8-5.2 2.8 1-5.9L3.5 9.7l5.9-.8L12 3.5z'/%3E%3C/svg%3E") left center/14px 14px no-repeat;
}
.offer.is-top .offer-logo a{height:62px;border-radius:14px;background:#FFFFFF;display:flex;align-items:center;justify-content:center;overflow:hidden}
.offer.is-top .offer-logo img{width:120px;height:61px}
.offer.is-top .offer-info li{color:#C3CCC6}
.offer.is-top .offer-info li:first-child .value{font-size:26px;color:#FFFFFF}
.offer.is-top .offer-button .btn{height:56px;border-radius:16px;font-size:17px;gap:10px}
.offer.is-top .offer-button .btn::after{width:20px;height:20px;animation:cwNudge 2.6s ease-in-out infinite}
.offer.is-top .offer-present{color:#B7C1BB}
.offer.is-top .offer-links a{color:#C9D1CC}
.offer.is-top .offer-links a:hover{color:#FFFFFF}

/* заявку відкрито */
.offer.is-done{
  background:#E7F6EC;border-color:#CDEBD8;color:var(--ink);padding:10px 10px 10px 12px;box-shadow:none;
  grid-template-columns:72px minmax(0,1fr) auto;
  grid-template-areas:"logo info btn" "apr apr apr" "links links links";
  column-gap:10px;row-gap:8px;
}
.offer.is-done .offer-logo a{height:44px;border-radius:10px;background:#FFFFFF;display:flex;align-items:center;justify-content:center;overflow:hidden}
.offer.is-done .offer-logo img{width:72px;height:37px}
.offer.is-done .offer-info{display:block;text-align:left}
.offer.is-done .offer-info::before{
  content:"Заявку відкрито";display:block;font-size:14px;font-weight:800;line-height:1.3;color:#0B5A2E;
  padding:0 0 0 22px;border-radius:0;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='11' fill='%230A7A3B'/%3E%3Cpath d='M7 12.5l3.4 3.4L17 9' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") left center/16px 16px no-repeat;
}
.offer.is-done .offer-info li{display:none}
.offer.is-done .offer-info li:first-child{display:block;margin-top:2px}
.offer.is-done .offer-info li:first-child .value{font-size:12.5px;font-weight:500;letter-spacing:0;line-height:1.3;color:var(--ink2)}
.offer.is-done .offer-button .btn{width:auto;height:44px;padding:0 14px;border-radius:12px;background:#FFFFFF;border:1px solid #9FD3B3;color:#0B5A2E;font-size:0;gap:0}
.offer.is-done .offer-button .btn::before{content:"Відкрити";font-size:13px;font-weight:700;letter-spacing:0}
.offer.is-done .offer-button .btn::after{content:none}
.offer.is-done .offer-present{color:var(--ink2);margin-top:0}
.offer.is-done .offer-links{margin-top:-6px}
.offer.is-done .offer-links a{color:var(--ink2)}

/* показати ще */
#show-more-wrap{grid-column:1/-1;margin:2px 0 0!important}
#show-more-btn{height:50px;padding:0 14px!important;border:1px solid #CFD5CD!important;border-radius:14px!important;background:transparent!important;color:var(--ink)!important;font-size:15px!important;font-weight:700!important}

/* плашка «наступна пропозиція» */
.cw-bar{
  position:sticky;bottom:calc(12px + env(safe-area-inset-bottom,0px));z-index:40;
  width:100%;max-width:560px;margin:6px auto 0;
  display:flex;align-items:center;gap:10px;
  background:var(--ink);color:#FFFFFF;border-radius:20px;padding:10px 10px 10px 12px;
  box-shadow:0 12px 30px rgba(13,21,18,.3);
}
.cw-bar-logo{flex:none;width:58px;height:44px;border-radius:10px;background:#FFFFFF;display:flex;align-items:center;justify-content:center;overflow:hidden}
.cw-bar-logo img{display:block;width:58px;height:30px;object-fit:contain}
.cw-bar-text{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:3px}
.cw-bar-text span{font-size:12px;color:#B7C1BB;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cw-bar-text strong{font-size:15px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cw-bar-btn{flex:none;height:48px;padding:0 16px;border-radius:14px;background:var(--cta);color:var(--cta-ink);font-size:15px;font-weight:800;text-decoration:none;display:flex;align-items:center}
.cw-bar-btn:active{transform:scale(.98)}

/* сторонні вставки біля списку */
.cw-offers .kb-ai-wrap{margin:14px auto 6px!important;padding:0!important;max-width:none!important}
#greeting-block{margin:0}

/* ---------- як це працює ---------- */
.cw-how{display:flex;flex-direction:column;gap:14px;padding-top:36px}
.cw-how h2{font-size:20px;font-weight:800;letter-spacing:-.02em}
.cw-steps{list-style:none;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr));gap:10px}
.cw-steps li{background:#FFFFFF;border:1px solid var(--line);border-radius:18px;padding:14px;display:flex;gap:12px;align-items:flex-start}
.cw-step-n{flex:none;width:30px;height:30px;border-radius:50%;background:var(--ink);color:#FFFFFF;display:flex;align-items:center;justify-content:center;font-size:14px;font-weight:800}
.cw-steps strong{display:block;font-size:15px;font-weight:800;margin-bottom:3px}
.cw-steps p{font-size:13.5px;line-height:1.4;color:#4A5450}

/* ---------- підвал ---------- */
.cw-footer{display:flex;flex-direction:column;gap:12px;padding-top:32px;padding-bottom:40px}
.cw-footer p{font-size:12px;line-height:1.5;color:var(--muted);text-wrap:pretty}
.cw-footer-row{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 16px;font-size:12px;color:var(--muted)}
.cw-footer-row a{color:var(--ink2);text-decoration:underline;padding:8px 0}

@keyframes cwNudge{0%,64%,100%{transform:translateX(0)}76%{transform:translateX(6px)}88%{transform:translateX(0)}}
@keyframes cwPulse{0%,100%{opacity:1}50%{opacity:.55}}
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .offer.is-top .offer-button .btn::after,#offers:empty::before,#offers:empty::after{animation:none}
}
