/*
 * 2026 design, screen 04 "Analiza" (design/Analiza.dc.html): single analysis or package,
 * template-parts/sd/product/single.php. Every rule is scoped under .sd-product; the two body:has() rules at the end
 * apply only while that page's fixed order bar exists. Breakpoints of the design: 900px and 640px.
 */

/* ---------- Layout: head and body in the left column, the order column on the right ---------- */
.sd-product__grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: auto 1fr; grid-template-areas: "head aside" "body aside"; gap: 28px 40px; align-items: start; }
.sd-product__head { grid-area: head; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sd-product__aside { grid-area: aside; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.sd-product__body { grid-area: body; display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.sd-product__section { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sd-product .woocommerce-notices-wrapper:not(:empty) { margin-bottom: 16px; }
/* The old stylesheet removes every focus outline (:focus { outline: none !important }). */
.sd-product a:focus-visible, .sd-product button:focus-visible { outline: 3px solid #1a1a1a !important; outline-offset: 2px; }

/* ---------- Head ---------- */
.sd-product__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.sd-product .sd-product__title { font-size: 38px; overflow-wrap: anywhere; }
.sd-product .sd-product__title--long { font-size: 26px; line-height: 1.25; }
.sd-product__intro { max-width: 680px; font-size: 16px; line-height: 1.6; color: var(--sd-muted); }
.sd-product__intro p, .sd-product__guide p, .sd-product__steps .sd-faq p { margin: 0 0 .6em; font-size: inherit; line-height: inherit; }
/* !important: product descriptions carry inline margins tuned for the old page (some negative). */
.sd-product__intro > :last-child, .sd-product__guide > :last-child, .sd-product__steps .sd-faq div > :last-child, .sd-product__prose > :last-child { margin-bottom: 0 !important; }

/* ---------- Body ---------- */
.sd-product__media { margin: 0; }
.sd-product__media img { display: block; width: 100%; max-height: 340px; object-fit: cover; border-radius: var(--sd-radius-lg); }
.sd-product__info { display: flex; flex-direction: column; gap: 14px; }
.sd-product__info .sd-kv { grid-template-columns: 180px minmax(0, 1fr); margin: 14px 0; line-height: 1.25; } /* the design keeps the list's default margins; 180px fits the attribute label */
.sd-product__prose { font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.sd-product__prose p { margin: 0 0 .9em; font-size: inherit; line-height: inherit; }
.sd-product__prose h1, .sd-product__prose h2, .sd-product__prose h3, .sd-product__prose h4 { margin: 1.3em 0 .5em !important; font-size: 18px !important; font-weight: 800; line-height: 1.25; }
.sd-product__prose > :first-child { margin-top: 0 !important; }
.sd-product__prose ul, .sd-product__prose ol { margin: 0 0 .9em; padding-left: 20px; }
.sd-product__prose img { border-radius: var(--sd-radius); }
.sd-product__list { list-style: none; margin: 0; padding: 0; }
.sd-product__list li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 0; border-top: 1px solid var(--sd-line); font-size: 14px; }
.sd-product__list li:first-child { padding-top: 0; border-top: 0; }
.sd-product__list li > :first-child { min-width: 0; color: var(--sd-ink); font-weight: 600; }
.sd-product__list li > :nth-child(2) { flex: none; white-space: nowrap; }
.sd-product__sum { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--sd-line); font-size: 13px; line-height: 1.5; color: var(--sd-muted); }
.sd-product a.sd-product__pack { display: flex; justify-content: space-between; align-items: center; gap: 16px; color: var(--sd-ink); background: #fff8f0; border-color: #f3d2ad; }
.sd-product a.sd-product__pack:hover { color: var(--sd-ink); border-color: var(--sd-orange); }
.sd-product__pack strong { font-size: 16px; line-height: 1.25; }
.sd-product__pack .sd-muted { display: block; margin-top: 4px; font-size: 13px; line-height: 1.3; }
.sd-product__pack-price { flex: none; text-align: right; white-space: nowrap; }
.sd-product__pack-price .sd-muted { font-size: 12px; }
/* Names of up to 200 characters would make a row of cards as tall as its longest name. */
.sd-product__section .sd-pcard__name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
/* "Često se naručuje zajedno": an amount never breaks inside; the list price goes above the online price when both do not
   fit. Beside the order card (901-1199 px) four cards would be 78 to 148 px inside, too narrow for a name or a price:
   two a row there (206 px and more). */
.sd-product__section .sd-pcard .sd-shop-price { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; }
.sd-product__section .sd-pcard .sd-shop-price > * { white-space: nowrap; }
.sd-product__section .sd-pcard .sd-shop-price .sd-old { margin-right: 0; }
@media (min-width: 901px) and (max-width: 1199px) {
  .sd-product .sd-g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.sd-product__steps { gap: 4px; }
.sd-product__steps .sd-h2 { margin-bottom: 8px; }
.sd-product__steps .sd-faq div { font-size: 14px; line-height: 1.55; }
.sd-product__steps .sd-faq ul { margin: 0 0 .6em; padding-left: 18px; }
.sd-product__more { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin-top: 4px; font-size: 14px; font-weight: 700; }

/* ---------- Order card ---------- */
.sd-product__order { display: flex; flex-direction: column; gap: 14px; padding: 24px; border-color: #f3d2ad; box-shadow: 0 8px 24px rgba(0, 0, 0, .06); }
.sd-product__order > .sd-tag { order: 1; align-self: flex-start; }
.sd-product__buy { display: contents; } /* desktop: price and button are items of the card; phone: the fixed bar */
.sd-product__price { order: 2; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.sd-product__price .sd-price { font-size: 34px; line-height: 1.1; }
.sd-product__price .sd-old { order: 1; margin: 0; font-size: 16px; }
.sd-product__time, .sd-product__fee { order: 3; margin: 0; font-size: 13px; line-height: 1.5; color: var(--sd-muted); }
.sd-product__time { margin-top: -6px; font-weight: 600; color: var(--sd-ink); }
.sd-product__add, .sd-product__incart { order: 4; height: 52px; font-size: 16px; }
.sd-product__add.loading { opacity: .6; pointer-events: none; }
.sd-product a.added_to_cart, .sd-product:not(.is-in-cart) .sd-product__incart, .sd-product.is-in-cart .sd-product__add { display: none; }
.sd-product__row { order: 5; display: flex; align-items: center; gap: 10px; }
.sd-product__now { flex: 1; min-width: 0; }
.sd-product__checks { order: 6; list-style: none; margin: 0; padding: 6px 0 0; border-top: 1px solid #eee; display: flex; flex-direction: column; gap: 8px; font-size: 13px; line-height: 1.25; color: var(--sd-muted); }
.sd-product__checks li { display: flex; align-items: center; gap: 8px; }
.sd-product__checks .sd-icon { color: var(--sd-green); }
.sd-product__checks a { color: var(--sd-muted); text-decoration: underline; }
.sd-product__checks a:hover { color: var(--sd-ink); }

/* YITH wishlist button (markup arrives by AJAX; sd-product.js names it for assistive technology) */
.sd-product__wish { flex: none; width: 44px; height: 44px; }
.sd-product__wish .yith-wcwl-add-to-wishlist, .sd-product__wish .yith-wcwl-add-button { display: block; height: 100%; margin: 0; }
.sd-product .sd-product__wish a { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1.5px solid var(--sd-orange); border-radius: 999px; background: #fff; color: var(--sd-orange-text); font-size: 0; }
.sd-product .sd-product__wish a:hover { background: var(--sd-orange-soft); color: var(--sd-orange-text); opacity: 1; }
.sd-product .sd-product__wish .exists a, .sd-product .sd-product__wish a.delete_item { border-color: var(--sd-teal); background: var(--sd-teal); color: #fff; }
.sd-product .sd-product__wish a svg.yith-wcwl-icon-svg, .sd-product .sd-product__wish a img { width: 20px; height: 20px; margin: 0; }

/* Analysis code and the site's preparation note */
.sd-product__meta { display: flex; flex-direction: column; gap: 8px; background: var(--sd-soft); border-color: #ececec; font-size: 13px; line-height: 1.5; }
.sd-product__meta strong { font-size: 14px; }
.sd-product__meta strong:not(:first-child) { margin-top: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  /* One column: head, order card, body, then the analysis code and preparation note. */
  .sd-product__grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: none; }
  .sd-product__aside { display: contents; }
  .sd-product__head { grid-area: auto; order: 1; }
  .sd-product__order { order: 2; }
  .sd-product__body { grid-area: auto; order: 3; }
  .sd-product__meta { order: 4; }
  /* The order card stays in the page; its price and button become the fixed bar (as on the old product page). */
  .sd-product__buy { display: flex; align-items: center; gap: 12px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background: #fff; border-top: 1px solid var(--sd-line); box-shadow: 0 -6px 20px rgba(0, 0, 0, .08); }
  .sd-product__price { flex: none; flex-direction: column; align-items: flex-start; gap: 0; }
  .sd-product__price .sd-price { font-size: 22px; }
  .sd-product__price .sd-old { order: 0; font-size: 13px; }
  .sd-product__add, .sd-product__incart { flex: 1; min-width: 0; height: 48px; padding: 0 12px; font-size: 15px; }
  body:has(.sd-product__buy) { padding-bottom: 72px; }
  body:has(.sd-product__buy) .top-button { bottom: 88px; }
}
@media (max-width: 640px) {
  .sd-product .sd-product__title { font-size: 28px; }
  .sd-product .sd-product__title--long { font-size: 21px; }
  .sd-product__order { padding: 20px; }
  .sd-product__info .sd-kv { grid-template-columns: minmax(0, 1fr); row-gap: 2px; }
  .sd-product__info .sd-kv dd { margin-bottom: 10px; }
  .sd-product__info .sd-kv dd:last-child { margin-bottom: 0; }
  .sd-product a.sd-product__pack { flex-direction: column; align-items: flex-start; gap: 8px; }
  .sd-product__pack-price { text-align: left; white-space: normal; }
}
