/*
 * 2026 design: screens 03 "Kategorija" (also every analysis: the shop page and "Analize"), 05 "Paketi"
 * (template-parts/sd/shop/*) and the add-to-cart button of product cards, rows and package cards (SdShop::add_button()).
 * Every selector starts with .sd-shop (the page wrapper of the screens) or .sd-shop-…
 */

/* ---------- "Dodaj" / "U korpi": the button holds both labels, the cart state shows one (any page) ---------- */
.sd-shop-add__in { display: none; }
.sd-shop-add.button_already_in_cart .sd-shop-add__add { display: none; }
.sd-shop-add.button_already_in_cart .sd-shop-add__in { display: inline; }
.sd-shop-add.sd-btn--incart, .sd-shop-add.sd-btn--incart:hover { background: var(--sd-teal); border-color: var(--sd-teal); color: #fff; }
.sd-shop-add.sd-btn--incart:hover { filter: brightness(.94); }
.sd-shop-add.loading, .sd-shop-add.disabled-buy { opacity: .6; pointer-events: none; }

.sd-shop .sd-old, .sd-shop-price .sd-old { opacity: 1 !important; } /* the old theme fades every <del> */

/* ---------- Shared by the screens ---------- */
/* #page is a column flexbox and .sd-wrap centres with auto margins, which would size the page to its content. */
.sd-shop { width: 100%; }
.sd-shop a:focus-visible, .sd-shop summary:focus-visible, .sd-shop select:focus-visible { outline: 3px solid #1a1a1a; outline-offset: 2px; }
.sd-shop .woocommerce-notices-wrapper:empty { display: none; }
.sd-shop-head { display: flex; flex-direction: column; gap: 8px; }
.sd-shop-intro { max-width: 720px; margin: 0; font-size: 15px; line-height: 1.55; }
.sd-shop-intro p { margin: 0; font-size: inherit; }
.sd-shop-group { display: flex; flex-direction: column; gap: 14px; }
.sd-shop-h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; padding-left: 12px; border-left: 4px solid var(--sd-orange); font-size: 20px; font-weight: 800; line-height: 1.15; color: var(--sd-ink); }

/* ---------- Screen 03: a category, or every analysis, as rows ---------- */
.sd-shop--list { display: flex; flex-wrap: wrap; gap: 40px; padding-top: 24px; padding-bottom: 56px; }
.sd-shop-side { flex: 1 1 220px; max-width: 260px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.sd-shop-side h2 { margin: 0; padding: 0 12px; font-size: 14px; font-weight: 700; line-height: 1.15; letter-spacing: .06em; text-transform: uppercase; color: var(--sd-muted); }
.sd-shop-tree { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.sd-shop .sd-shop-tree a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px; font-size: 14px; line-height: 1.4; color: var(--sd-ink); }
.sd-shop .sd-shop-tree a:hover { background: #f4f4f4; }
.sd-shop .sd-shop-tree a[aria-current] { background: var(--sd-orange-soft); color: var(--sd-orange-text); font-weight: 700; }
.sd-shop-tree span { flex: none; font-size: 12px; font-weight: 400; color: var(--sd-muted); }
.sd-shop-tree__pkg { margin-top: 8px; }
.sd-shop .sd-shop-tree__pkg a { color: var(--sd-orange-text); font-weight: 700; }
.sd-shop-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.sd-shop-main .sd-h1 { font-size: 34px; }
.sd-shop-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; padding: 14px 16px; border-radius: 12px; background: #fff8f0; }
.sd-shop-filters label { margin: 0; font-size: 13px; font-weight: 600; color: var(--sd-muted); }
.sd-shop-filters label.sd-shop-filters__sort { margin-left: auto; }
.sd-shop-filters select { display: inline-block; width: auto; max-width: 100%; height: 36px; margin: 0; padding: 0 34px 0 12px; border: 1px solid #d0d0d0; border-radius: 999px; background-color: #fff; background-position: right 12px center; box-shadow: none; font: inherit; font-size: 13px; line-height: 1.2; color: var(--sd-ink); }
/* The search field: a row of its own at the top of the filters, in the look of the header's search. Its clear link
   shows while the field holds text (:placeholder-shown), with or without the script; the browser's own one is hidden. */
.sd-shop-search { flex: 1 1 100%; display: flex; align-items: center; min-width: 0; height: 48px; padding: 0 4px; border: 1px solid var(--sd-orange); border-radius: 999px; background: #fff; box-sizing: border-box; }
.sd-shop-search:focus-within { border-color: var(--sd-orange-dark); box-shadow: 0 0 0 3px rgba(239, 125, 0, .25); }
.sd-shop-filters .sd-shop-search label { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; color: var(--sd-orange-text); cursor: text; }
.sd-shop-search input[type="search"] { flex: 1; min-width: 0; height: 100%; margin: 0; padding: 0 4px; border: 0; outline: 0; background: transparent; box-shadow: none; font: inherit; font-size: 15px; color: var(--sd-ink); -webkit-appearance: none; appearance: none; }
.sd-shop-search input[type="search"]::placeholder { color: var(--sd-muted); opacity: 1; }
.sd-shop-search input[type="search"]::-webkit-search-cancel-button { display: none; -webkit-appearance: none; }
.sd-shop .sd-shop-search__clear { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: var(--sd-muted); }
.sd-shop .sd-shop-search__clear:hover { background: var(--sd-soft); color: var(--sd-ink); }
.sd-shop-search input:placeholder-shown ~ .sd-shop-search__clear { display: none; }
.sd-shop-count { min-height: 1em; margin: 0; font-size: 13px; }
.sd-shop-rows { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; transition: opacity .15s; }
.sd-shop-main[aria-busy="true"] .sd-shop-rows { opacity: .5; }
.sd-shop-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 120px 150px 100px; align-items: center; gap: 16px; padding: 14px 18px; border: 1px solid var(--sd-line); border-radius: 12px; background: #fff; }
.sd-shop-row:hover { border-color: var(--sd-orange); }
.sd-shop .sd-shop-row__name > a { font-size: 16px; font-weight: 700; line-height: 1.25; color: var(--sd-ink); }
.sd-shop .sd-shop-row__name > a:hover { color: var(--sd-orange-dark); }
.sd-shop-row__pkg { margin-top: 2px; font-size: 12px; }
.sd-shop .sd-shop-row__pkg a { color: inherit; }
.sd-shop .sd-shop-row__pkg a:hover { color: var(--sd-orange-text); text-decoration: underline; }
.sd-shop-row__time { font-size: 13px; }
.sd-shop-row .sd-btn { justify-self: end; }
.sd-shop-none { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 24px; border: 1px dashed #d0d0d0; border-radius: 12px; }
.sd-shop-none p { margin: 0; font-size: 16px; line-height: 1.45; color: var(--sd-ink); }
.sd-shop-none__links { display: flex; flex-wrap: wrap; gap: 10px; }
.sd-shop-more { display: flex; justify-content: center; padding-top: 8px; }
.sd-shop-more:empty { display: none; }
.sd-shop-cta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-top: 12px; padding: 20px; border-radius: var(--sd-radius-lg); background: var(--sd-orange-soft); }
.sd-shop-cta strong { font-size: 16px; }
.sd-shop-cta .sd-muted { margin-top: 4px; font-size: 14px; }

/* ---------- Screen 05: packages ---------- */
.sd-shop-pkgs { display: flex; flex-direction: column; gap: 20px; }
.sd-shop-pkgs .sd-shop-head { max-width: 760px; }
.sd-shop-pkgs .sd-shop-intro { font-size: 16px; }
.sd-shop-pkgs .sd-shop-group { margin-top: 8px; }
.sd-shop-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sd-shop a.sd-shop-chip { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border: 1px solid #d0d0d0; border-radius: 999px; background: #fff; font-size: 13px; font-weight: 600; color: var(--sd-ink); }
.sd-shop a.sd-shop-chip:hover { border-color: var(--sd-orange); }
.sd-shop a.sd-shop-chip[aria-current] { border-color: var(--sd-orange); background: var(--sd-orange-soft); color: var(--sd-orange-text); }
.sd-shop-pkg { display: flex; flex-direction: column; }
.sd-shop-pkg__main { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-width: 0; }
.sd-shop-pkg__name { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.15; }
.sd-shop .sd-shop-pkg__name a { color: var(--sd-ink); }
.sd-shop .sd-shop-pkg__name a:hover { color: var(--sd-orange-dark); }
.sd-shop-pkg__list { width: 100%; font-size: 13px; line-height: 1.5; color: var(--sd-muted); }
.sd-shop-pkg__list summary { cursor: pointer; }
.sd-shop-pkg__list summary strong { font-weight: 600; }
.sd-shop-pkg__items { margin: 8px 0 0; padding-left: 18px; list-style: disc; font-size: 13px; line-height: 1.7; color: var(--sd-ink); }
.sd-shop .sd-shop-pkg__items a { color: var(--sd-ink); }
.sd-shop .sd-shop-pkg__items a:hover { color: var(--sd-orange-text); text-decoration: underline; }
.sd-shop-pkg__buy { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; margin-top: auto; }
.sd-shop-pkg__price .sd-price { font-size: 18px; }
.sd-shop-pkg--featured { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 20px; border-top: 4px solid var(--sd-orange); }
.sd-shop-pkg--featured .sd-shop-pkg__name { font-size: 20px; }
.sd-shop-pkg__time { font-size: 14px; }
.sd-shop-pkg--featured .sd-shop-pkg__price .sd-price { font-size: 24px; }
.sd-shop-pkg__contents { display: flex; flex-direction: column; gap: 8px; min-width: 0; font-size: 14px; }
.sd-shop-pkg__contents .sd-shop-pkg__items { margin: 0; columns: 2; column-gap: 24px; font-size: 14px; line-height: 1.8; }
.sd-shop-pkg__contents > .sd-muted { font-size: 12px; }

/* ---------- Responsive (design breakpoints: 900, 640; the rows: 1199) ---------- */
@media (max-width: 900px) {
  .sd-shop--list { gap: 20px; }
  .sd-shop-side { flex-basis: 100%; max-width: none; }
  .sd-shop-tree { flex-direction: row; gap: 6px; padding-bottom: 6px; overflow-x: auto; }
  .sd-shop .sd-shop-tree a { padding: 7px 12px; border: 1px solid #d0d0d0; border-radius: 999px; white-space: nowrap; }
  .sd-shop .sd-shop-tree a[aria-current] { border-color: var(--sd-orange); }
  .sd-shop-tree__pkg { margin-top: 0; }
}
/* The row of five columns takes 622 px beside the name (four tracks, gaps, padding, border). Beside the sidebar the list
   is at most 876 px wide (1200 px wrap), so the name keeps 220 px or more only from 1200 px, a desktop scrollbar
   included. Below that the compact row: the name, and the price above the button. */
@media (max-width: 1199px) {
  .sd-shop-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  .sd-shop-row__name { grid-row: span 2; }
  .sd-shop-row__sample, .sd-shop-row__time { display: none; }
  .sd-shop-row__price { justify-self: end; }
}
@media (max-width: 640px) {
  .sd-shop-pkg--featured { grid-template-columns: 1fr; }
  .sd-shop-pkg__contents .sd-shop-pkg__items { columns: 1; }
  .sd-shop-filters label.sd-shop-filters__sort { margin-left: 0; }
  /* On a phone the lists are 16 px (sante-design.css: iOS zooms into smaller fields), so a label and its list no
     longer fit side by side by their own widths, and the wrap parted "Sortiraj" from its list: two aligned columns,
     one label and its list to a row. */
  /* A list is 48 px wider than its chosen text (padding, arrow, border): 180 px holds the longest Serbian and English
     order ("Opadajuća cena" 120 px, "Price: low to high" 126 px at 16 px), the label column keeping its longest word.
     Russian needs 240 px ("Самые востребованные" 184 px): below 480 px each list goes under its label. */
  .sd-shop-filters { display: grid; grid-template-columns: minmax(0, auto) minmax(180px, 1fr); }
  html[lang^="ru"] .sd-shop-filters { grid-template-columns: minmax(0, auto) minmax(240px, 1fr); }
  .sd-shop-filters select { width: 100%; }
  .sd-shop-search { grid-column: 1 / -1; }
  .sd-shop-none { padding: 16px; }
  .sd-shop-cta .sd-btn, .sd-shop-none .sd-btn { width: 100%; }
}
@media (max-width: 479px) {
  html[lang^="ru"] .sd-shop-filters { grid-template-columns: minmax(0, 1fr); }
}
