/* ============================================================
   Seller shop page — v2  (prefix ks-)
   Structure from the agreed mockup; colours and type from the
   platform (Poppins, navy #00002E as on the shared card).
   Breakpoints: desktop >= 992, tablet 768-991, phones <= 767
   (header/nav phone rules at <= 760 as in the mockup).
   No clamp(): fixed px values with explicit media queries.
   ============================================================ */

.ks-page {
  --ks-ink: #17150f;
  --ks-body: #4d4740;
  --ks-muted: #8b857c;
  --ks-line: #e6e4e0;
  --ks-navy: #00002E;
  --ks-gap: 16px;

  font-family: 'Poppins', sans-serif;
  color: var(--ks-body);
  background: #fff;
}

.ks-page h1,
.ks-page h2 { font-family: 'Poppins', sans-serif; color: var(--ks-ink); }

/* ---------- Buttons ---------- */
.ks-btn {
  height: 40px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--ks-navy);
  border-radius: 6px;
  background: #fff;
  color: var(--ks-navy);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: opacity .15s ease, background-color .15s ease;
}
.ks-btn:hover { text-decoration: none; opacity: .88; color: var(--ks-navy); }
.ks-btn--primary,
.ks-btn--primary:hover { background: var(--ks-navy); color: #fff; }
.ks-btn svg { width: 15px; height: 15px; flex: none; }
.ks-btn:focus-visible { outline: 2px solid var(--ks-navy); outline-offset: 2px; }

/* ============================================================
   Header: banner + identity row
   ============================================================ */
/* own container: the mockup's width (1180px max, 16px side gutters) */
.ks-container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: content-box;
}
@media (max-width: 1211px) {
  .ks-container { box-sizing: border-box; max-width: none; }
}

/* banner sits directly under the site header, full page width */
.ks-header { margin-top: 0; }

.ks-identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 0;
  border-bottom: 1px solid var(--ks-line);
}

.ks-identity__left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.ks-identity__logo { --sl-size: 72px; display: inline-flex; flex: none; }
.ks-identity__logo .shop-logo { --sl-size: inherit; }
.ks-identity__logo:hover { text-decoration: none; }

.ks-identity__details { min-width: 0; }

.ks-identity__name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.ks-identity__name h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
}
.ks-identity__verified { display: inline-flex; flex: none; }

.ks-identity__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ks-muted);
}
.ks-identity__rating { display: inline-flex; align-items: center; gap: 6px; }
.ks-identity__rating .rating { font-size: 12px; }
.ks-identity__loc { display: inline-flex; align-items: center; gap: 4px; }
.ks-identity__loc svg { width: 13px; height: 13px; flex: none; }

.ks-identity__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

@media (max-width: 760px) {
  .ks-identity { flex-direction: column; align-items: flex-start; }
  .ks-identity__logo { --sl-size: 60px; }
  .ks-identity__name h1 { font-size: 17px; }
  .ks-identity__actions { width: 100%; }
  .ks-identity__actions .ks-btn { flex: 1 1 0; }
  .ks-identity__actions .share-btn { flex: none; }
}

/* ============================================================
   Navigation
   Desktop (>= 992px): bar + More horizontal bar + drop menus + search
   Below 992px: 3-bars side menu + search
   ============================================================ */
.ks-nav-wrap {
  position: relative;
  border-bottom: 1px solid var(--ks-line);
  background: #fff;
}

.ks-nav {
  display: flex;
  align-items: stretch;
  min-height: 52px;
  white-space: nowrap;
}

.ks-nav__item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 17px 16px 15px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ks-muted);
  text-decoration: none;
  cursor: pointer;
  flex: none;
}
.ks-nav__item:first-child { padding-left: 0; }
.ks-nav__item:hover { color: var(--ks-ink); text-decoration: none; }
.ks-nav__item.is-active { color: var(--ks-ink); border-bottom-color: var(--ks-navy); }
.ks-nav__item:focus-visible,
.ks-dd__toggle:focus-visible,
.ks-bar__item:focus-visible { outline: 2px solid var(--ks-navy); outline-offset: -2px; }

