/* =========================================
   FANTOUKIS - the "your picture" builder (image-builder.js)
   ========================================= */
.ib [hidden], .ib-picker[hidden], [data-chips-field][hidden], [data-rim-field][hidden], [data-parts-field][hidden] { display: none !important; }
.ib .ib-stage { align-content: center; gap: 10px; padding: 16px; min-height: 300px; background: radial-gradient(circle at 50% 40%, #fff 0, var(--cream) 70%); }
.ib-drop { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 26px 18px; border: 2.5px dashed var(--line); border-radius: 18px; background: #fff; cursor: pointer; width: 100%; max-width: 380px; transition: border-color 0.2s, transform 0.25s var(--bounce); }
.ib-drop input, .ib-tool input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ib-drop-icon { font-size: 44px; line-height: 1; }
.ib-drop strong { font-size: 1.05rem; color: var(--ink); }
.ib-drop small { color: var(--muted, #6B5E66); line-height: 1.35; max-width: 300px; }
.ib-view { display: grid; justify-items: center; gap: 8px; width: 100%; }
.ib-view canvas { display: block; max-width: 100%; max-height: 330px; width: auto; height: auto; touch-action: auto; }
.ib-view canvas.is-erasing { cursor: crosshair; touch-action: none; outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: 10px; }
.ib-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ib-tool { position: relative; border: 1.5px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 7px 13px; font: inherit; font-size: 0.88rem; font-weight: 600; cursor: pointer; }
.ib-tool.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.ib-tool:disabled { opacity: 0.45; cursor: default; }
.ib-erase-hint { margin: 0; font-size: 0.85rem; color: var(--accent); font-weight: 600; }
.ib-msg { margin: 0; text-align: center; font-weight: 600; color: var(--accent); }
.ib-note { display: block; font-weight: 500; color: var(--muted, #6B5E66); font-size: 0.82rem; margin-top: 2px; }
.ib-count { grid-template-columns: repeat(3, 1fr); }
.ib-sides { grid-template-columns: repeat(4, 1fr); }
.ib-chips, .ib-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.ib-picker { margin-top: 10px; padding: 10px; border-radius: 14px; background: var(--cream); }
.ib-chip { display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px 5px 5px; font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--ink); cursor: pointer; }
.ib-chip i { width: 24px; height: 24px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1.5px rgba(0,0,0,0.15); }
.ib-chip.is-on { border-color: var(--ink); box-shadow: 0 0 0 1.5px var(--ink); }
.ib-warn { margin: 6px 0 0; font-size: 0.85rem; color: var(--accent); font-weight: 600; }
.ib-slider { display: flex; align-items: center; gap: 10px; }
.ib-slider input { flex: 1; accent-color: var(--accent); }
.ib-slider small { color: var(--muted, #6B5E66); font-size: 0.8rem; }
#product-order.is-busy { opacity: 0.75; pointer-events: none; }
/* --- v3: camera / gallery, photo tips, crop & rotate, warnings --- */
.ib-drop { cursor: default; }
.ib-pick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 4px; }
.ib-pick-btn { position: relative; display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--ink); border-radius: 999px; padding: 9px 16px; font-weight: 700; font-size: 0.95rem; color: var(--ink); background: #fff; cursor: pointer; box-shadow: 0 3px 0 var(--ink); }
.ib-pick-btn.is-main { background: var(--yellow, #FFD84D); }
.ib-pick-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ib-tips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; margin-top: 6px; }
.ib-tip { display: grid; justify-items: center; gap: 4px; padding: 8px; border-radius: 12px; font-size: 0.78rem; line-height: 1.25; color: var(--ink); }
.ib-tip svg { width: 100%; max-width: 120px; height: auto; }
.ib-tip.is-good { background: #E8F7EF; } .ib-tip.is-bad { background: #FDECEF; }
.ib-crop { display: grid; justify-items: center; gap: 10px; width: 100%; }
.ib-crop-frame { position: relative; width: 100%; max-width: 340px; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: #fff; touch-action: none; cursor: grab; box-shadow: 0 0 0 2px var(--ink), 0 10px 24px rgba(43,34,48,0.18); }
.ib-crop-frame canvas { display: block; }
.ib-crop-grid { position: absolute; inset: 0; pointer-events: none; background:
    linear-gradient(to right, transparent 33.1%, rgba(255,255,255,0.7) 33.3%, transparent 33.5%, transparent 66.5%, rgba(255,255,255,0.7) 66.7%, transparent 66.9%),
    linear-gradient(to bottom, transparent 33.1%, rgba(255,255,255,0.7) 33.3%, transparent 33.5%, transparent 66.5%, rgba(255,255,255,0.7) 66.7%, transparent 66.9%); }
.ib-crop-hint { margin: 0; font-size: 0.85rem; color: var(--muted, #6B5E66); text-align: center; }
.ib-crop-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; width: 100%; }
.ib-tilt { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 600; flex: 1; min-width: 180px; max-width: 280px; }
.ib-tilt input { flex: 1; accent-color: var(--accent); }
.ib-go { border: 0; background: var(--accent); color: #fff; font: inherit; font-weight: 800; font-size: 1rem; padding: 11px 26px; border-radius: 999px; cursor: pointer; box-shadow: 0 4px 0 #9c2f57; }
.ib-three { grid-template-columns: repeat(3, 1fr); }
.ib-brush { display: inline-flex; gap: 6px; }
.ib-warn-box { width: 100%; max-width: 420px; background: #FFF6D6; border: 1.5px solid #F2D27A; border-radius: 14px; padding: 10px 12px; font-size: 0.86rem; line-height: 1.35; }
.ib-warn-box ul { margin: 0 0 4px; padding: 0; list-style: none; display: grid; gap: 4px; }
.ib-warn-box small { color: var(--muted, #6B5E66); }
/* --- v4: the preview stays in view while scrolling the options --- */
.product-options:has(.ib) { overflow: clip; overflow-clip-margin: 0; }
.ib .ib-stage { align-self: start; }
.ib .ib-stage.is-pinned { position: sticky; top: var(--ib-top, 72px); z-index: 6; }
.ib .ib-warn-box { margin-bottom: 4px; max-width: none; }
@media (max-width: 900px) {
    .ib .ib-stage.is-pinned { min-height: 0; padding: 8px 10px 10px; gap: 6px; box-shadow: 0 12px 26px rgba(43, 34, 48, 0.16); border-radius: 18px; }
    .ib-stage.is-pinned .ib-view { gap: 6px; }
    .ib-stage.is-pinned .ib-view canvas { max-height: 30vh; }
    .ib-stage.is-pinned .hp-size { margin: 0; font-size: 0.85rem; }
    .ib-stage.is-pinned .ib-tools { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; width: 100%; padding-bottom: 2px; scrollbar-width: none; }
    .ib-stage.is-pinned .ib-tools::-webkit-scrollbar { display: none; }
    .ib-stage.is-pinned .ib-tool { white-space: nowrap; flex: none; padding: 6px 11px; font-size: 0.82rem; }
    .ib-stage.is-pinned .ib-erase-hint { font-size: 0.8rem; }
}
.ib-tool { white-space: nowrap; }
/* --- v5: the preview keeps the same height, so nothing below it jumps --- */
.ib .ib-view canvas { height: 300px; width: auto; max-width: 100%; object-fit: contain; }
@media (max-width: 900px) { .ib-stage.is-pinned .ib-view canvas { height: 30vh; max-height: 30vh; } }
.ib .hp-play-controls { overflow-anchor: none; }
/* --- v6: upload-first buttons + the logo maker --- */
.ib-pick-logo { flex-direction: column; align-items: stretch; width: 100%; max-width: 320px; gap: 10px; }
.ib-pick-btn.is-big { flex-direction: column; gap: 2px; padding: 14px 16px; font-size: 1.05rem; }
.ib-pick-btn.is-big small { font-weight: 600; font-size: 0.8rem; color: var(--ink); opacity: 0.8; }
.ib-pick-logo .ib-pick-btn { justify-content: center; font: inherit; font-weight: 700; }
.ib-or { text-align: center; font-size: 0.85rem; color: var(--muted, #6B5E66); font-weight: 600; margin-top: 4px; }
.ib-maker { width: 100%; }
.lm { display: grid; gap: 10px; width: 100%; }
.lm-board-wrap { display: grid; place-items: center; }
.lm-board { display: block; border-radius: 14px; box-shadow: 0 0 0 2px var(--ink), 0 10px 24px rgba(43,34,48,0.15); touch-action: none; background: #fff; }
.lm-hint { margin: 0; text-align: center; font-size: 0.82rem; color: var(--muted, #6B5E66); }
.lm-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.lm-real-note { margin: 0; text-align: center; font-size: 0.85rem; font-weight: 600; color: var(--accent); }
.lm-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
.lm-add > span { font-weight: 700; font-size: 0.9rem; width: 100%; text-align: center; }
.lm-btn { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 0.86rem; font-weight: 700; color: var(--ink); cursor: pointer; white-space: nowrap; }
.lm-btn.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }
.lm-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; background: var(--cream); padding: 8px; border-radius: 14px; }
.lm-icon { border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 4px; cursor: pointer; }
.lm-icon canvas { width: 100%; height: auto; display: block; }
.lm-panel { display: grid; gap: 10px; background: #fff; border: 1.5px solid var(--line); border-radius: 16px; padding: 12px; }
.lm-field { display: grid; gap: 6px; }
.lm-field > span { font-weight: 700; font-size: 0.85rem; }
.lm-field input[type=text] { font: inherit; font-size: 1rem; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 12px; }
.lm-field input[type=range] { width: 100%; accent-color: var(--accent); }
.lm-fonts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.lm-font { border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 6px; font-size: 1.3rem; cursor: pointer; color: var(--ink); }
.lm-font.is-on { border-color: var(--ink); background: var(--yellow, #FFE9A8); }
.lm-pal { display: flex; flex-wrap: wrap; gap: 7px; }
.lm-sw { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; background: var(--c, #fff); box-shadow: 0 0 0 1.5px var(--line); cursor: pointer; }
.lm-sw.is-on { box-shadow: 0 0 0 3px var(--ink); }
.lm-none { background: #fff; color: var(--muted); font-weight: 700; }
.lm-two { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.lm-del { color: #c0392b; }
.lm-msg { margin: 0; text-align: center; font-weight: 700; color: var(--accent); }
.lm-tips { margin: 0; font-size: 0.82rem; line-height: 1.35; background: #FFF6D6; border-radius: 12px; padding: 8px 10px; }
.lm-end { justify-content: space-between; }
.lm [hidden] { display: none !important; }
/* --- v7: logo maker on the homepage: what to do with the finished logo --- */
.lm-free { display: grid; gap: 8px; background: var(--cream); border-radius: 16px; padding: 12px; text-align: center; }
.lm-free b { font-size: 1rem; }
.ib-go.is-alt { background: var(--ink); box-shadow: 0 4px 0 #000; }
.hp-play-box .lm { max-width: 560px; margin: 0 auto; }
/* Logos are digital files only: a link for paper drawings */
.ib-drawing-link { display: block; text-align: center; font-size: 0.88rem; font-weight: 600; color: var(--accent, #D9467A); text-decoration: underline; margin-top: 4px; }
/* Logo keyring: 4 shapes (Follows the logo, Just the logo, Circle, Rounded square) */
.ib-four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 420px) { .ib-four { grid-template-columns: repeat(2, 1fr); } }
.hp-font.is-off { opacity: 0.4; cursor: not-allowed; }
.ib-shape-note { display: block; margin-top: 6px; }
