/* =========================================================
   Free tools: quiz / hair check, chat assistant, before-after, cost estimator
   ========================================================= */

/* ---------- Quiz card ---------- */
.tool-wrap { position: relative; }
.tool-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem 1.4rem; margin-bottom: 1.2rem; font-size: .85rem; color: var(--muted); }
.tool-facts i { color: var(--gold); margin-right: .4rem; }
.tool-app, .tool-result { background: #fff; border: 1px solid var(--line); border-radius: 28px; padding: 2rem 2.2rem; box-shadow: 0 30px 70px -30px rgba(80, 55, 25, .35); position: relative; overflow: hidden; }
.tool-app::before, .tool-result::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: linear-gradient(90deg, var(--gold-light), var(--gold), #c98a75); }
.tool-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: .8rem; color: var(--muted); margin-bottom: .7rem; }
.tool-count { font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-dark); }
.tool-progress { height: 8px; background: var(--cream-2); border-radius: 99px; overflow: hidden; margin-bottom: 1.8rem; }
.tool-progress-bar { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--gold-light), var(--gold)); transition: width .45s cubic-bezier(.2, .8, .2, 1); }
.tool-q { font-family: var(--font-serif); font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 600; line-height: 1.2; margin-bottom: .4rem; }
.tool-hint { color: var(--muted); font-size: .9rem; margin-bottom: 0; }
.tool-options { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: 1.4rem; }
.tool-option { display: flex; align-items: center; gap: .9rem; text-align: left; width: 100%; padding: 1rem 1.1rem; border-radius: 18px; border: 1.5px solid var(--line); background: var(--cream); color: var(--ink); transition: all .25s; min-height: 72px; }
.tool-option:hover { border-color: var(--gold-light); background: #fff; transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.tool-option:focus-visible { outline: 3px solid rgba(168, 121, 61, .35); outline-offset: 2px; }
.to-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); color: var(--gold-dark); font-size: 1.2rem; flex-shrink: 0; transition: all .25s; }
.to-text { flex: 1; line-height: 1.3; }
.to-text strong { display: block; font-weight: 500; font-size: .95rem; }
.to-text small { display: block; color: var(--muted); font-size: .8rem; margin-top: .15rem; }
.to-check { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; color: transparent; flex-shrink: 0; transition: all .25s; }
.tool-option.is-on { border-color: var(--gold); background: #fffaf2; box-shadow: 0 0 0 4px rgba(168, 121, 61, .12); }
.tool-option.is-on .to-icon { background: linear-gradient(135deg, #b98a4b, var(--gold-dark)); color: #fff; border-color: transparent; }
.tool-option.is-on .to-check { background: var(--gold); border-color: var(--gold); color: #fff; }
.tool-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 1.6rem; min-height: 44px; }
.tool-back { color: var(--muted); text-decoration: none; padding-left: 0; }
.tool-back:disabled { visibility: hidden; }
.tool-anim { animation: toolIn .4s cubic-bezier(.2, .8, .2, 1); }
@keyframes toolIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Result ---------- */
.result-head { display: flex; align-items: center; gap: 1.1rem; margin-bottom: 1rem; }
.result-icon { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; font-size: 2rem; color: #fff; flex-shrink: 0; background: linear-gradient(135deg, #b98a4b, var(--gold-dark)); box-shadow: 0 14px 30px -10px rgba(168, 121, 61, .6); }
.tone-dry .result-icon { background: linear-gradient(135deg, #e7b7a5, #c98a75); }
.tone-oily .result-icon { background: linear-gradient(135deg, #8fc3c4, #4f9091); }
.tone-combination .result-icon { background: linear-gradient(135deg, #b9a3cf, #7d65a0); }
.tone-alert .result-icon { background: linear-gradient(135deg, #f0a35e, #d1652a); }
.tone-calm .result-icon { background: linear-gradient(135deg, #8fc3a0, #3f8f5c); }
.result-pre { display: block; font-size: .75rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-dark); font-weight: 600; }
.result-title { font-family: var(--font-serif); font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 600; margin: .1rem 0 0; line-height: 1.1; }
.result-lead { color: var(--ink-2); font-size: 1.02rem; line-height: 1.7; }
.result-block { background: var(--cream); border: 1px solid var(--line); border-radius: 18px; padding: 1.1rem 1.3rem; margin-top: .9rem; }
.result-block h3 { font-size: .98rem; font-weight: 600; margin-bottom: .6rem; display: flex; align-items: center; gap: .55rem; }
.result-block h3 i { color: var(--gold); font-size: 1.1rem; }
.result-block ul { list-style: none; padding: 0; margin: 0; }
.result-block li { position: relative; padding: .3rem 0 .3rem 1.5rem; font-size: .92rem; color: var(--ink-2); line-height: 1.5; }
.result-block li::before { content: "\F26E"; font-family: "bootstrap-icons"; position: absolute; left: 0; top: .3rem; color: var(--gold); }
.result-block.is-alert { background: #fff6ee; border-color: #f3d2b5; }
.result-block.is-alert h3 i { color: #d1652a; }
.result-cta { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin-top: 1.6rem; }
.result-retake { color: var(--muted); text-decoration: none; }
.result-note { font-size: .8rem; color: var(--muted); margin: 1.2rem 0 0; line-height: 1.5; }

/* ---------- Homepage teaser + treatment callout ---------- */
.tools-band { display: grid; grid-template-columns: 1fr 1.1fr; gap: 2rem; align-items: center; background: linear-gradient(135deg, #fff, #fbf3e7); border: 1px solid var(--line); border-radius: 32px; padding: 2.4rem; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.tools-band::after { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; border: 1px dashed rgba(168, 121, 61, .25); right: -90px; top: -110px; }
.tools-band .display-title { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.tools-band-cards { display: grid; gap: .9rem; position: relative; z-index: 1; }
.tool-card, .tool-callout { display: flex; align-items: center; gap: 1rem; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 1.1rem 1.2rem; color: var(--ink); transition: all .3s; }
.tool-card:hover, .tool-callout:hover { border-color: var(--gold-light); box-shadow: var(--shadow); transform: translateY(-3px); color: var(--ink); }
.tool-card-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 1.4rem; color: #fff; background: linear-gradient(135deg, #b98a4b, var(--gold-dark)); flex-shrink: 0; }
.tool-card strong, .tool-callout strong { display: block; font-weight: 600; }
.tool-card small, .tool-callout small { display: block; color: var(--muted); font-size: .85rem; }
.tool-card-arrow, .tool-callout .bi-arrow-right { margin-left: auto; color: var(--gold); transition: transform .3s; }
.tool-card:hover .tool-card-arrow, .tool-callout:hover .bi-arrow-right { transform: translateX(4px); }
.tool-callout { background: #fffaf2; border-style: dashed; }
.tool-callout > i:first-child { font-size: 1.5rem; color: var(--gold); }

/* ---------- Chat assistant ---------- */
.chat-widget { position: fixed; right: 20px; bottom: 160px; z-index: 1045; }
.chat-fab { width: 56px; height: 56px; border-radius: 50%; border: 0; color: #fff; font-size: 1.45rem; display: grid; place-items: center; position: relative; background: linear-gradient(135deg, #b98a4b, var(--gold-dark)); box-shadow: 0 12px 28px rgba(168, 121, 61, .45); transition: transform .25s; }
.chat-fab:hover { transform: scale(1.07); }
.chat-fab:focus-visible { outline: 3px solid rgba(168, 121, 61, .4); outline-offset: 3px; }
.chat-fab-close { display: none; font-size: 1.2rem; }
.chat-widget.is-open .chat-fab-open, .chat-widget.is-open .chat-fab-dot { display: none; }
.chat-widget.is-open .chat-fab-close { display: block; }
.chat-fab-dot { position: absolute; top: 4px; right: 4px; width: 12px; height: 12px; border-radius: 50%; background: #2fb344; border: 2px solid #fff; }
.chat-panel { position: absolute; right: 0; bottom: 70px; width: 360px; max-width: calc(100vw - 32px); height: 520px; max-height: calc(100vh - 200px); background: #fff; border-radius: 24px; box-shadow: 0 30px 80px rgba(42, 34, 28, .3); border: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; animation: chatIn .3s cubic-bezier(.2, .8, .2, 1); transform-origin: bottom right; }
.chat-panel[hidden] { display: none; }
@keyframes chatIn { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
.chat-head { display: flex; align-items: center; gap: .75rem; padding: .9rem 1rem; color: #fff; background: linear-gradient(120deg, #2a221c, #4a3627); }
.chat-head .brand-mark { width: 40px; height: 40px; font-size: 1.3rem; flex-shrink: 0; }
.chat-head strong { display: block; font-size: .98rem; }
.chat-head small { display: flex; align-items: center; gap: .35rem; color: rgba(255, 255, 255, .7); font-size: .75rem; }
.chat-online { width: 8px; height: 8px; border-radius: 50%; background: #2fb344; display: inline-block; }
.chat-close { margin-left: auto; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .1); color: #fff; }
.chat-body { flex: 1; overflow-y: auto; padding: 1rem; background: var(--cream); display: flex; flex-direction: column; gap: .6rem; }
.chat-msg { display: flex; flex-direction: column; max-width: 88%; }
.chat-msg.me { align-self: flex-end; align-items: flex-end; }
.chat-bubble { padding: .65rem .9rem; border-radius: 18px; font-size: .9rem; line-height: 1.45; white-space: pre-line; }
.chat-msg.bot .chat-bubble { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px; color: var(--ink); }
.chat-msg.me .chat-bubble { background: linear-gradient(135deg, #b98a4b, var(--gold-dark)); color: #fff; border-bottom-right-radius: 6px; }
.chat-links { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .45rem; }
.chat-links a { font-size: .8rem; padding: .35rem .75rem; border-radius: 99px; background: #fff; border: 1px solid var(--gold-light); color: var(--gold-dark); font-weight: 500; }
.chat-links a:hover { background: var(--gold); color: #fff; border-color: var(--gold); }
.chat-links a[href*="wa.me"] { border-color: #bfe8cc; color: #128c4a; }
.chat-links a[href*="wa.me"]:hover { background: #25d366; color: #fff; }
.typing .chat-bubble { display: flex; gap: 4px; padding: .8rem 1rem; }
.typing .chat-bubble span { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-light); animation: dot 1s infinite; }
.typing .chat-bubble span:nth-child(2) { animation-delay: .15s; } .typing .chat-bubble span:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 50% { transform: translateY(-4px); opacity: .5; } }
.chat-quick { display: flex; gap: .4rem; overflow-x: auto; padding: .6rem .8rem; border-top: 1px solid var(--line); background: #fff; scrollbar-width: none; }
.chat-quick::-webkit-scrollbar { display: none; }
.chat-quick button { flex-shrink: 0; font-size: .8rem; padding: .45rem .8rem; border-radius: 99px; border: 1px solid var(--line); background: var(--cream); color: var(--ink-2); white-space: nowrap; }
.chat-quick button:hover { border-color: var(--gold); color: var(--gold-dark); }
.chat-input { display: flex; gap: .5rem; padding: .6rem .8rem .5rem; background: #fff; }
.chat-input input { flex: 1; border: 1px solid var(--line); background: var(--cream); border-radius: 99px; padding: .6rem 1rem; font-size: 16px; min-width: 0; }
.chat-input input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(168, 121, 61, .15); }
.chat-input button { width: 44px; height: 44px; border-radius: 50%; border: 0; color: #fff; background: linear-gradient(135deg, #b98a4b, var(--gold-dark)); flex-shrink: 0; }
.chat-foot { font-size: .7rem; color: var(--muted); text-align: center; padding: 0 .8rem .6rem; background: #fff; }

/* ---------- Before / after ---------- */
.ba-card { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-sm); }
.ba-slider { position: relative; aspect-ratio: 4 / 3; overflow: hidden; user-select: none; }
.ba-slider > img, .ba-before img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.ba-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; background: #fff; transform: translateX(-50%); pointer-events: none; }
.ba-handle i { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(90deg); width: 40px; height: 40px; border-radius: 50%; background: #fff; display: grid; place-items: center; color: var(--gold-dark); box-shadow: var(--shadow-sm); }
.ba-range { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.ba-tag { position: absolute; top: .8rem; font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; padding: .25rem .6rem; border-radius: 99px; background: rgba(42, 34, 28, .7); color: #fff; pointer-events: none; }
.ba-tag-b { left: .8rem; } .ba-tag-a { right: .8rem; }
.ba-card figcaption { padding: .8rem 1rem; font-family: var(--font-serif); font-size: 1.15rem; }

/* ---------- Cost estimator ---------- */
.est-list { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 1.6rem; }
.est-item { display: flex; align-items: center; gap: .9rem; padding: .85rem 1rem; border: 1.5px solid var(--line); border-radius: 16px; margin-bottom: .6rem; cursor: pointer; background: var(--cream); transition: all .2s; }
.est-item:hover { border-color: var(--gold-light); background: #fff; }
.est-check { position: absolute; opacity: 0; pointer-events: none; }
.est-box { width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid var(--line); display: grid; place-items: center; color: transparent; background: #fff; flex-shrink: 0; }
.est-check:checked + .est-box { background: var(--gold); border-color: var(--gold); color: #fff; }
.est-check:focus-visible + .est-box { outline: 3px solid rgba(168, 121, 61, .35); outline-offset: 2px; }
.est-item:has(.est-check:checked) { border-color: var(--gold); background: #fffaf2; }
.est-text strong { display: block; font-weight: 500; }
.est-text small { color: var(--muted); }
.est-summary { position: sticky; top: 100px; background: linear-gradient(160deg, #fff, #fbf3e7); border: 1px solid var(--line); border-radius: 24px; padding: 1.8rem; box-shadow: var(--shadow); }
.est-total { font-family: var(--font-serif); font-size: 2.6rem; font-weight: 600; color: var(--gold-dark); line-height: 1.1; margin: .3rem 0; }

/* ---------- Small laptops: 8 menu items must fit on one line ---------- */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .site-nav .nav-link { padding: .5rem .45rem !important; font-size: .84rem; }
    .site-nav .navbar-collapse > .btn { font-size: 0; padding: .55rem .8rem !important; }
    .site-nav .navbar-collapse > .btn i { font-size: 1.05rem; margin: 0 !important; }
    .brand-line { display: none; }
}

/* ---------- Phones ---------- */
@media (max-width: 991.98px) {
    .tools-band { grid-template-columns: 1fr; padding: 1.8rem; }
}
@media (max-width: 767.98px) {
    .tool-app, .tool-result { padding: 1.4rem 1.1rem; border-radius: 22px; }
    .tool-options { grid-template-columns: 1fr; gap: .6rem; }
    .tool-option { min-height: 64px; padding: .85rem .9rem; }
    .tool-top .tool-label { display: none; }
    .result-head { gap: .8rem; }
    .result-icon { width: 56px; height: 56px; font-size: 1.6rem; border-radius: 18px; }
    .result-cta .btn-lg { width: 100%; }
    .result-retake { width: 100%; }
    .tools-band { padding: 1.4rem 1.1rem; border-radius: 24px; }
    .tool-callout { align-items: flex-start; }
    /* chat sits above the bottom bar, back-to-top moves left */
    .chat-widget { right: 14px; bottom: 86px; }
    .chat-fab { width: 52px; height: 52px; }
    .back-to-top { right: auto; left: 14px; }
    .chat-panel { position: fixed; left: 10px; right: 10px; bottom: 76px; width: auto; max-width: none; height: auto; top: 70px; max-height: none; border-radius: 20px; }
    .est-summary { position: static; }
    .est-total { font-size: 2.1rem; }
}
@media (prefers-reduced-motion: reduce) { .tool-anim, .chat-panel { animation: none !important; } }