/* section / category names in the main bar: capped at 160px */
.ks-nav__item--tab .ks-nav__label {
  display: inline-block;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.ks-chev { width: 12px; height: 12px; flex: none; transition: transform .15s ease; }
[aria-expanded="true"] > .ks-chev { transform: rotate(180deg); }

/* ---------- Drop menus (items with sub-items) ---------- */
.ks-dd { position: relative; display: inline-flex; align-items: stretch; flex: none; }
.ks-dd .ks-dd__link { padding-right: 4px; }
.ks-dd__toggle {
  display: inline-flex;
  align-items: center;
  padding: 0 12px 0 2px;
  border: 0;
  background: transparent;
  color: var(--ks-muted);
  cursor: pointer;
}
.ks-dd__toggle:hover,
.ks-dd__toggle[aria-expanded="true"] { color: var(--ks-ink); }

.ks-dd__menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 40;
  min-width: 200px;
  max-width: 280px;
  padding: 6px 0;
  background: #fff;
  border: 1px solid var(--ks-line);
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(23, 21, 15, 0.08);
  white-space: normal;
}
.ks-dd__menu[hidden] { display: none; }
.ks-dd__item {
  display: block;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ks-body);
  text-decoration: none;
}
.ks-dd__item:hover,
.ks-dd__item:focus { background: #f7f6f4; color: var(--ks-ink); text-decoration: none; outline: none; }
.ks-dd__item.is-active { color: var(--ks-ink); font-weight: 600; }

/* ---------- More: horizontal bar ---------- */
.ks-more__btn { gap: 6px; }

.ks-morebar {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 35;
  background: #fff;
  border-top: 1px solid var(--ks-line);
  border-bottom: 1px solid var(--ks-line);
  box-shadow: 0 10px 24px rgba(23, 21, 15, 0.06);
}
.ks-morebar[hidden] { display: none; }
.ks-morebar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0 6px;
  padding: 4px max(16px, calc((100% - 1180px) / 2));
}

.ks-bar__item {
  display: inline-flex;
  align-items: center;
  padding: 13px 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ks-muted);
  text-decoration: none;
  white-space: nowrap;
}
.ks-bar__item:hover,
.ks-bar__item.is-active { color: var(--ks-ink); text-decoration: none; }
.ks-bar__item.is-active { box-shadow: inset 0 -3px 0 var(--ks-navy); }
.ks-dd--bar .ks-dd__link { padding-right: 2px; }

/* ---------- Search ---------- */
.ks-search {
  display: flex;
  align-items: center;
  margin: 0;
  border: 1px solid var(--ks-line);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}
.ks-search:focus-within { border-color: var(--ks-navy); }
.ks-search input {
  flex: 1 1 auto;
  min-width: 0;
  height: 36px;
  padding: 0 4px 0 12px;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--ks-ink);
  outline: none;
}
.ks-search input::-webkit-search-cancel-button { cursor: pointer; }
.ks-search button {
  flex: none;
  width: 38px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--ks-navy);
  cursor: pointer;
}
.ks-search button svg { width: 17px; height: 17px; }

/* desktop: search sits at the end and shrinks first (down to 180px) */
.ks-search--desktop {
  margin-left: auto;
  align-self: center;
  flex: 0 1 260px;
  min-width: 180px;
}

/* ---------- Desktop / mobile switch ---------- */
.ks-nav--mobile { display: none; }

@media (max-width: 991px) {
  .ks-nav--desktop,
  .ks-morebar { display: none !important; }

  .ks-nav--mobile {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 0;
    padding: 10px 0;
  }
  .ks-search--mobile { flex: 1 1 auto; }
}

.ks-burger {
  flex: none;
  width: 40px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ks-line);
  border-radius: 6px;
  background: #fff;
  color: var(--ks-ink);
  cursor: pointer;
}
.ks-burger svg { width: 20px; height: 20px; }
.ks-burger:focus-visible { outline: 2px solid var(--ks-navy); outline-offset: 2px; }

/* ---------- Side menu (below 992px) ---------- */
.ks-drawer { position: fixed; inset: 0; z-index: 1050; }
.ks-drawer[hidden] { display: none; }

.ks-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 20, 0.45);
}

.ks-drawer__panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 85%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
  transform: translateX(-100%);
  transition: transform .22s ease;
}
.ks-drawer.is-open .ks-drawer__panel { transform: translateX(0); }

.ks-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--ks-line);
}
.ks-drawer__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ks-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ks-drawer__close {
  flex: none;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ks-ink);
  cursor: pointer;
}
.ks-drawer__close svg { width: 20px; height: 20px; }

.ks-drawer__list,
.ks-drawer__sub {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ks-drawer__list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 6px 0 calc(16px + env(safe-area-inset-bottom, 0px));
}

.ks-drawer__row { display: flex; align-items: stretch; }

