/* Svitlo UX 1.2.0 — stage 5.3: catalogue + product page (Preview). Visual only. Uses the variables of svitlo-ux.css. */
html.sux-lock, html.sux-lock body { overflow: hidden; }

/* ---------- catalogue head / toolbar ---------- */
.sux-cat-head { margin: 4px 0 14px; }
.sux-cat-title { margin: 0 0 10px; font-size: 26px; line-height: 1.2; }
.sux-cat-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin: 0 0 10px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.sux-cat-chips a, .sux-fg__links a {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px;
  border: 1px solid var(--sux-line); border-radius: 19px; background: #fff; color: #1f2937; font-size: 14px; text-decoration: none; white-space: nowrap;
}
.sux-cat-chips a span, .sux-fg__links a span { color: #6b7280; font-size: 12px; }
.sux-cat-bar { display: flex; align-items: center; gap: 10px; }
.sux-filter-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--sux-brand); border-radius: var(--sux-radius); background: #fff; color: var(--sux-brand); font-weight: 700; font-size: 15px; cursor: pointer;
}
.sux-filter-btn b { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--sux-brand); color: #fff; font-size: 12px; }
.sux-active { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sux-chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 10px; border-radius: 16px; background: #e8f0f8; color: var(--sux-brand); font-size: 13px; text-decoration: none; }
.sux-chip--reset { background: transparent; text-decoration: underline; }
.woocommerce .woocommerce-result-count { margin: 0 0 12px; font-size: 14px; color: #4b5563; line-height: 44px; }
.woocommerce .woocommerce-ordering { margin: 0 0 12px; }
.woocommerce .woocommerce-ordering select.orderby { min-height: 44px; font-size: 15px; border-radius: var(--sux-radius); border: 1px solid var(--sux-line); padding: 0 34px 0 12px; max-width: 100%; }
@media (max-width: 767px) {
  .sux-cat-title { font-size: 22px; }
  .woocommerce .woocommerce-result-count, .woocommerce .woocommerce-ordering { float: none; width: 100%; }
  .woocommerce .woocommerce-result-count { line-height: 1.4; margin-bottom: 8px; }
  .woocommerce .woocommerce-ordering select.orderby { width: 100%; }
}

/* ---------- product grid: equal cards, buttons aligned ---------- */
.woocommerce ul.products { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 24px; padding: 0; }
.woocommerce ul.products::before, .woocommerce ul.products::after { display: none !important; }
@media (min-width: 768px) { .woocommerce ul.products { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1200px) { .woocommerce ul.products { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; } }
.woocommerce ul.products li.product {
  display: flex !important; flex-direction: column; width: auto !important; float: none !important; margin: 0 !important; clear: none !important;
  padding: 10px; border: 1px solid #eef1f4; border-radius: var(--sux-radius); background: #fff; box-sizing: border-box; min-width: 0;
}
.woocommerce ul.products li.product a.woocommerce-LoopProduct-link { display: flex; flex-direction: column; flex: 1 1 auto; color: inherit; }
.woocommerce ul.products li.product img { aspect-ratio: 1 / 1; object-fit: contain; width: 100%; height: auto; margin: 0 0 8px !important; background: #fff; }
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  font-size: 14px !important; line-height: 1.35 !important; min-height: calc(1.35em * 3); margin: 0 0 6px !important; padding: 0 !important;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-align: left;
}
.woocommerce ul.products li.product .price { font-size: 17px !important; font-weight: 700; margin: 0 0 4px !important; text-align: left; display: block; }
.woocommerce ul.products li.product .price del { font-size: 13px; font-weight: 400; color: #6b7280; }
.woocommerce ul.products li.product > *:not(a) { text-align: left; }
.sux-card-specs { font-size: 12px; color: #4b5563; margin: 0 0 4px; line-height: 1.3; }
.sux-avail { font-size: 12px; font-weight: 600; margin: 4px 0 8px; display: flex; align-items: center; gap: 6px; }
.sux-avail::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.sux-avail--in { color: var(--sux-ok); }
.sux-avail--back { color: #b45309; }
.sux-avail--wait { color: #1d4ed8; }
.sux-avail--out { color: #6b7280; }
.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product .svitloe-custom-cart-btn {
  margin-top: auto !important; width: 100%; min-height: 42px; display: flex !important; align-items: center; justify-content: center;
  box-sizing: border-box; border-radius: var(--sux-radius); font-size: 14px; padding: 8px 10px; text-transform: none; line-height: 1.2;
}
.woocommerce ul.products li.product .add_to_cart_button { display: none !important; }   /* snippet 19 hides it too: never two buttons */
.woocommerce ul.products li.product .button.product_type_simple:not(.add_to_cart_button) { background: #fff !important; color: var(--sux-brand) !important; border: 1px solid var(--sux-brand) !important; }
.woocommerce nav.woocommerce-pagination ul li a, .woocommerce nav.woocommerce-pagination ul li span { min-width: 44px; min-height: 44px; line-height: 44px; padding: 0 6px; }

/* ---------- filter drawer ---------- */
.sux-filter[hidden] { display: none !important; }
.sux-filter { position: fixed; inset: 0; z-index: 100000; }
.sux-filter__backdrop { position: absolute; inset: 0; background: rgba(17, 24, 39, .45); opacity: 0; transition: opacity .2s; }
.sux-filter__sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 88vh; display: flex; flex-direction: column;
  background: #fff; border-radius: 14px 14px 0 0; transform: translateY(100%); transition: transform .2s ease; box-shadow: 0 -8px 30px rgba(0, 0, 0, .18);
}
.sux-filter.is-open .sux-filter__backdrop { opacity: 1; }
.sux-filter.is-open .sux-filter__sheet { transform: none; }
@media (min-width: 768px) {
  .sux-filter__sheet { top: 0; right: auto; width: 380px; max-height: none; border-radius: 0; transform: translateX(-100%); }
}
.sux-filter__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #eef1f4; }
.sux-filter__head h2 { margin: 0; font-size: 19px; }
.sux-filter__x { width: 44px; height: 44px; border: 0; background: transparent; font-size: 20px; cursor: pointer; color: #374151; }
.sux-filter__body { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 16px 12px; overscroll-behavior: contain; }
.sux-fg { padding: 12px 0; border-bottom: 1px solid #eef1f4; }
.sux-fg:last-child { border-bottom: 0; }
.sux-fg h3 { margin: 0 0 8px; font-size: 15px; }
.sux-fg__links { display: flex; flex-wrap: wrap; gap: 8px; }
.sux-fg__opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; }
.sux-opt { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 8px; border: 1px solid var(--sux-line); border-radius: var(--sux-radius); cursor: pointer; font-size: 14px; line-height: 1.2; }
.sux-opt input { width: 18px; height: 18px; margin: 0; accent-color: var(--sux-brand); flex: 0 0 auto; }
.sux-opt span { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.sux-opt small { color: #6b7280; font-size: 12px; }
.sux-opt:has(input:checked) { border-color: var(--sux-brand); background: #e8f0f8; }
.sux-opt--switch { border: 0; padding: 0; min-height: 44px; font-weight: 600; }
.sux-price { display: flex; align-items: center; gap: 8px; }
.sux-price input { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 10px; font-size: 16px; border: 1px solid var(--sux-line); border-radius: var(--sux-radius); }
.sux-filter__foot { display: flex; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid #eef1f4; background: #fff; }
.sux-filter__reset { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 16px; border: 1px solid var(--sux-line); border-radius: var(--sux-radius); color: #374151; text-decoration: none; font-weight: 600; }
.sux-filter__apply { flex: 1 1 auto; min-height: 48px; border: 0; border-radius: var(--sux-radius); background: var(--sux-brand); color: #fff; font-weight: 700; font-size: 16px; cursor: pointer; }
.sux-filter__apply.is-loading { opacity: .75; }
.sux-filter__apply.is-empty, .sux-filter__apply[disabled] { background: #9ca3af; cursor: not-allowed; }

/* ---------- product page: order and readability (CSS only, no DOM moves) ---------- */
.single-product div.product .summary { display: flex; flex-direction: column; }
.single-product div.product .summary > * { order: 8; }
.single-product div.product .summary > .product_title { order: 1; }
.single-product div.product .summary > .price { order: 2; }
.single-product div.product .summary > div:not([class]) { order: 3; }   /* «Дрібний опт» line of svitlo-small-wholesale */
.single-product div.product .summary > .sux-avail--single { order: 4; }
.single-product div.product .summary > form.cart, .single-product div.product .summary > .stock { order: 5; }
.single-product div.product .summary > .woocommerce-product-details__short-description, .single-product div.product .summary > .sux-more { order: 6; }
.single-product div.product .summary > .product_meta { order: 9; }
.single-product div.product .summary > .price { font-size: 26px; font-weight: 700; margin: 4px 0 6px; }
.single-product div.product .summary > div:not([class]) { margin: 0 0 6px; padding: 8px 12px; border-radius: var(--sux-radius); background: #eef7ee; }
.sux-avail--single { font-size: 15px; margin: 2px 0 12px; }
.single-product div.product form.cart { margin: 0 0 16px; }
.sux-clamp { max-height: 240px; overflow: hidden; position: relative; }
.sux-clamp::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 64px; background: linear-gradient(rgba(255, 255, 255, 0), #fff); }
.sux-more { align-self: flex-start; margin: 4px 0 14px; min-height: 40px; padding: 0 14px; border: 1px solid var(--sux-line); border-radius: var(--sux-radius); background: #fff; color: var(--sux-brand); font-weight: 600; cursor: pointer; }
@media (max-width: 767px) {
  .single-product div.product .product_title { font-size: 21px !important; line-height: 1.3 !important; }
  .single-product div.product .woocommerce-product-gallery__image img { max-height: 340px; width: auto !important; margin: 0 auto; object-fit: contain; }
  .single-product div.product .woocommerce-product-gallery { margin-bottom: 14px !important; }
  .single-product div.product .flex-control-thumbs { display: flex; gap: 6px; overflow-x: auto; }
  .single-product div.product .flex-control-thumbs li { flex: 0 0 64px; width: 64px !important; }
}

/* fixes after the first visual check */
@media (max-width: 767px) {
  body.woocommerce.archive #content.site-content, body.woocommerce-page.archive #content.site-content { padding-left: 16px !important; padding-right: 16px !important; box-sizing: border-box; }
}
.sux-filter__x { border: 0 !important; box-shadow: none !important; background: transparent !important; padding: 0 !important; color: #374151 !important; }
.sux-filter__apply { white-space: nowrap; font-size: 15px; padding: 0 12px; }
.sux-filter__reset { padding: 0 14px; }

/* the buy/details button is always the last row of a card (pre-order «Доступний з …» and other notes go above it) */
.woocommerce ul.products li.product > .button, .woocommerce ul.products li.product > .svitloe-custom-cart-btn { order: 30; }
.woocommerce ul.products li.product > * { order: 10; }
.woocommerce ul.products li.product > a.woocommerce-LoopProduct-link { order: 1; }

/* product page: the theme title bar says «Shop» above the breadcrumbs — keep the breadcrumbs, hide that word */
.single-product .cspt-title-bar-wrapper .cspt-tbar-title { display: none !important; }
@media (max-width: 767px) {
  .single-product .cspt-title-bar-wrapper .cspt-title-bar-content, .single-product .cspt-title-bar-wrapper .cspt-title-bar-content-inner { min-height: 0 !important; padding-top: 6px !important; padding-bottom: 6px !important; }
}
