/*
 * Katalog jako na Papírnictví (Papirnictvi/default _extend.less: .pap-tree, .pap-cat-hero, .pap-card, …),
 * barvy teno.cz místo červené Papírnictví:
 *   akcent #0184c2 (záložky menu), tmavý #016aa0, nadpisy #1c3761, odkazy #0a5c7a, text #383838,
 *   tlumený #71808b, skladem #297842, linky #e3e7ee / mřížka #d5dbe3, podklad ikon #eef4f6.
 *   Tlačítko „Do košíku“ = modrý přechod tlačítek teno.cz (#55c8dc → #0184c2).
 */

/* ---------- Strom kategorií (levý panel) ---------- */
.teno-tree { overflow: hidden; margin-bottom: 30px; border: 1px solid #e3e7ee; background: #fff; font-size: 14px; }
.teno-tree ul { list-style: none; margin: 0; padding: 0; }
.teno-tree li { margin: 0; }
.teno-tree a, .teno-tree a:hover { text-decoration: none; }
.teno-tree__title { margin: 0; padding: 14px 18px; background: linear-gradient(#55c8dc 0%, #55c8dc 8%, #0184c2 100%); color: #fff; font-size: 17px; font-weight: 700; }
.teno-tree__item { border-top: 1px solid #e3e7ee; }
.teno-tree__item:first-child { border-top: 0; }
.teno-tree__row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px 0 12px; list-style: none; cursor: pointer; transition: background .15s ease; }
.teno-tree__row::-webkit-details-marker { display: none; }
.teno-tree__row:hover { background: #f2f4f7; }
/* Ikony jsou bílé (ze záložek menu teno.cz) → modrý podklad jako záložky */
.teno-tree__icon { flex: none; width: 28px; height: 28px; padding: 5px; box-sizing: border-box; border-radius: 4px; background: linear-gradient(#55c8dc 0%, #0184c2 100%); object-fit: contain; }
.teno-tree details[open] > .teno-tree__row .teno-tree__icon { background: #016aa0; }
.teno-tree__top { flex: 1; padding: 10px 0; color: #1c3761; font-size: 13px; font-weight: 600; line-height: 1.25; }
.teno-tree__row:hover .teno-tree__top, .teno-tree__top:hover { color: #0184c2; }
.teno-tree details[open] > .teno-tree__row { background: #eef7fc; box-shadow: inset 3px 0 0 #0184c2; }
.teno-tree details[open] > .teno-tree__row .teno-tree__top { color: #0184c2; }
.teno-tree__all { display: block; padding: 4px 0 8px 12px; color: #0a5c7a; font-size: 12px; font-weight: 600; }
.teno-tree__all:after { content: ' →'; }
.teno-tree__all:hover { color: #0184c2; }
.teno-tree__sub { padding: 6px 0 12px !important; background: #fcfcfd; border-top: 1px solid #e3e7ee; }
.teno-tree__sub > li { padding: 0 18px; }
.teno-tree__l2 { display: block; padding: 7px 0 7px 12px; border-left: 2px solid transparent; color: #383838; font-weight: 600; font-size: 14px; line-height: 1.3; }
.teno-tree__l2:hover { border-left-color: #0184c2; color: #0184c2; }
.teno-tree__l3 { margin: 0 0 6px 12px !important; padding-left: 12px !important; border-left: 1px solid #e3e7ee; }
.teno-tree__l3 a { display: block; padding: 4px 0; color: #71808b; font-size: 13px; line-height: 1.3; }
.teno-tree__l3 a:before { content: '–'; margin-right: 6px; color: #b6bdc8; }
.teno-tree__l3 a:hover { color: #0184c2; }
.teno-tree a.is-current { color: #0184c2; font-weight: 700; }

/* ---------- Záhlaví kategorie ---------- */
.teno-cat-hero { display: flex; align-items: center; gap: 24px; margin: 0 0 20px; padding: 0 0 20px; border-bottom: 1px solid #e3e7ee; }
.teno-cat-hero__copy { flex: 1; min-width: 0; }
.teno-cat-hero__eyebrow { margin: 0 0 8px; color: #0a5c7a; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.teno-cat-hero__title { margin: 0 0 10px; color: #1c3761; font-size: 30px; font-weight: 700; line-height: 1.15; }
.teno-cat-hero__text { max-width: 62ch; margin: 0 0 14px; color: #4b5563; font-size: 15px; line-height: 1.55; }
.teno-cat-hero__text p { margin: 0 0 6px; }
.teno-cat-hero__link { color: #0a5c7a; font-size: 14px; font-weight: 700; }
.teno-cat-hero__link:after { content: ' →'; }
.teno-cat-hero__link:hover { color: #0184c2; text-decoration: none; }
.teno-cat-hero__art { display: none; }

/* ---------- Panel nástrojů ---------- */
.teno-catalog .toolbar-products { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; padding: 10px 14px; border: 1px solid #e3e9ec; border-radius: 10px; background: #f7f9fa; }
.teno-catalog .toolbar-products .modes, .teno-catalog .toolbar-products .toolbar-amount, .teno-catalog .toolbar-products .toolbar-sorter,
.teno-catalog .toolbar-products .limiter, .teno-catalog .toolbar-products .pages { float: none; margin: 0; padding: 0; }
.teno-catalog .toolbar-products .modes { display: none; }
/* řazení vlevo, počet produktů vpravo */
.teno-catalog .toolbar-products .toolbar-sorter { order: -1; margin-right: auto; }

/* ---------- „Načíst dalších N produktů“ ---------- */
.teno-load-more { display: flex; justify-content: center; margin: 28px 0 8px; }
.teno-load-more[hidden] { display: none; }
.teno-load-more__btn { min-width: 280px; padding: 12px 24px; border: 1px solid #0184c2; border-radius: 5px; background: #fff; color: #0184c2; font-size: 15px; font-weight: 600; cursor: pointer; }
.teno-load-more__btn:hover, .teno-load-more__btn:focus { background: #0184c2; color: #fff; }
.teno-load-more__btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- Karty produktů (oddělené tenkými linkami) ---------- */
.teno-products .product-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; padding: 0; border-top: 1px solid #d5dbe3; }
.teno-products .product-item { position: relative; }
.teno-products .product-item:after, .teno-products .product-item:before { content: ''; position: absolute; z-index: 3; background: #d5dbe3; pointer-events: none; }
.teno-products .product-item:after { left: 0; right: 0; bottom: 0; height: 1px; }
.teno-products.products-grid .product-item:not(:nth-child(2n)):before { top: 0; right: 0; bottom: 0; width: 1px; }
.page-wrapper .teno-products .product-item { width: auto; margin: 0; padding: 0; }

.teno-card { position: relative; display: flex; flex-direction: column; height: 100%; box-sizing: border-box; padding: 12px; border: 0; background: #fff; }
.teno-card .product-item-photo { display: block; margin-bottom: 10px; }
.teno-card .product-image-container { display: block; width: 100% !important; height: auto !important; aspect-ratio: auto !important; }
.teno-card .product-image-wrapper { height: 0 !important; padding-bottom: 60% !important; }
.teno-card .product-image-photo { top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; }
.teno-card .product-item-details { display: flex; flex: 1; flex-direction: column; }
.teno-card .product-item-name { display: block; margin: 0 0 8px; font-size: 14px; font-weight: 700; line-height: 1.3; }
.teno-card .product-item-name a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: #1c3761; }
.teno-card .product-item-name a:hover { color: #0184c2; text-decoration: none; }
.teno-card .product-item-inner { margin-top: 10px; }
.teno-card .product-item-actions { display: block; margin: 0; }
.teno-card .product-item-actions .actions-primary { display: block; width: 100%; }
.teno-card .action.tocart { width: 100%; min-height: 36px; padding: 6px 12px; border: 0; border-radius: 5px; background: linear-gradient(#55c8dc 0%, #55c8dc 8%, #0184c2 100%); color: #fff; font-size: 14px; font-weight: 700; box-shadow: none; }
.teno-card .action.tocart:hover { background: linear-gradient(#4697bd 0%, #4697bd 8%, #0184c2 100%); color: #fff; }

.teno-card__links { position: absolute; top: 10px; right: 10px; z-index: 2; display: flex; gap: 4px; }
.teno-card__links .action { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: rgba(255, 255, 255, .92); color: #71808b; }
.teno-card__links .action span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.teno-card__links .action:before { font-family: 'luma-icons'; font-size: 18px; line-height: 32px; color: inherit; }
.teno-card__links .action:hover { color: #0184c2; }

.teno-stock-pill { display: inline-flex; align-items: center; align-self: flex-start; gap: 6px; margin-bottom: 8px; padding: 2px 9px; border-radius: 999px; background: #e8f6ee; color: #297842; font-size: 12px; font-weight: 700; }
.teno-stock-pill:before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.teno-stock-pill.is-out { background: #fdf1e6; color: #aa621d; }

.teno-card__price { display: flex; flex-direction: column; margin-top: auto; }
.teno-card__price strong { color: #1c3761; font-size: 21px; line-height: 1.1; }
.teno-card__price del { color: #71808b; font-size: 13px; }
.teno-card__price span { margin-top: 1px; color: #71808b; font-size: 12px; }
.teno-card__detail { display: block; padding: 10px 0 2px; color: #0a5c7a; font-weight: 700; }
.teno-card__detail:after { content: ' →'; }
.teno-card__detail:hover { color: #0184c2; text-decoration: none; }

/* ---------- Tablet a výš (≥ 768 px): Luma přidává kartám efekty a skryté akce ---------- */
@media (min-width: 768px) {
    .page-wrapper .teno-products.products .product-items .product-item { width: auto; margin: 0; padding: 0; }
    .page-wrapper .teno-products .product-item-info.teno-card,
    .page-wrapper .teno-products .product-item-info.teno-card:hover,
    .page-wrapper .teno-products .product-item-info.teno-card.active { width: auto; margin: 0 !important; padding: 14px !important; border: 0 !important; box-shadow: none !important; background: #fff !important; z-index: auto; }
    .page-wrapper .teno-products .teno-card .product-item-inner { position: static !important; display: block !important; width: 100% !important; height: auto !important; margin: 10px 0 0 !important; padding: 0 !important; overflow: visible !important; border: 0 !important; box-shadow: none !important; background: none !important; }
    .page-wrapper .teno-products .teno-card .product-item-actions,
    .page-wrapper .teno-products .teno-card .product-item-actions .actions-primary,
    .page-wrapper .teno-products .teno-card .product-item-actions form { display: block !important; width: 100% !important; margin: 0 !important; }
    .teno-cat-hero__art { display: flex; flex: none; order: -1; align-items: center; justify-content: center; width: 200px; height: 150px; padding: 8px; box-sizing: border-box; border: 1px solid #e3e7ee; background: #fff; }
    .teno-cat-hero__art img { display: block; width: 100%; height: 100%; object-fit: contain; }
}

/* ---------- Desktop (≥ 1024 px): 3 sloupce ---------- */
@media (min-width: 1024px) {
    .teno-products.products-grid .product-items { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .teno-products.products-grid .product-item:nth-child(n):before { top: 0; right: 0; bottom: 0; width: 1px; }
    .teno-products.products-grid .product-item:nth-child(3n):before { display: none; }
}

/* ---------- Mobil (< 768 px): strom je v MENU, zboží hned pod hlavičkou ---------- */
@media (max-width: 767px) {
    .sidebar-main .teno-tree { display: none; }
    .teno-cat-hero__title { font-size: 24px; }
}

/* ---------- Cenový posuvník ve filtru (Magento_LayeredNavigation::layer/filter.phtml) ---------- */
.teno-price-slider { padding: 6px 2px 4px; }
.teno-price-slider__values { display: flex; gap: 8px; margin-bottom: 14px; }
.teno-price-slider__values label { display: flex; flex: 1 1 0; flex-direction: column; gap: 3px; min-width: 0; margin: 0; color: #71808b; font-size: 11px; font-weight: 400; }
.teno-price-slider__values label span { color: #1c3761; font-weight: 600; }
.teno-price-slider__foot { flex-wrap: wrap; }
.teno-price-slider__values input { width: 100%; min-width: 0; height: 32px; padding: 0 6px; box-sizing: border-box; border: 1px solid #d5dbe3; border-radius: 6px; color: #243c4b; font-size: 13px; text-align: right; box-shadow: none; -moz-appearance: textfield; }
.teno-price-slider__values input::-webkit-outer-spin-button, .teno-price-slider__values input::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; }
.teno-price-slider__values input:focus { border-color: #0184c2; box-shadow: 0 0 0 3px rgba(1, 132, 194, .15); }
.teno-price-slider__track { position: relative; height: 26px; margin: 0 9px; }
.teno-price-slider__track::before { content: ''; position: absolute; left: 0; right: 0; top: 11px; height: 4px; border-radius: 2px; background: #e3e7ee; }
.teno-price-slider__range { position: absolute; top: 11px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, #55c8dc, #0184c2); }
.teno-price-slider__track input[type="range"] { position: absolute; left: -9px; right: -9px; top: 0; width: calc(100% + 18px); height: 26px; margin: 0; padding: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.teno-price-slider__track input[type="range"]::-webkit-slider-runnable-track { height: 26px; background: none; }
.teno-price-slider__track input[type="range"]::-moz-range-track { height: 26px; background: none; }
.teno-price-slider__track input[type="range"]::-webkit-slider-thumb { width: 18px; height: 18px; margin-top: 4px; border: 3px solid #0184c2; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(20, 70, 91, .25); cursor: grab; pointer-events: auto; -webkit-appearance: none; }
.teno-price-slider__track input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border: 3px solid #0184c2; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(20, 70, 91, .25); cursor: grab; pointer-events: auto; }
.teno-price-slider__track input[type="range"]:focus { outline: none; }
.teno-price-slider__track input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(1, 132, 194, .25); }
.teno-price-slider__foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 11px; color: #8a9ba5; }
.teno-price-slider__foot a { color: #0a5c7a; font-weight: 600; }
.teno-price-slider__foot .teno-price-slider__apply { margin-left: auto; padding: 6px 14px; border: 0; border-radius: 6px; background: linear-gradient(#55c8dc, #0184c2); color: #fff; font-size: 12px; font-weight: 700; box-shadow: none; }
.teno-price-slider__foot .teno-price-slider__apply:hover { filter: brightness(1.06); }