.ks-drawer__link {
  flex: 1 1 auto;
  display: block;
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ks-body);
  text-decoration: none;
}
.ks-drawer__link:hover { color: var(--ks-ink); text-decoration: none; }
.ks-drawer__link.is-active { color: var(--ks-ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--ks-navy); }
.ks-drawer__link--sub { padding-left: 32px; font-size: 13px; }

.ks-drawer__expand {
  flex: none;
  width: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--ks-muted);
  cursor: pointer;
}
.ks-drawer__expand .ks-chev { width: 14px; height: 14px; }

.ks-drawer__sub { display: none; background: #f9f8f6; }
.ks-drawer__group.is-open > .ks-drawer__sub { display: block; }

body.ks-drawer-lock { overflow: hidden; }

/* ============================================================
   Sections
   ============================================================ */
.ks-main { padding-bottom: 32px; }

.ks-section { margin: 24px 0; }

.ks-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.ks-section__title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}

/* ---------- Rails: 4 / 3 / 2 visible, overflow scroll, no arrows ---------- */
.ks-rail {
  display: flex;
  gap: var(--ks-gap);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.ks-rail::-webkit-scrollbar { display: none; }
.ks-rail:focus-visible { outline: 2px solid var(--ks-navy); outline-offset: 4px; }

.ks-rail__item {
  flex: 0 0 calc((100% - 3 * var(--ks-gap)) / 4);
  min-width: 0;
  display: flex;
  scroll-snap-align: start;
}
.ks-rail__item > .pc-card { width: 100%; }

@media (min-width: 768px) and (max-width: 991px) {
  .ks-rail__item { flex-basis: calc((100% - 2 * var(--ks-gap)) / 3); }
}
@media (max-width: 767px) {
  .ks-page { --ks-gap: 12px; }
  .ks-rail__item { flex-basis: calc((100% - var(--ks-gap)) / 2); }
}

/* ---------- Coupons row (Coupons & Deals): 3 / 2 / 1 + a slice ---------- */
.ks-rail__item--coupon { flex-basis: calc((100% - 2 * var(--ks-gap)) / 3); display: block; }
.ks-rail__item--coupon > * { height: 100%; }

@media (min-width: 768px) and (max-width: 991px) {
  .ks-rail__item--coupon { flex-basis: calc((100% - var(--ks-gap)) / 2); }
}
@media (max-width: 767px) {
  .ks-rail__item--coupon { flex-basis: 85%; }
}

.ks-deals { margin-bottom: 8px; }
.ks-deals__title { font-size: 22px; }

/* ---------- Grids: 4 / 3 / 2 per row ---------- */
.ks-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px var(--ks-gap);
}
.ks-grid__item { min-width: 0; display: flex; }
.ks-grid__item > .pc-card { width: 100%; }

@media (min-width: 768px) and (max-width: 991px) {
  .ks-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .ks-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px var(--ks-gap); }
}

/* ---------- Sort ---------- */
.ks-sort {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 12px;
  color: var(--ks-muted);
}
.ks-sort__select {
  height: 36px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--ks-line);
  border-radius: 6px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2317150f' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 12px 12px;
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--ks-ink);
  cursor: pointer;
}
.ks-sort__select:focus { outline: 2px solid var(--ks-navy); outline-offset: 1px; }

@media (max-width: 767px) {
  .ks-sort__label { display: none; }
}

/* ---------- Load more ---------- */
.ks-loadmore { display: flex; justify-content: center; margin-top: 28px; }
.ks-loadmore[hidden] { display: none; }
.ks-loadmore__btn { min-width: 180px; }
.ks-loadmore__btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- Empty state ---------- */
.ks-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 48px 16px;
  border: 1px dashed var(--ks-line);
  border-radius: 8px;
  text-align: center;
}
.ks-empty p { margin: 0; font-size: 14px; color: var(--ks-muted); }

/* ---------- Banner sections ---------- */
.ks-slider__slide {
  width: 100%;
  aspect-ratio: 10 / 3;
  overflow: hidden;
  background: #f7f6f4;
}
.ks-slider__slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ks-banners__full {
  display: block;
  width: 100%;
  height: auto;
}
.ks-banners__full + .ks-banners__full { margin-top: var(--ks-gap); }

.ks-banners--half {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ks-gap);
}
.ks-banners__half { display: block; width: 100%; height: auto; }

@media (max-width: 767px) {
  .ks-banners--half { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .ks-btn, .ks-more__chev { transition: none; }
  .ks-rail { scroll-behavior: auto; }
}
