/* Korpa, dialozi, checkout */
.scrim { position: fixed; inset: 0; background: rgba(5, 18, 13, .55); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .45s var(--ease); z-index: 90; }
.scrim.show { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--ivory); z-index: 100; display: flex; flex-direction: column; transform: translateX(104%); transition: transform .55s var(--ease), visibility 0s .55s; visibility: hidden; box-shadow: -30px 0 70px -20px rgba(0, 0, 0, .45); border-left: 1px solid var(--line); }
.drawer.open { transform: none; visibility: visible; transition: transform .55s var(--ease); }
.drawer__head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px 14px 26px; border-bottom: 1px solid rgba(18, 55, 42, .1); }
.drawer__head h2 { font-size: 1.8rem; color: var(--forest); margin: 0; }
.drawer__head h2 span { font-size: 1rem; color: var(--muted); font-family: var(--sans); }
.ship { position: relative; padding: 12px 26px 16px; font-size: .8rem; color: var(--forest); background: #fff; border-bottom: 1px solid rgba(18, 55, 42, .08); }
.ship i { display: block; height: 4px; border-radius: 4px; background: rgba(18, 55, 42, .1); margin-top: 8px; overflow: hidden; position: relative; }
.ship i::after { content: ''; position: absolute; inset: 0; width: var(--p, 0%); background: linear-gradient(90deg, var(--botanical), var(--gold)); border-radius: 4px; transition: width .7s var(--ease); }
.drawer__items { list-style: none; margin: 0; padding: 8px 26px; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.drawer__empty { text-align: center; padding: 70px 10px; color: var(--muted); }
.drawer__empty svg { width: 54px; height: 54px; margin: 0 auto 14px; fill: none; stroke: var(--gold); stroke-width: 1.2; }
.line, .co__line { display: grid; grid-template-columns: 76px 1fr auto; gap: 14px; padding: 16px 0; border-bottom: 1px solid rgba(18, 55, 42, .08); align-items: start; animation: lineIn .5s var(--ease); }
@keyframes lineIn { from { opacity: 0; transform: translateX(20px); } }
.line__img { width: 76px; aspect-ratio: 1; background: radial-gradient(#fbf8ee, #ece6d1); border-radius: 14px; overflow: hidden; }
.line__img svg, .line__img img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.line__info h3 { font: 500 1.08rem/1.2 var(--serif); margin: 0 0 2px; color: var(--forest); }
.line__pack { font-size: .76rem; color: var(--muted); display: block; margin-bottom: 8px; }
.line__end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.line__end strong { font: 500 1.05rem var(--serif); color: var(--forest); white-space: nowrap; }
.qty { display: inline-flex; align-items: center; border: 1px solid rgba(18, 55, 42, .2); border-radius: 999px; background: #fff; }
.qty button { width: 36px; height: 36px; border: 0; background: transparent; border-radius: 50%; display: grid; place-items: center; transition: background .2s; }
.qty button:hover { background: rgba(212, 175, 112, .25); }
.qty svg { width: 14px; height: 14px; fill: none; stroke: var(--forest); stroke-width: 2; stroke-linecap: round; }
.qty output { min-width: 28px; text-align: center; font-weight: 500; }
.qty--sm button { width: 30px; height: 30px; }
.drawer__foot { padding: 16px 26px calc(20px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(18, 55, 42, .1); background: #fff; display: grid; gap: 10px; }
.promo { display: flex; gap: 8px; }
.promo input { flex: 1; min-width: 0; height: 42px; border-radius: 999px; border: 1px solid rgba(18, 55, 42, .2); padding: 0 16px; font: inherit; font-size: .9rem; text-transform: uppercase; }
.promo input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(212, 175, 112, .25); }
.promo__msg { color: #a33b2b; font-size: .8rem; margin: 0; min-height: 0; }
.promo__msg:empty { display: none; }
.promo__ok { display: flex; justify-content: space-between; font-size: .82rem; color: var(--botanical); }
.promo__ok:empty { display: none; }
.promo__ok button { background: none; border: 0; text-decoration: underline; color: var(--muted); }
.sum { margin: 0; display: grid; gap: 6px; font-size: .92rem; }
.sum > div { display: flex; justify-content: space-between; gap: 12px; }
.sum dt { color: var(--muted); } .sum dd { margin: 0; }
.sum__total { padding-top: 10px; border-top: 1px solid var(--line); font: 500 1.4rem var(--serif); color: var(--forest); }
.sum__total dt { color: inherit; }
#rowDisc[hidden] { display: none; }

/* Dialozi */
.dlg { border: 0; padding: 0; background: var(--ivory); color: var(--ink); border-radius: 24px; width: min(920px, calc(100% - 24px)); max-height: calc(100dvh - 24px); box-shadow: var(--shadow-lg); overflow: auto; overscroll-behavior: contain; }
.dlg::backdrop { background: rgba(5, 18, 13, .62); backdrop-filter: blur(5px); }
.dlg[open] { animation: dlgIn .5s var(--ease); }
@keyframes dlgIn { from { opacity: 0; transform: translateY(24px) scale(.98); } }
.dlg__x { position: absolute; right: 12px; top: 12px; z-index: 3; background: rgba(255, 255, 255, .8); }
.detail { display: grid; grid-template-columns: 1fr 1.1fr; position: relative; }
.detail__media { background: radial-gradient(80% 70% at 50% 40%, #fbf8ee, #e9e2c9); display: grid; place-items: center; min-height: 320px; padding: 24px; }
.detail__media svg, .detail__media img { width: 100%; max-height: 440px; object-fit: contain; }
.detail__info { padding: 38px 36px 32px; }
.detail__title { font-size: 2.2rem; color: var(--forest); margin: 6px 0 4px; }
.detail__price { font: 500 1.8rem var(--serif); color: var(--forest); margin-bottom: 14px; }
.detail__price small { font: 400 .85rem var(--sans); color: var(--muted); }
.detail__list { margin: 18px 0; display: grid; gap: 10px; font-size: .88rem; }
.detail__list div { display: grid; grid-template-columns: 150px 1fr; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid rgba(18, 55, 42, .08); }
.detail__list dt { color: var(--muted); } .detail__list dd { margin: 0; }
.detail__warn { font-size: .78rem; color: var(--muted); background: rgba(212, 175, 112, .15); border-left: 2px solid var(--gold); padding: 10px 14px; border-radius: 0 10px 10px 0; }
.detail__buy { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.demo-tag { font-size: .72rem; background: var(--gold); color: var(--emerald); padding: 1px 8px; border-radius: 99px; font-style: normal; }

/* Checkout */
.dlg--full { width: min(1140px, calc(100% - 24px)); height: min(900px, calc(100dvh - 24px)); }
.co__head { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: 14px 22px; background: var(--emerald); color: var(--champagne); }
.co__head .logo svg { width: 24px; height: 24px; }
.co__head .logo span { font-size: 1.3rem; }
.co__head .icon-btn:hover { background: rgba(255, 255, 255, .1); }
.co { padding: 26px clamp(16px, 3vw, 36px) 36px; }
.steps { list-style: none; display: flex; justify-content: center; gap: 0; padding: 0; margin: 0 0 30px; counter-reset: s; }
.steps li { flex: 1; max-width: 220px; text-align: center; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); position: relative; }
.steps li span { display: grid; place-items: center; width: 36px; height: 36px; margin: 0 auto 8px; border-radius: 50%; border: 1px solid rgba(18, 55, 42, .25); background: #fff; font: 500 1rem var(--serif); position: relative; z-index: 1; transition: all .4s var(--ease); }
.steps li::before { content: ''; position: absolute; top: 18px; left: -50%; width: 100%; height: 1px; background: rgba(18, 55, 42, .2); }
.steps li:first-child::before { display: none; }
.steps li.done::before, .steps li.active::before { background: var(--gold); }
.steps li.active { color: var(--forest); font-weight: 600; }
.steps li.active span { background: var(--forest); color: var(--gold); border-color: var(--forest); box-shadow: 0 0 0 5px rgba(212, 175, 112, .3); }
.steps li.done span { background: var(--gold); border-color: var(--gold); color: var(--emerald); }
.co__grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 30px; align-items: start; }
.co__main { background: #fff; border-radius: var(--r); padding: 28px 30px; border: 1px solid rgba(18, 55, 42, .08); box-shadow: var(--shadow); }
.co__step h2 { font-size: 1.9rem; color: var(--forest); margin-bottom: 14px; outline: none; }
.co__lines { list-style: none; padding: 0; margin: 0; }
.co__empty { padding: 30px; text-align: center; color: var(--muted); }
.co__aside { position: relative; }
.co__sticky { position: sticky; top: 76px; background: var(--forest); color: var(--champagne); border-radius: var(--r); padding: 26px 26px 22px; box-shadow: var(--shadow-lg); }
.co__sticky h3 { font-size: 1.5rem; color: #fff; }
.co__sticky .sum dt { color: rgba(238, 225, 197, .7); }
.co__sticky .sum__total { color: var(--gold); border-color: rgba(212, 175, 112, .4); }
.sum__items { list-style: none; padding: 0 0 12px; margin: 0 0 12px; border-bottom: 1px solid rgba(212, 175, 112, .25); font-size: .84rem; display: grid; gap: 6px; }
.sum__items li { display: flex; justify-content: space-between; gap: 10px; }
.co__nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.co__nav .btn[hidden] { display: none; }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; }
.field { position: relative; }
.field--wide { grid-column: 1 / -1; }
.field input, .field textarea { width: 100%; border: 1px solid rgba(18, 55, 42, .2); border-radius: 14px; background: var(--ivory); padding: 24px 16px 8px 46px; font: inherit; font-size: .98rem; color: var(--ink); transition: border-color .3s, box-shadow .3s, background .3s; resize: vertical; }
.field textarea { min-height: 92px; padding-top: 28px; }
.field label { position: absolute; left: 46px; top: 17px; font-size: .95rem; color: var(--muted); pointer-events: none; transform-origin: left top; transition: transform .25s var(--ease), color .25s; }
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label { transform: translateY(-10px) scale(.76); color: #9a7a3e; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--gold); background: #fff; box-shadow: 0 0 0 4px rgba(212, 175, 112, .28); }
.field__icon { position: absolute; left: 14px; top: 16px; color: var(--botanical); transition: color .3s; }
.field textarea ~ .field__icon { top: 16px; }
.field__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.field input:focus ~ .field__icon, .field textarea:focus ~ .field__icon { color: var(--gold); }
.field.valid input, .field.valid textarea { border-color: rgba(67, 104, 80, .6); }
.field.invalid input, .field.invalid textarea { border-color: #b34a39; background: #fff8f6; }
.err { display: block; color: #a33b2b; font-size: .78rem; min-height: 0; padding: 4px 4px 0; }
.err:empty { display: none; }

.pay { border: 0; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; }
.pay__opt { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border: 1px solid rgba(18, 55, 42, .2); border-radius: 14px; cursor: pointer; transition: border-color .3s, background .3s; }
.pay__opt.is-on { border-color: var(--gold); background: rgba(212, 175, 112, .1); }
.pay__opt.is-off { opacity: .55; cursor: not-allowed; }
.pay__opt small { display: block; color: var(--muted); font-size: .8rem; }
.pay__opt input { margin-top: 5px; accent-color: var(--forest); }
.review__box { background: var(--ivory); border-radius: 14px; padding: 16px 20px; margin-bottom: 18px; }
.review__box h4 { font: 600 .74rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #9a7a3e; margin-bottom: 8px; }
.review__box p { margin: 0 0 4px; font-size: .92rem; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: .88rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--forest); flex: none; }
.demo-note { background: #fff6dc; border: 1px dashed #c79f5b; border-radius: 12px; padding: 12px 16px; font-size: .84rem; margin-top: 16px; }
#coSubmit.loading span { opacity: 0; }
#coSubmit.loading::before { content: ''; position: absolute; width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(11, 36, 28, .25); border-top-color: var(--emerald); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.success { text-align: center; max-width: 560px; margin: 40px auto; padding: 20px; }
.success__mark { width: 96px; height: 96px; margin: 0 auto 20px; fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.success__mark circle { stroke-dasharray: 227; stroke-dashoffset: 227; animation: draw 1s var(--ease) forwards; }
.success__mark path { stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .6s .7s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.btn--wa { background: #25D366; color: #06331a; box-shadow: 0 8px 22px -10px rgba(37, 211, 102, .9); margin: 6px 0 12px; }
.btn--wa:hover { background: #1fbe5a; }
.btn--vb { background: #7360F2; color: #fff; box-shadow: 0 8px 22px -10px rgba(115, 96, 242, .9); margin: 0 0 12px; }
.btn--vb:hover { background: #6350e0; }
.success .btn--wa, .success .btn--vb { display: flex; max-width: 360px; margin-inline: auto; }
.success h2 { font-size: 2.6rem; color: var(--forest); }
.success__num { font-size: 1.1rem; } .success__num b { font: 500 1.5rem var(--serif); color: var(--forest); letter-spacing: .06em; }
.success__flag { display: inline-block; background: #fff6dc; border: 1px dashed #c79f5b; color: #7a5a1c; padding: 4px 14px; border-radius: 99px; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 12px; }

@media (max-width: 860px) {
  .detail { grid-template-columns: 1fr; }
  .detail__media { min-height: 0; height: 250px; padding: 14px; overflow: hidden; }
  .detail__media svg, .detail__media img { height: 222px; max-height: 222px; width: auto; max-width: 100%; margin: 0 auto; object-fit: contain; }
  .detail__info { padding: 24px 20px 24px; }
  .detail__list div { grid-template-columns: 1fr; gap: 2px; }
  .dlg:not(.dlg--full) { width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; border-radius: 24px 24px 0 0; }
  .dlg--full { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .co__grid { grid-template-columns: 1fr; }
  .co__aside { order: -1; }
  .co__sticky { position: static; padding: 18px 20px; }
  .co__main { padding: 20px 16px; }
  .fields { grid-template-columns: 1fr; }
  .co__nav { position: sticky; bottom: -37px; background: #fff; margin: 22px -16px -20px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(18, 55, 42, .1); z-index: 2; }
  .co__nav .btn { flex: 1; }
  #coSubmit { width: 100%; flex-basis: 100%; }
  .steps li { font-size: .66rem; letter-spacing: .04em; }
}
