/* Frame Match page (ECOM/includes/content/framematch.php), Dec 2026.
   Loaded by that page only, with a <link> in the page (a <style> element isn't valid in the body).
   Builds on floaterframes.css: .ff-page tokens, .ff-gal drop box, .ff-field size fields. */
.fm .fm-main{display:grid;gap:20px;padding-block:32px 56px}
.fm .fm-stack{display:grid;gap:20px}
/* Steps 1 and 2 side by side on larger screens */
.fm .fm-steps{display:grid;gap:20px;align-items:stretch} /* the two step cards the same height */
@media (min-width:992px){.fm .fm-steps{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}
.fm .fm-step{display:grid;gap:18px;align-content:start;padding:28px 24px;border:1px solid var(--line);border-radius:10px;background:var(--cream)}
.fm .fm-step h2,.fm .fm-results h2{display:flex;align-items:center;gap:12px;font-family:var(--display);font-weight:500;font-size:24px;line-height:1.2}
.fm .fm-num{flex:none;display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:var(--band);color:var(--on-band);font-family:var(--body);font-size:15px;font-weight:600}
.fm .fm-muted{color:var(--muted);font-family:var(--body);font-size:14px;font-weight:400}
/* The photo: the image gallery's drop box, then the chosen photo and its colours */
.fm .fm-photorow{display:flex;flex-wrap:wrap;align-items:center;gap:20px 32px}
.fm .fm-photorow > label{flex:1 1 360px;min-width:0;margin:0}
.fm .fm-file{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.fm .fm-file:focus-visible + label{outline:2px solid var(--gold);outline-offset:2px}
/* Once a photo is chosen it takes the upload box's place; Remove image brings the box back */
.fm .fm-photorow.fm-has > label{display:none}
.fm .fm-photorow:not(.fm-has) .fm-chosenphoto{display:none}
.fm .fm-chosenphoto{flex:1 1 100%;min-width:0;display:grid;gap:12px;justify-items:center;padding:20px;border:1px solid var(--line);border-radius:var(--r);background:var(--card);text-align:center}
.fm .fm-remove{padding:2px 4px;border:0;background:none;color:var(--muted);font-size:13px;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.fm .fm-remove:hover{color:var(--bad)}
.fm .ff-gal-drop{background:var(--card)}
.fm .ff-gal-drop:hover,.fm .ff-gal-drop.dragover{background:var(--paper)}
.fm .fm-photo{display:block;max-width:100%;max-height:280px;border-radius:var(--r);box-shadow:0 2px 8px rgb(var(--ink-rgb,43 33 24) / .2)}
.fm .fm-swatches{display:flex;flex-wrap:wrap;justify-content:center;gap:6px}
.fm .fm-swatches:empty{display:none}
.fm .fm-swatches span{width:28px;height:28px;border-radius:50%;border:1px solid rgb(var(--ink-rgb,43 33 24) / .15)}
.fm .fm-upstatus{font-size:14px;color:var(--ink-2,#5d5245)}
.fm .fm-upstatus:empty{display:none}
.fm .fm-upstatus.fm-ok{color:var(--good)}
.fm .fm-upstatus.fm-bad{color:var(--bad)}
.fm .fm-progress{width:100%;max-width:280px}
.fm .fm-small{font-size:14px;color:var(--muted)}
/* The share picture at the foot of the page */
.fm .fm-banner{margin:8px 0 0}
.fm .fm-banner img{display:block;width:100%;max-width:1200px;height:auto;margin-inline:auto;border-radius:10px}
/* The customer's image gallery: one row, scrolled sideways */
.fm .fm-gallery{display:grid;gap:10px;padding-top:18px;border-top:1px solid var(--line)}
.fm .fm-gallery-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.fm .fm-gallery-head b{font-weight:600;font-size:16px}
.fm .fm-gallery-nav{display:flex;gap:6px}
.fm .fm-gallery-nav button{display:grid;place-items:center;width:38px;height:38px;padding:0;border:1px solid var(--line);border-radius:50%;background:var(--card);color:var(--ink);cursor:pointer}
.fm .fm-gallery-nav button:hover:not(:disabled){border-color:var(--ink)}
.fm .fm-gallery-nav button:disabled{opacity:.35;cursor:default}
.fm .fm-gallery-nav[hidden]{display:none}
.fm .fm-gallery-row{display:flex;gap:10px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scroll-behavior:smooth;scrollbar-width:thin;padding:2px 2px 8px}
.fm .fm-gallery-row button{flex:0 0 104px;height:104px;padding:6px;border:2px solid var(--line);border-radius:var(--r);background:var(--card);scroll-snap-align:start;cursor:pointer;transition:border-color .15s ease}
.fm .fm-gallery-row button img{display:block;width:100%;height:100%;object-fit:contain}
.fm .fm-gallery-row button:hover{border-color:var(--gold)}
.fm .fm-gallery-row button.fm-chosen{border-color:var(--action);box-shadow:0 0 0 2px var(--action)}
/* The questions: answers styled as the Frame Finder's */
.fm .fm-q{display:grid;gap:10px}
.fm .fm-q{gap:8px}
.fm .fm-q > div:first-child{font-family:var(--display);font-weight:500;font-size:17px;line-height:1.3}
.fm .fm-chips{display:flex;flex-wrap:wrap;gap:6px}
.fm .fm-chips input{position:absolute;opacity:0;pointer-events:none}
.fm .fm-chips label{display:inline-flex;align-items:center;min-height:38px;padding:6px 13px;border:1px solid var(--line);border-radius:var(--r);background:var(--card);color:var(--ink);font-size:13.5px;font-weight:600;line-height:1.25;cursor:pointer;transition:border-color .15s ease,background .15s ease}
.fm .fm-chips label:hover{border-color:var(--action);color:var(--action)}
.fm .fm-chips input:checked + label{border-color:var(--action);background:var(--action);color:var(--on-action)}
.fm .fm-chips input:focus-visible + label{outline:2px solid var(--gold);outline-offset:2px}
/* Width and height as on /picture-frames (framesandmounts.php .ff-dims: .ff-field, .ff-inp) */
.fm .fm-size{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;max-width:520px}
.fm .fm-size .ff-field{min-width:0}
.fm .fm-size .ff-inp{width:100%;background:var(--paper)}
.fm .fm-size .ff-inp input{min-width:0;font-size:17px}
/* Buttons */
.fm .fm-go{display:flex;flex-wrap:wrap;align-items:center;gap:12px 16px}
.fm .ff-gal-btn{text-decoration:none}
/* Suggestions left this hour, on the Show my suggestions button */
.fm .fm-tally{display:inline-flex;align-items:center;min-height:22px;margin-left:4px;padding:1px 9px;border-radius:99px;background:rgb(255 255 255 / .22);font-size:12.5px;font-weight:600;line-height:1.2;white-space:nowrap}
.fm .fm-tally[hidden]{display:none}
.fm .fm-tally.fm-low{background:var(--warn-bg);color:var(--warn)}
.fm .ff-gal-btn:hover{color:var(--on-action);filter:brightness(1.1)}
.fm .ff-gal-btn:disabled{opacity:.6;cursor:default}
.fm .fm-btn-line{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:46px;padding:8px 20px;border:1px solid var(--line);border-radius:var(--r);background:var(--card);color:var(--ink);font-size:15px;font-weight:600;text-decoration:none;cursor:pointer}
.fm .fm-btn-line:hover{border-color:var(--ink);color:var(--ink)}
.fm .fm-msg{color:var(--bad);font-weight:600}
.fm .fm-msg:empty{display:none}
.fm .fm-wait{display:none;align-items:center;gap:10px;color:var(--ink-2,#5d5245)}
/* Results: cards as on Types of picture frames */
.fm .fm-results{display:none;gap:20px;scroll-margin-top:16px}
.fm .fm-summary{max-width:70ch;font-size:16px;color:var(--ink-2,#5d5245)}
.fm .fm-summary:empty{display:none}
.fm .fm-printinfo{padding:12px 16px;border-radius:var(--r);font-size:14.5px}
.fm .fm-printinfo.fm-yes{background:var(--good-bg);color:var(--good)}
.fm .fm-printinfo.fm-no{background:var(--warn-bg);color:var(--warn)}
.fm #fm-cards{display:grid;gap:14px}
.fm .fm-group-title{margin:12px 0 0;font-family:var(--display);font-weight:500;font-size:21px;line-height:1.2}
.fm .fm-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:14px}
/* Four to a row on large screens, so each set of four suggestions fills a row */
@media (min-width:992px){.fm .fm-cards{grid-template-columns:repeat(4,minmax(0,1fr))}.fm .fm-card{padding:16px}}
@media (min-width:576px) and (max-width:991.98px){.fm .fm-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
.fm .fm-morerow{display:flex;flex-wrap:wrap;align-items:center;gap:12px 20px}
.fm .fm-link{display:inline-flex;align-items:center;gap:6px;padding:4px 0;border:0;background:none;color:var(--action);font-size:15px;font-weight:600;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.fm .fm-link:hover{text-decoration-thickness:2px}
.fm .fm-link[hidden],.fm .fm-morewait[hidden]{display:none}
.fm .fm-morewait{display:inline-flex;font-size:14.5px}
.fm .fm-card{display:flex;flex-direction:column;gap:12px;padding:18px;border:1px solid var(--line);border-radius:10px;background:var(--card);transition:border-color .15s ease,box-shadow .15s ease}
.fm .fm-card:hover{border-color:var(--gold);box-shadow:0 6px 18px rgb(var(--ink-rgb,43 33 24) / .1)}
.fm .fm-card h3{font-family:var(--display);font-weight:500;font-size:19px;line-height:1.25}
/* The card's pictures: design, frame corner, mount colour */
.fm .fm-slides{position:relative}
.fm .fm-track{display:flex;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scrollbar-width:none;background:var(--stage-3,#f4efe4)}
.fm .fm-track::-webkit-scrollbar{display:none}
.fm .fm-slide{position:relative;flex:0 0 100%;display:grid;place-items:center;aspect-ratio:4/3;margin:0;scroll-snap-align:start;scroll-snap-stop:always}
.fm .fm-slide > img{display:block;max-width:100%;max-height:100%;object-fit:contain}
.fm .fm-slide.fm-white{background:#fff}
.fm .fm-slide > img.fm-slide-chev{max-width:92%;max-height:92%}
.fm .fm-slide > img.fm-slide-frame{max-width:78%;max-height:78%;filter:drop-shadow(0 4px 10px rgb(var(--ink-rgb,43 33 24) / .25))}
.fm .fm-slide > .fm-swatch{width:78%;height:78%;border-radius:4px;box-shadow:0 4px 14px rgb(var(--ink-rgb,43 33 24) / .2)}
.fm .fm-slide-mount{display:grid;place-items:center}
.fm .fm-slide-mount > i{display:block;width:52%;height:52%;background:var(--stage-3,#f4efe4);box-shadow:inset 0 0 0 1px rgb(0 0 0 / .18)}
.fm .fm-arrow{position:absolute;top:calc(50% - 30px);display:grid;place-items:center;width:34px;height:34px;padding:0;border:1px solid var(--line);border-radius:50%;background:rgb(255 255 255 / .92);color:var(--ink);cursor:pointer;opacity:0;transition:opacity .15s ease}
.fm .fm-prev{left:8px}
.fm .fm-next{right:8px}
.fm .fm-slides:hover .fm-arrow:not(:disabled),.fm .fm-arrow:focus-visible{opacity:1}
.fm .fm-arrow:disabled{pointer-events:none}
@media (hover:none){.fm .fm-arrow{display:none}}
.fm .fm-dots{display:flex;justify-content:center;gap:2px;padding-top:6px}
.fm .fm-dots button{width:22px;height:22px;padding:0;border:0;background:none;cursor:pointer;display:grid;place-items:center}
.fm .fm-dots button::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--line);transition:background .15s ease,transform .15s ease}
.fm .fm-dots button[aria-current="true"]::before{background:var(--ink);transform:scale(1.15)}
.fm .fm-parts{display:grid;gap:2px;font-size:14px;font-weight:600}
.fm .fm-reason{flex:1;font-size:13px;line-height:1.5;color:var(--muted)}
.fm .fm-actions{display:grid;gap:8px}
.fm .fm-actions .ff-gal-btn,.fm .fm-actions .fm-btn-line{justify-content:center;width:100%;text-align:center}
.fm .fm-warn{display:none;gap:8px;padding:14px 16px;border:2px solid var(--warn);border-radius:var(--r);background:var(--warn-bg);color:var(--ink);font-size:12px}
.fm .fm-warn strong{color:var(--warn)}
.fm .fm-warn.fm-show{display:grid}
.fm .fm-off{display:none;padding:28px 24px;border:1px solid var(--line);border-radius:10px;background:var(--cream)}
.fm .fm-off a{color:var(--action);text-decoration:underline;text-underline-offset:3px}
#fm-form{display:none}
@media (max-width:575.98px){
  .fm .fm-main{gap:16px;padding-block:20px 40px}
  .fm .fm-step{padding:22px 16px}
  .fm .fm-step h2{font-size:21px}
  .fm .fm-cards{grid-template-columns:1fr;gap:10px}
  .fm .fm-gallery-row button{flex-basis:88px;height:88px}
  .fm .fm-gallery-nav{display:none}
}
/* Transitions: the photo (or the upload box, after Remove image) fades and rises into place,
   the Show my suggestions button fades in once there's a photo, and the photo fades out on Remove. */
@keyframes fm-in{from{opacity:0;transform:translateY(8px) scale(.98)}to{opacity:1;transform:none}}
@keyframes fm-out{from{opacity:1;transform:none}to{opacity:0;transform:scale(.97)}}
.fm .fm-enter{animation:fm-in .35s cubic-bezier(.2,.7,.3,1) both}
.fm .fm-leave{animation:fm-out .2s ease-in both;pointer-events:none}
@media (prefers-reduced-motion:reduce){.fm .fm-enter,.fm .fm-leave{animation:none}}
@media (prefers-reduced-motion:reduce){.fm .fm-card,.fm .fm-chips label,.fm .fm-gallery-row button{transition:none}.fm .fm-gallery-row{scroll-behavior:auto}}
