/* Local behavior and rendering for the static Kingsound storefront. */
html { scroll-behavior: smooth; }
body { overflow-x: hidden; }
button, [role="button"] { cursor: pointer; }
#shopline-section-header { position: sticky; top: 0; z-index: 50; background: #fff; }
.header--desktop { box-shadow: 0 2px 7px rgba(0,0,0,.055); }
.ks-scrolled .header--desktop .header__action-menu { height: 66px !important; }
.ks-scrolled .header--desktop .header__logo { height: 62px !important; width: 80px !important; }
.ks-scrolled .header--desktop .header__logo img { height: 60px !important; width: 80px !important; object-fit: contain; }
.ks-scrolled .header--desktop .header__container { height: auto !important; }
.ks-scrolled .header--desktop { height: auto !important; }
.slideshow__list .slideshow__item { width: 100% !important; position: absolute !important; top: 0; left: 0; opacity: 0; visibility: hidden; transition: opacity .45s ease, visibility .45s ease; }
.slideshow__list .slideshow__item.ks-active { opacity: 1; visibility: visible; z-index: 2; }
.slideshow__list { position: absolute !important; inset: 0; }
.slideshow__indicator { z-index: 5; position: relative; }
.slideshow__indicator-button { cursor: pointer; }
.slideshow__page-button.ks-current { background: #ed7728 !important; border-color: #ed7728 !important; }
.product-list__product .product-item { height: 100%; }
.product-list__product img { display: block; }
.ks-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.52); z-index: 190; opacity: 0; pointer-events: none; transition: opacity .25s; }
.ks-backdrop.ks-visible { opacity: 1; pointer-events: auto; }
#MenuPanel { z-index: 200 !important; transition: transform .25s ease; }
body.ks-menu-open #MenuPanel { transform: translateX(0) !important; visibility: visible !important; display: block !important; }
body.ks-menu-open { overflow: hidden; }
.ks-panel, .ks-dialog { position: fixed; z-index: 210; background: #fff; color: #333; box-shadow: 0 5px 30px rgba(0,0,0,.18); }
.ks-panel { top: 0; right: 0; height: 100vh; width: min(460px,100vw); overflow: auto; transform: translateX(105%); transition: transform .28s ease; padding: 24px; }
.ks-panel.ks-visible { transform: translateX(0); }
.ks-panel-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 18px; border-bottom: 1px solid #ddd; margin-bottom: 20px; }
.ks-panel h2,.ks-dialog h2 { font-size: 23px; line-height: 1.4; margin: 0; font-weight: 600; }
.ks-close { appearance: none; background: none; border: 0; font-size: 27px; line-height: 1; color: #333; padding: 0 3px; }
.ks-search-input { width: 100%; border: 1px solid #d8d8d8; background: #f8f8f8; font: inherit; font-size: 17px; padding: 14px 15px; outline-color: #ef7828; }
.ks-result-count { margin: 16px 0; color: #777; font-size: 14px; }
.ks-results { display: grid; grid-template-columns: repeat(2,1fr); gap: 18px 12px; }
.ks-result { color: inherit; text-decoration: none; cursor: pointer; }
.ks-result img { width: 100%; aspect-ratio: 1/1; object-fit: contain; }
.ks-result b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; line-height: 1.5; font-weight: 400; }
.ks-price { color: #ed7728; margin-top: 6px; font-weight: 600; }
.ks-dialog { top: 50%; left: 50%; width: min(840px,calc(100vw - 30px)); max-height: min(85vh,800px); overflow: auto; transform: translate(-50%,-45%); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; padding: 28px; }
.ks-dialog.ks-visible { transform: translate(-50%,-50%); opacity: 1; pointer-events: auto; }
.ks-dialog-top { display: flex; justify-content: flex-end; }
.ks-detail { display: grid; grid-template-columns: 42% 1fr; gap: 30px; align-items: start; }
.ks-detail img { width: 100%; aspect-ratio: 1/1; object-fit: contain; }
.ks-detail p { line-height: 1.7; }
.ks-button { appearance: none; background: #ec7828; border: 1px solid #ec7828; color: #fff; padding: 12px 26px; font: inherit; font-size: 16px; cursor: pointer; }
.ks-button:hover { background: #d9681c; }
.ks-button-secondary { background: #fff; color: #333; border-color: #aaa; }
.ks-button-secondary:hover { background: #eee; }
.ks-detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.ks-qty { display: inline-flex; align-items: center; border: 1px solid #bbb; }
.ks-qty button { border: 0; background: #fff; font-size: 20px; width: 33px; height: 34px; }
.ks-qty span { min-width: 30px; text-align: center; }
.ks-cart-item { display: grid; grid-template-columns: 74px 1fr; gap: 14px; padding: 15px 0; border-bottom: 1px solid #e6e6e6; }
.ks-cart-item img { width: 74px; height: 74px; object-fit: contain; }
.ks-cart-item b { display: block; font-size: 14px; line-height: 1.45; font-weight: 500; }
.ks-cart-line { display: flex; justify-content: space-between; margin-top: 7px; }
.ks-remove { color: #777; background: none; border: 0; text-decoration: underline; font: inherit; font-size: 13px; }
.ks-cart-total { display: flex; justify-content: space-between; padding: 24px 0; font-size: 19px; }
.ks-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 240; color: #fff; background: #333; padding: 10px 20px; transition: opacity .25s, transform .25s; pointer-events: none; }
.ks-toast.ks-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.ks-news-grid { display: grid !important; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 20px; }
.ks-news-grid > div { min-width: 0; }
.ks-news-grid .post-card__text { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.ks-news-grid .post-card__image-container img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.ks-news-full { line-height: 1.75; white-space: pre-wrap; }
@media (max-width: 767px) {
  #shopline-section-header { box-shadow: 0 2px 7px rgba(0,0,0,.06); }
  .ks-news-grid { grid-template-columns: 1fr; }
  .ks-news-grid > div:nth-child(n+4) { display: none; }
  .ks-detail { grid-template-columns: 1fr; gap: 12px; }
  .ks-detail img { max-height: 260px; }
  .ks-dialog { padding: 16px; }
  .ks-panel { padding: 19px; }
  .slideshow__list .slideshow__item { height: 100%; }
}
