/* Trio Kaden product page media (inc/product-media.php, assets/js/product-media.js). */

/* Gallery: video thumbnail gets a clear play button */
html body .woocommerce-product-gallery .flex-control-thumbs li.tk-thumb-video { position: relative; cursor: pointer; }
html body .woocommerce-product-gallery .flex-control-thumbs li.tk-thumb-video img { opacity: 1; aspect-ratio: 1 / 1; object-fit: cover; }
html body .woocommerce-product-gallery .flex-control-thumbs li.tk-thumb-video::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.2); border-radius: 6px; pointer-events: none; }
html body .woocommerce-product-gallery .flex-control-thumbs li.tk-thumb-video::after { content: ""; display: block; inset: auto; position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: var(--trio, #1B4388) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M9 7v10l8-5z'/%3E%3C/svg%3E") center / 20px no-repeat; box-shadow: 0 3px 10px rgba(0,0,0,.35); pointer-events: none; }

/* Desktop video lightbox */
html.tk-vlb-open { overflow: hidden; }
.tk-vlb { position: fixed; inset: 0; z-index: 100000; background: rgba(10,14,24,.88); display: flex; align-items: center; justify-content: center; padding: 56px 24px; }
.tk-vlb-in { position: relative; width: min(1120px, 100%, calc((100vh - 112px) * 16 / 9)); }
.tk-vlb-frame { aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.tk-vlb-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.tk-vlb-x { all: unset; position: absolute; right: -6px; top: -50px; width: 42px; height: 42px; border-radius: 50%; background: #fff; color: #111; font-size: 30px; line-height: 40px; text-align: center; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.tk-vlb-x:hover { transform: scale(1.06); }
.tk-vlb-x:focus-visible { outline: 3px solid var(--trio-soft, #8FA9DA); outline-offset: 2px; }

/* Horizontal track + dots */
.tk-scroller { display: grid; grid-auto-flow: column; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.tk-scroller::-webkit-scrollbar { display: none; }
.tk-scroller > * { scroll-snap-align: start; }
.tk-car-dots { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.tk-car-dots button { all: unset; width: 8px; height: 8px; border-radius: 8px; background: rgba(27,67,136,.25); cursor: pointer; transition: width .2s, background .2s; }
.tk-car-dots button.on { width: 22px; background: var(--trio, #1B4388); }
.tk-car-dots button:focus-visible { outline: 2px solid var(--trio, #1B4388); outline-offset: 3px; }
.tk-car-static .tk-car-dots { display: none; }

/* See it in action: desktop = one row, 3 cards per page; phones = one card at a time; dots below when there is more than one page */
.single-product .tk-sia { grid-column: 1 / -1; padding: 72px 0 24px; }
.single-product .tk-sia .wrap { position: relative; padding: 0; max-width: none; }
.tk-sia-head h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(26px, 3vw, 38px); margin: 0 0 28px; color: var(--ink, #1d1d1b); }
.tk-sia-car { position: relative; max-width: 1140px; }
.tk-sia-card { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; background: linear-gradient(160deg, #1B4388, #0c1a33); box-shadow: 0 8px 24px rgba(0,0,0,.12); text-decoration: none; }
.tk-sia-card img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.tk-sia-card:hover img { transform: scale(1.03); }
.tk-sia-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.45), transparent 40%); pointer-events: none; }
.tk-sia-play { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: rgba(255,255,255,.92) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%231B4388' d='M9 7v10l8-5z'/%3E%3C/svg%3E") 55% 50% / 34px no-repeat; box-shadow: 0 6px 18px rgba(0,0,0,.3); z-index: 1; transition: transform .15s; }
.tk-sia-card:hover .tk-sia-play, .tk-sia-card:focus-visible .tk-sia-play { transform: scale(1.08); }
.tk-sia-card:focus-visible { outline: 3px solid var(--trio, #1B4388); outline-offset: 3px; }
.tk-sia-src { position: absolute; left: 12px; bottom: 12px; z-index: 1; color: #fff; font: 600 12px/1 var(--sans, Inter, sans-serif); letter-spacing: .04em; padding: 6px 10px; border-radius: 999px; background: rgba(0,0,0,.55); }
@media (min-width: 769px) {
  .tk-sia-track { grid-auto-columns: calc((100% - 48px) / 3); column-gap: 24px; }
  .tk-sia-track > * { scroll-snap-align: none; }
  .tk-sia-track > :nth-child(3n+1) { scroll-snap-align: start; } /* Snap a page (3 cards) at a time. */
}
@media (max-width: 768px) {
  .single-product .tk-sia { padding: 48px 0 8px; }
  .tk-sia-track { grid-auto-columns: 78%; column-gap: 12px; }
  .tk-sia-card { aspect-ratio: 9 / 16; }
  .tk-sia-fill { display: none; }
  .tk-sia-head h2 { margin-bottom: 18px; }
}
