/* Živý náhled na stránce produktu (ozdob-front.js) */
.ozd-preview { margin: 0 0 1.25em; max-width: 360px; }
.ozd-preview__title { font-weight: 600; margin-bottom: .35em; }
.ozd-preview__stage { position: relative; background: #f6f1e8; border-radius: 8px; padding: 10px; min-height: 160px;
  display: flex; align-items: center; justify-content: center; transition: opacity .15s; }
.ozd-preview__stage svg { display: block; width: 100%; height: auto; max-height: 420px; }
.ozd-preview__stage.is-ghost { opacity: .55; }
.ozd-preview__stage.is-error svg { opacity: .35; }
.ozd-preview__loading { color: #7a6a55; font-size: .9em; }
.ozd-preview__msg { font-size: .9em; margin-top: .4em; min-height: 1.2em; color: #5a4a3a; }
.ozd-preview__msg.is-error { color: #b00020; }
.ozd-preview__msg.is-warn { color: #8a5a00; }

/* Pole za příplatek schovaná za odkaz (#2044, collapseExtras) */
.wapf-field-container.ozd-extra-hidden { display: none !important; }
.ozd-more-fields { width: 100%; margin: 0 0 14px; }
.ozd-more-fields__btn { background: none; border: 0; padding: 6px 0; margin: 0; min-height: 36px; font: inherit; font-weight: 600;
  color: inherit; text-decoration: underline; text-underline-offset: 3px; text-transform: none; letter-spacing: 0; cursor: pointer; }

/* Foto ozdoba (#1763): výběr fotky, ořez, úpravy */
.ozd-photo { margin: .6em 0 0; }
.ozd-photo__btn { margin: 0 0 .5em; }
.ozd-photo__tools { display: grid; gap: .35em; max-width: 300px; }
.ozd-photo__crop { width: 100%; height: auto; border-radius: 4px; cursor: grab; touch-action: none; background: #eee; }
.ozd-photo__tools label { display: flex; align-items: center; gap: .5em; font-size: .9em; margin: 0; }
.ozd-photo__tools input[type=range] { flex: 1; }
.ozd-photo__hint, .ozd-photo__consent { font-size: .82em; color: #6b5a4a; margin: .3em 0 0; }
/* #2558: textová pole foto produktu leží pod ořezem → miniatura živého náhledu vedle pole (jako řádky sady) */
.wapf-field-input.ozd-has-thumb { display: flex; align-items: center; gap: 8px; }
.wapf-field-input.ozd-has-thumb > input { flex: 1 1 auto; min-width: 0; }
.ozd-field-thumb { flex: 0 0 64px; display: flex; align-items: center; justify-content: center; }
.ozd-field-thumb svg { display: block; width: 100%; height: auto; max-height: 72px; filter: drop-shadow(0 2px 3px rgba(63,42,28,.2)); }
.ozd-field-thumb.is-ghost svg { opacity: .45; }

/* Mobil (#1795): náhled + pole musí být vidět nad klávesnicí; ořez vedle náhledu na jedné obrazovce; dotykové cíle ≥ 36 px */
@media (max-width: 549px) {
  .ozd-preview { max-width: none; }
  .ozd-preview__stage { padding: 6px; min-height: 120px; }
  .ozd-preview__stage svg { max-height: 36vh; }
  .ozd-photo__tools { max-width: none; }
  .ozd-photo__crop { max-width: 240px; justify-self: center; }
  .ozd-photo__tools input[type=range] { height: 36px; }
  form.cart .ux-quantity__button { min-width: 40px; }
}

/* Sada visaček (#2045, ozdob-sada.js): náhled = mřížka kusů, řádky jméno + tvar, cena s množstevní slevou */
#ozd-preview.ozd-preview--set .ozd-preview__stage { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 8px;
  align-items: center; max-width: none; min-height: 110px; background: transparent; }
/* náhled delší sady roluje uvnitř: tenký viditelný posuvník + stín se šipkou u spodní hrany (#2135) */
#ozd-preview.ozd-preview--set .ozd-preview__stage { scrollbar-width: thin; scrollbar-color: #c9b697 transparent; }
.ozd-sada__more { position: relative; z-index: 1; height: 30px; margin: -30px 0 0; pointer-events: none; border-radius: 0 0 8px 8px;
  background: linear-gradient(to bottom, rgba(63, 42, 28, 0), rgba(63, 42, 28, .22)); }
.ozd-sada__more[hidden] { display: none; }
.ozd-sada__more::before { content: ''; position: absolute; left: 50%; bottom: 4px; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(63, 42, 28, .35); }
.ozd-sada__more::after { content: ''; position: absolute; left: 50%; bottom: 13px; width: 7px; height: 7px; margin-left: -4.5px;
  border-right: 2px solid #3f2a1c; border-bottom: 2px solid #3f2a1c; transform: rotate(45deg); }
#ozd-preview.ozd-preview--set .ozd-preview__stage[data-count="1"] { grid-template-columns: minmax(0, 190px); justify-content: center; }
#ozd-preview.ozd-preview--set .ozd-preview__stage[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ozd-sada__tile { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: center; aspect-ratio: 1; cursor: pointer;
  border-radius: 6px; padding: 2px; transition: opacity .15s; min-height: 0 !important; margin: 0 !important; }
.ozd-sada__tile:focus-visible { outline: 2px solid #4f6b58; }
#ozd-preview.ozd-preview--set .ozd-sada__tile svg { display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; margin: 0; }
.ozd-sada__tile.is-ghost { opacity: .45; }
.ozd-sada__tile.is-error { opacity: .35; outline: 2px dashed #b00020; }
.ozd-sada { margin: 0 0 16px; }
.ozd-sada__head { font-family: Marcellus, Georgia, serif; font-size: 1.25rem; color: #3f2a1c; margin: 0 0 12px; line-height: 1.25; }
.ozd-sada__head small { display: block; font-family: "Source Sans 3", sans-serif; font-size: .9rem; color: #6b5545; margin-top: 2px; }
.ozd-sada__row { display: grid; grid-template-columns: 72px minmax(0, 1fr) 36px; gap: 6px 8px; align-items: center; margin: 0 0 10px; }
.ozd-sada__thumb { grid-row: 1 / 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.ozd-sada__thumb svg { display: block; width: 100%; height: auto; max-height: 70px; filter: drop-shadow(0 2px 3px rgba(63,42,28,.2)); }
.ozd-sada__thumb small { font-size: .7rem; color: #6b5545; line-height: 1.1; text-align: center; }
.ozd-sada__thumb.is-ghost svg { opacity: .45; }
.single-product form.cart .ozd-sada__name { margin: 0; width: 100%; min-width: 0; height: 44px; }
.ozd-sada__row.is-error .ozd-sada__name { border-color: #b00020 !important; }
.ozd-sada__count { grid-column: 2; grid-row: 1; justify-self: end; align-self: center; padding-right: 10px; font-size: .78rem; color: #8a7461; pointer-events: none; white-space: nowrap; }
.ozd-sada__count.is-full { color: #7e5330; font-weight: 600; }
.single-product form.cart .ozd-sada__row .ozd-sada__name { grid-column: 2; grid-row: 1; padding-right: 58px; }
.ozd-sada__shapes { display: flex; gap: 4px; grid-column: 2 / -1; grid-row: 2; }
.ozd-sada__shape { all: unset; box-sizing: border-box; flex: 1 1 0; max-width: 52px; height: 44px; padding: 4px; border: 1px solid #d9ccb6; border-radius: 4px; background: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center; min-height: 0 !important; margin: 0 !important; }
.ozd-sada__shape svg { display: block; width: 100%; height: 100%; }
.ozd-sada__shape:hover { border-color: #7e5330; }
.ozd-sada__shape.is-on { border-color: #4f6b58; box-shadow: 0 0 0 2px #4f6b58; background: #f3ece0; }
.ozd-sada__shape:focus-visible { outline: 2px solid #4f6b58; outline-offset: 2px; }
.ozd-sada__del { all: unset; box-sizing: border-box; width: 36px; height: 44px; text-align: center; font-size: 1.5rem; line-height: 44px; color: #8a7461; cursor: pointer;
  border-radius: 4px; min-height: 0 !important; margin: 0 !important; }
.ozd-sada__del:hover { color: #b00020; background: #f3ece0; }
.ozd-sada__del[hidden] { display: block; visibility: hidden; }
.ozd-sada__err { grid-column: 2 / -1; grid-row: 3; color: #b00020; font-size: .88rem; }
.ozd-sada__err:empty { display: none; }
.single-product form.cart .ozd-sada__add { margin: 2px 0 16px 80px; background: #fff; color: #3f2a1c; border: 1px dashed #7e5330; border-radius: 4px; font-weight: 600;
  text-transform: none; letter-spacing: 0; min-height: 44px; padding: 0 18px; box-shadow: none; }
.single-product form.cart .ozd-sada__add:hover { background: #f3ece0; }
.single-product form.cart .ozd-sada__add[disabled] { opacity: .5; cursor: not-allowed; }
.ozd-sada__price { background: #f3ece0; border: 1px solid #eadfcb; border-radius: 4px; padding: 12px 14px; margin: 0 0 8px; }
.ozd-sada__sum { font-size: 1.15rem; color: #3f2a1c; }
.ozd-sada__sum strong { font-size: 1.35rem; color: #7e5330; }
.ozd-sada__sum small { font-size: .9rem; color: #6b5545; }
.ozd-sada__saved { color: #3d5646; font-weight: 600; font-size: .95rem; margin-top: 2px; }
.ozd-sada__nudge { color: #6b5545; font-size: .92rem; margin-top: 4px; }
.ozd-sada__tiers { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0 0 4px; padding: 0; }
.ozd-sada__tiers li { margin: 0 !important; padding: 6px 4px; border: 1px solid #eadfcb; border-radius: 4px; text-align: center; font-size: .82rem; color: #6b5545; line-height: 1.3; background: #fff; }
.ozd-sada__tiers li span, .ozd-sada__tiers li b, .ozd-sada__tiers li i { display: block; font-style: normal; }
.ozd-sada__tiers li b { color: #3f2a1c; font-size: .98rem; }
.ozd-sada__tiers li i { color: #3d5646; font-weight: 600; }
.ozd-sada__tiers li.is-on { border-color: #4f6b58; box-shadow: 0 0 0 1px #4f6b58; background: #eef3ef; }
/* právě upravovaná visačka je v náhledu větší (u delší sady jsou dlaždice malé) */
#ozd-preview.ozd-preview--set .ozd-preview__stage .ozd-sada__tile.is-active { grid-column: span 2; grid-row: span 2; background: #fff; box-shadow: 0 0 0 1px #d9ccb6; }
/* sada má dlouhý text ceny („39 Kč za kus, od 5 ks levněji“) → na mobilu pod nadpis, ne vedle něj */
@media (max-width: 849px) {
  .single-product .product-info:has(#ozd-sada) > h1.product-title { grid-column: 1 / -1; margin-bottom: 4px; }
  .single-product .product-info:has(#ozd-sada) > .price-wrapper { grid-column: 1 / -1; align-self: start; }
  .single-product .product-info:has(#ozd-sada) > .price-wrapper .price { white-space: normal; }
}
/* desktop: náhled vlevo (drží se při rolování dlouhého seznamu), řádky + cena + tlačítko vpravo */
@media (min-width: 850px) {
  .single-product form.cart.ozd-sada-form > .ozd-sada { grid-column: 2 / 4; grid-row: 1; }
  .single-product form.cart.ozd-sada-form > .single_add_to_cart_button { grid-column: 2 / 4; grid-row: 2; }
  .single-product form.cart.ozd-sada-form > #ozd-preview { position: sticky; top: 90px; align-self: start; grid-row: 1 / 3; }
  /* cena, stupně a tlačítko v přilepeném panelu náhledu – na očích i u dlouhé sady */
  #ozd-preview.ozd-preview--set .ozd-preview__stage { max-height: calc(100vh - 590px); min-height: 120px; overflow-y: auto; }
  #ozd-preview.ozd-preview--set .ozd-preview__stage[data-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #ozd-preview.ozd-preview--set .ozd-preview__stage[data-cols="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  #ozd-preview.ozd-preview--set .ozd-preview__stage[data-cols="6"] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .ozd-sada__dock { margin-top: 10px; }
  .ozd-sada__dock .ozd-sada__price { margin-bottom: 6px; padding: 10px 12px; }
  .ozd-sada__dock .ozd-sada__tiers { margin-bottom: 8px; }
  .single-product form.cart .ozd-sada__dock .single_add_to_cart_button { display: block; width: 100%; margin: 0; }
}
@media (max-width: 549px) {
  .ozd-sada__row { grid-template-columns: 64px minmax(0, 1fr) 36px; margin-bottom: 14px; }
  .ozd-sada__shapes { grid-column: 2 / -1; grid-row: 2; }
  .ozd-sada__shape { flex: 1 1 0; max-width: 52px; }
  .ozd-sada__add { margin-left: 72px !important; }
  #ozd-preview.ozd-preview--set .ozd-preview__stage { max-height: 34vh; overflow-y: auto; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ozd-sada__tiers li { font-size: .76rem; }
}

/* Sada jako balíček (#2048, Celá rodina): velký hlavní kus nahoře, přidané kusy pod ním; řádek = jméno + popisek, bez výběru tvaru */
#ozd-preview.ozd-preview--bundle .ozd-sada__tile.is-head { grid-column: 1 / -1; justify-self: center; width: 50%; }
#ozd-preview.ozd-preview--bundle .ozd-preview__stage[data-count="2"] .ozd-sada__tile.is-head { grid-column: auto; width: 100%; }
.ozd-sada__note { grid-column: 2 / -1; grid-row: 2; font-size: .85rem; color: #6b5545; line-height: 1.2; margin-top: -2px; }
.ozd-sada--bundle .ozd-sada__row.is-head { padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid #eadfcb; }
.ozd-sada__add[hidden] { display: none !important; }
.ozd-sada__sum strong { white-space: nowrap; }
@media (max-width: 549px) {
  #ozd-preview.ozd-preview--bundle .ozd-preview__stage { max-height: none; overflow: visible; }
  #ozd-preview.ozd-preview--bundle .ozd-sada__tile.is-head { width: 42%; }
  #ozd-preview.ozd-preview--bundle .ozd-sada__tile.is-item { width: 80%; justify-self: center; }
}
