/* ==========================================================================
   Konfigurator „Kreiraj svoju torbicu" (tema Lalla)
   Ilustracija: --yarn mijenja samo predivo, --plate1/--plate2 samo pločicu; ugao i veličina su isti za sve.
   ========================================================================== */
.lalla-bag { display: block; width: 100%; height: auto; overflow: visible; }
.lalla-bag__body { fill: var(--yarn, #cfc3b2); transition: fill .35s var(--lalla-ease); }
.lalla-bag__handle { stroke: var(--yarn, #cfc3b2); transition: stroke .35s var(--lalla-ease); }
.lalla-bag__rim { stroke: color-mix(in srgb, var(--yarn, #cfc3b2) 62%, #000); transition: stroke .35s var(--lalla-ease); }
.lalla-bag__plate1 { stop-color: var(--plate1, #e8e2d8); transition: stop-color .35s; }
.lalla-bag__plate2 { stop-color: var(--plate2, #bfb6a8); transition: stop-color .35s; }
.lalla-bag__outline { stroke: rgba(33, 29, 28, .45); opacity: 0; transition: opacity .35s; }
.lalla-bag__yarn, .lalla-bag__plaque { transition: opacity .35s var(--lalla-ease); }
/* Prije izbora boje: poluprovidna silueta */
.lalla-bag.is-empty .lalla-bag__yarn { opacity: .28; }
.lalla-bag.is-empty .lalla-bag__texture { opacity: .5; }
.lalla-bag.is-empty .lalla-bag__outline { opacity: 1; }
.lalla-bag.no-plate .lalla-bag__plaque { opacity: .38; }

.lalla-config { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.lalla-config__stage { position: sticky; top: calc(var(--lalla-header-h) + 24px); }
body.admin-bar .lalla-config__stage { top: calc(var(--lalla-header-h) + 56px); }
.lalla-config__visual {
	position: relative; aspect-ratio: 500 / 560; padding: 6% 8% 4%;
	background: #F7F2EA; border: 1px solid #DDD1BF; border-radius: 6px;
}
.lalla-config__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 4%; background: #F7F2EA; border-radius: 6px; }
.lalla-config__visual.has-photo .lalla-bag { visibility: hidden; }
.lalla-config__summary { min-height: 1.5em; margin: 14px 0 0; text-align: center; font-family: var(--lalla-serif); font-size: 20px; color: var(--lalla-ink); }

.lalla-config__editing { margin: 0 0 14px; padding: 10px 14px; border-left: 2px solid var(--lalla-bordo); background: rgba(253, 251, 247, .7); font-size: 13px; font-weight: 500; }
.lalla-cstep { border-top: 1px solid rgba(33, 29, 28, .18); }
.lalla-cstep:last-of-type { border-bottom: 1px solid rgba(33, 29, 28, .18); }
html body.lalla .lalla-cstep__head {
	display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px; width: 100%;
	min-height: 64px; padding: 14px 0; background: transparent; color: var(--lalla-ink); border: 0; border-radius: 0;
	text-align: left; text-transform: none; letter-spacing: 0; cursor: pointer; box-shadow: none; transform: none;
}
html body.lalla .lalla-cstep__head:hover, html body.lalla .lalla-cstep__head:focus { background: transparent; color: var(--lalla-ink); }
.lalla-cstep__num {
	display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
	border: 1px solid rgba(33, 29, 28, .35); font: 500 13px/1 var(--lalla-sans);
}
.lalla-cstep.is-done .lalla-cstep__num { background: var(--lalla-bordo); border-color: var(--lalla-bordo); color: var(--lalla-cream); }
.lalla-cstep.is-open .lalla-cstep__num { border-color: var(--lalla-bordo); }
.lalla-cstep__title { font-family: var(--lalla-serif); font-size: 24px; font-weight: 500; }
.lalla-cstep__value { font-size: 13px; font-weight: 500; color: var(--lalla-ink-soft); text-align: right; }
.lalla-cstep.is-done .lalla-cstep__value { color: var(--lalla-ink); }
.lalla-cstep__body { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 0 22px 46px; }
.lalla-cstep__body[hidden] { display: none; }
.lalla-cstep__note { flex-basis: 100%; margin: 4px 0 0; font-size: 13px; color: var(--lalla-ink-soft); }

html body.lalla .lalla-opt {
	display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 16px;
	background: #FDFBF7; color: var(--lalla-ink); border: 1px solid #DDD1BF; border-radius: 6px;
	font: 500 14px/1.2 var(--lalla-sans); letter-spacing: 0; text-transform: none; cursor: pointer;
	box-shadow: none; transform: none; transition: border-color .2s, box-shadow .2s;
}
html body.lalla .lalla-opt:hover, html body.lalla .lalla-opt:focus { background: #FDFBF7; color: var(--lalla-ink); border-color: #bfae94; }
html body.lalla .lalla-opt.is-selected { border-color: var(--lalla-bordo); box-shadow: inset 0 0 0 1px var(--lalla-bordo); }
html body.lalla .lalla-opt:focus-visible { outline: 2px solid var(--lalla-bordo); outline-offset: 2px; }
.lalla-opt--shape { justify-content: space-between; min-width: 220px; }
.lalla-opt__price { color: var(--lalla-ink-soft); font-weight: 500; }
.lalla-opt__swatch { width: 26px; height: 26px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18), inset 0 2px 3px rgba(255, 255, 255, .25); }
.lalla-opt__plate {
	display: inline-grid; place-items: center; width: 54px; height: 22px; border-radius: 3px;
	background: linear-gradient(135deg, var(--p1), var(--p2) 55%, var(--p1)); color: #2b2216;
	font: 500 9px/1 var(--lalla-serif); letter-spacing: .18em; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 1px 2px rgba(0, 0, 0, .25);
}
.lalla-config__actions { display: grid; gap: 12px; margin-top: 24px; }
.lalla-config__price { display: flex; justify-content: space-between; align-items: baseline; margin: 0; font-size: 14px; }
.lalla-config__price strong { font-size: 20px; font-weight: 600; }
.lalla-config__msg { min-height: 1.2em; margin: 0; font-size: 13px; color: var(--lalla-bordo); }
.lalla-config__actions [hidden] { display: none; }

@media (max-width: 767px) {
	.lalla-config { grid-template-columns: 1fr; gap: 18px; }
	/* Prikaz torbice ostaje odmah iznad aktivnog koraka dok kupac bira */
	.lalla-config__stage {
		top: var(--lalla-header-h); z-index: 4; margin: 0 calc(-1 * var(--lalla-gutter)); padding: 10px var(--lalla-gutter) 8px;
		background: #EDE5DC; box-shadow: 0 10px 12px -12px rgba(33, 29, 28, .35);
	}
	body.admin-bar .lalla-config__stage { top: var(--lalla-header-h); }
	.lalla-config__visual { width: auto; height: 30vh; max-height: 260px; margin: 0 auto; padding: 3% 5%; }
	.lalla-config__visual .lalla-bag { height: 100%; width: auto; margin: 0 auto; }
	.lalla-config__summary { margin-top: 6px; font-size: 16px; }
	.lalla-cstep__body { padding-left: 0; }
	.lalla-opt--shape { width: 100%; min-width: 0; }
	html body.lalla .lalla-opt--swatch, html body.lalla .lalla-opt--plaque { flex: 1 1 calc(50% - 5px); }
	.lalla-cstep__title { font-size: 21px; }
}

/* Pletenje na sredini ekrana */
.lalla-knit { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 20px; }
.lalla-knit[hidden] { display: none; }
.lalla-knit__backdrop { position: absolute; inset: 0; background: rgba(33, 29, 28, .45); opacity: 0; transition: opacity .25s; }
.lalla-knit.is-open .lalla-knit__backdrop { opacity: 1; }
.lalla-knit__box {
	position: relative; width: min(420px, 100%); padding: 32px 28px 28px; text-align: center; outline: none;
	background: var(--lalla-cream); border-radius: 8px; box-shadow: 0 30px 60px -30px rgba(33, 29, 28, .5);
	opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .3s var(--lalla-ease);
}
.lalla-knit.is-open .lalla-knit__box { opacity: 1; transform: none; }
.lalla-knit__art { position: relative; width: 200px; height: 224px; margin: 0 auto 14px; }
.lalla-knit__bag { position: absolute; inset: 0; clip-path: inset(100% 0 0 0); }
.lalla-knit.is-done .lalla-knit__bag, .lalla-knit.is-error .lalla-knit__bag { clip-path: inset(0); }
.lalla-knit__ball {
	position: absolute; left: 50%; bottom: 12px; width: 56px; height: 56px; margin-left: -28px; border-radius: 50%;
	background:
		repeating-linear-gradient(35deg, rgba(0, 0, 0, .22) 0 3px, transparent 3px 7px),
		repeating-linear-gradient(-55deg, rgba(255, 255, 255, .14) 0 2px, transparent 2px 8px),
		radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--yarn, #702D43) 70%, #fff), var(--yarn, #702D43) 55%, color-mix(in srgb, var(--yarn, #702D43) 55%, #000));
	box-shadow: 0 6px 10px -4px rgba(33, 29, 28, .4);
	opacity: 0;
}
.lalla-knit.is-knitting .lalla-knit__ball { animation: lalla-ball-in .45s var(--lalla-ease) forwards, lalla-ball-bob .5s .45s ease-in-out infinite alternate; }
.lalla-knit.is-knitting .lalla-knit__bag { animation: lalla-knit-up 1.25s .4s steps(14, end) forwards; }
.lalla-knit.is-done .lalla-knit__ball, .lalla-knit.is-error .lalla-knit__ball { opacity: 0; transition: opacity .2s; }
@keyframes lalla-ball-in { from { opacity: 0; transform: translate(-140px, 40px) rotate(-200deg); } to { opacity: 1; transform: none; } }
@keyframes lalla-ball-bob { from { opacity: 1; } to { opacity: 1; transform: translateY(-6px) rotate(18deg); } }
@keyframes lalla-knit-up { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0); } }
.lalla-knit__title { margin: 0 0 4px; font-family: var(--lalla-serif); font-size: 26px; line-height: 1.15; }
.lalla-knit__detail { margin: 0 0 18px; font-size: 13px; color: var(--lalla-ink-soft); }
.lalla-knit__actions { display: grid; gap: 10px; }
.lalla-knit__actions[hidden] { display: none; }
.lalla-knit__close { position: absolute; top: 8px; right: 8px; }
@media (prefers-reduced-motion: reduce) {
	.lalla-knit__bag { clip-path: inset(0); }
	.lalla-knit.is-knitting .lalla-knit__ball, .lalla-knit.is-knitting .lalla-knit__bag { animation: none; }
}

/* Mala torbica u uglu — vraća na sačuvanu kreaciju */
.lalla-mini {
	position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 45;
	display: grid; justify-items: center; gap: 2px; width: 76px; padding: 8px 6px 6px;
	background: var(--lalla-cream); border: 1px solid #DDD1BF; border-radius: 8px;
	box-shadow: 0 12px 24px -14px rgba(33, 29, 28, .45); text-decoration: none; color: var(--lalla-ink);
}
.lalla-mini[hidden] { display: none; }
.lalla-mini .lalla-bag { width: 52px; }
.lalla-mini__label { font: 500 10px/1.2 var(--lalla-sans); letter-spacing: .02em; text-align: center; }

/* Korpa: ilustracija kreacije i „Izmeni kombinaciju" */
.lalla-cart__thumb .lalla-bag--thumb { width: 88px; height: 110px; padding: 10px 8px; background: #F3ECE1; }
.lalla-cart__links { display: flex; gap: 16px; align-items: center; margin-top: 8px; }
.lalla-cart__links .lalla-cart__remove { margin-top: 0; }
html body.lalla .lalla-cart__edit {
	padding: 0; background: none; border: 0; border-radius: 0; color: var(--lalla-bordo); box-shadow: none; transform: none;
	font: 500 12px/1.4 var(--lalla-sans); letter-spacing: 0; text-transform: none; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
html body.lalla .lalla-cart__edit:hover, html body.lalla .lalla-cart__edit:focus { background: none; color: var(--lalla-ink); }
.lalla-cart__info .variation { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; margin: 2px 0 0; font-size: 12px; color: var(--lalla-ink-soft); }
.lalla-cart__info .variation dt, .lalla-cart__info .variation dd { margin: 0; }
.lalla-cart__info .variation dd p { margin: 0; }

/* ==========================================================================
   Dorada 24. 11.: torbica u središtu izbora, uzorci prediva, detalj pločice, animacija sklapanja
   ========================================================================== */
/* Prikaz: isto toplo svjetlo kao kartice kolekcije (svjetlije gore, toplije dole) */
@media (min-width: 768px) { .lalla-config { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.lalla-config__visual {
	background: radial-gradient(120% 80% at 50% 18%, #FBF8F3 0%, #F3ECE1 62%, #EADFD0 100%);
	border-color: #E4D9C8; box-shadow: inset 0 -24px 40px -36px rgba(33, 29, 28, .35);
	padding: 5% 7% 3%;
}
.lalla-config__visual .lalla-bag { filter: drop-shadow(0 18px 18px rgba(33, 29, 28, .12)); }
.lalla-config__summary { font-size: 22px; letter-spacing: .01em; }

/* Uvećan detalj pločice — samo u koraku „Pločica" */
.lalla-config__loupe {
	position: absolute; right: 5%; bottom: 5%; display: grid; place-items: center; width: 27%; aspect-ratio: 1;
	border-radius: 50%; background: radial-gradient(circle at 40% 35%, #FBF8F3, #EFE6DA); border: 1px solid #E4D9C8;
	box-shadow: 0 14px 26px -16px rgba(33, 29, 28, .45); opacity: 0; transform: scale(.94);
	transition: opacity 220ms ease, transform 260ms cubic-bezier(0.23, 1, 0.32, 1); pointer-events: none;
}
.lalla-config__visual.show-loupe .lalla-config__loupe { opacity: 1; transform: none; }
.lalla-config__loupe-plate {
	display: grid; place-items: center; width: 74%; aspect-ratio: 100 / 34; border-radius: 3px;
	background: linear-gradient(135deg, var(--plate1, #e8e2d8), var(--plate2, #bfb6a8) 55%, var(--plate1, #e8e2d8));
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45), 2px 4px 0 rgba(63, 19, 34, .25);
	font: 500 clamp(9px, 1.1vw, 14px)/1 var(--lalla-serif); letter-spacing: .28em; text-indent: .28em; color: #2b2216;
	transition: background .35s;
}

/* Uzorci prediva: tekstura namotaja u boji koja je i na torbici; izbor = dvostruki prsten + kvačica */
.lalla-opt__swatch {
	position: relative; width: 30px; height: 30px;
	background:
		repeating-linear-gradient(115deg, rgba(0, 0, 0, .2) 0 2px, transparent 2px 5px),
		repeating-linear-gradient(65deg, rgba(255, 255, 255, .16) 0 1px, transparent 1px 5px),
		radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--sw) 78%, #fff), var(--sw) 58%, color-mix(in srgb, var(--sw) 70%, #000));
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18);
}
html body.lalla .lalla-opt--swatch.is-selected .lalla-opt__swatch { box-shadow: 0 0 0 2px #FDFBF7, 0 0 0 3.5px var(--lalla-bordo); }
.lalla-opt--swatch.is-selected .lalla-opt__swatch::after,
.lalla-opt--plaque.is-selected .lalla-opt__plate::after {
	content: ""; position: absolute; right: -6px; top: -6px; width: 15px; height: 15px; border-radius: 50%;
	background: var(--lalla-bordo) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.4l2.6 2.4L12 5.4' fill='none' stroke='%23FAF7F2' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
	box-shadow: 0 0 0 1.5px #FDFBF7;
}
.lalla-opt__plate { position: relative; }
html body.lalla .lalla-opt.is-selected .lalla-opt__label { color: var(--lalla-bordo); }
html body.lalla .lalla-opt { transition: border-color .2s, box-shadow .2s, transform 140ms cubic-bezier(0.23, 1, 0.32, 1); }
html body.lalla .lalla-opt:active { transform: scale(.97); }

/* Animacija sklapanja: bordo klupko → bordo nit ocrtava siluetu → red po red izabrana boja i pločica */
.lalla-bag__trace { stroke: #702D43; opacity: 0; stroke-dasharray: 1; stroke-dashoffset: 1; }
.lalla-knit__ball { background:
	repeating-linear-gradient(35deg, rgba(0, 0, 0, .22) 0 3px, transparent 3px 7px),
	repeating-linear-gradient(-55deg, rgba(255, 255, 255, .14) 0 2px, transparent 2px 8px),
	radial-gradient(circle at 35% 30%, #a35a72, #702D43 55%, #3f1322); }
.lalla-knit__art { width: 220px; height: 246px; }
.lalla-knit__bag { clip-path: none; }
.lalla-knit__bag .lalla-bag__yarn, .lalla-knit__bag .lalla-bag__plaque { clip-path: inset(100% 0 0 0); }
.lalla-knit.is-done .lalla-knit__bag .lalla-bag__yarn, .lalla-knit.is-done .lalla-knit__bag .lalla-bag__plaque,
.lalla-knit.is-error .lalla-knit__bag .lalla-bag__yarn, .lalla-knit.is-error .lalla-knit__bag .lalla-bag__plaque { clip-path: inset(0); transition: clip-path .3s; }
.lalla-knit.is-knitting .lalla-knit__bag { animation: none; }
.lalla-knit.is-knitting .lalla-bag__trace { opacity: 1; animation: lalla-trace .85s .35s cubic-bezier(0.45, 0, 0.2, 1) forwards; }
.lalla-knit.is-knitting .lalla-knit__bag .lalla-bag__yarn,
.lalla-knit.is-knitting .lalla-knit__bag .lalla-bag__plaque { animation: lalla-knit-up .7s 1.05s steps(7, end) forwards; }
.lalla-knit.is-done .lalla-bag__trace { opacity: 0; transition: opacity .3s .1s; }
@keyframes lalla-trace { to { stroke-dashoffset: 0; } }
.lalla-knit.is-done .lalla-knit__art { animation: lalla-settle .4s cubic-bezier(0.23, 1, 0.32, 1); }
@keyframes lalla-settle { from { transform: scale(.97); } }
@media (prefers-reduced-motion: reduce) {
	.lalla-knit__bag .lalla-bag__yarn, .lalla-knit__bag .lalla-bag__plaque { clip-path: none !important; animation: none !important; }
	.lalla-knit .lalla-bag__trace { display: none; }
	.lalla-config__loupe { transition: none; }
}

/* Mala torbica u uglu: ne preko otvorenih prozora; na telefonu manja, iznad sigurne zone */
body.lalla-locked .lalla-mini { display: none; }
@media (max-width: 767px) {
	.lalla-config__visual { height: 26vh; max-height: 230px; }
	.lalla-config.is-step-shape .lalla-config__visual { height: 32vh; max-height: 280px; }
	.lalla-config__loupe { width: 30%; right: 3%; bottom: 4%; }
	.lalla-opt__swatch { width: 28px; height: 28px; }
	.lalla-mini { width: 60px; padding: 6px 4px 4px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); }
	.lalla-mini .lalla-bag { width: 40px; }
	.lalla-mini__label { font-size: 9px; }
}
