/* ==========================================================================
   Rixtar base layer - one container, one rhythm, one header, one set of titles
   for EVERY page (homepage v2 + the old Knit Knot pages).

   Loaded from snippets/master-include.liquid. Values come from the design tokens
   defined in snippets/variable-css.liquid (Admin > Thiết lập theme > 1. Giao diện chung):
     --rx-accent --rx-dark --rx-on-dark  --rx-gap --rx-gap-sm --rx-gap-xs
     --rx-wrap --rx-gutter --rx-header-h --rx-radius
   Selectors start with "body" so they win over page stylesheets that load later.
   ========================================================================== */

/* ---------------------------------------------------------------- container */
body .container {
  width: 100%;
  max-width: calc(var(--rx-wrap) + var(--rx-gutter) * 2);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--rx-gutter);
  padding-right: var(--rx-gutter);
}

/* ------------------------------------------------------------------- header
   Solid dark bar on every page, in the normal flow (no overlay), sticky once scrolled. */
body .mainHeader--height {
  position: relative;
  z-index: 99;
  min-height: var(--rx-header-h);
  background: var(--rx-dark);
}
body .mainHeader.mainHeader_temp02 {
  background: var(--rx-dark);
  color: var(--rx-on-dark);
}
body .mainHeader.mainHeader_temp02 .mainHeader-middle {
  display: flex;
  align-items: center;
  min-height: var(--rx-header-h);
  padding-top: 0;
  padding-bottom: 0;
  background: var(--rx-dark);
  color: var(--rx-on-dark);
}
body .mainHeader.mainHeader_temp02 .mainHeader-middle > .container-fluid {
  width: 100%;
  max-width: calc(var(--rx-wrap) + var(--rx-gutter) * 2);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--rx-gutter);
  padding-right: var(--rx-gutter);
}
body .mainHeader .wrap-logo img { width: auto; max-height: calc(var(--rx-header-h) - 36px); }
body .mainHeader--height.fixed-header .mainHeader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .25);
  animation: rx-header-in .35s ease both;
}
@keyframes rx-header-in { from { transform: translateY(-100%); } to { transform: none; } }

/* main menu: tighter spacing so 8 items fit next to the logo and the actions;
   below 1280px the hamburger menu takes over (a long menu cannot fit beside the logo) */
body .header-wrap-menu .menuList-main > li + li { margin-left: clamp(6px, .7vw, 14px); }
body .header-wrap-menu .menuList-main > li > a {
  padding-left: 2px;
  padding-right: 2px;
  font-size: clamp(11.5px, .85vw, 12.5px);
  letter-spacing: .3px;
  white-space: nowrap;
}
@media (min-width: 992px) and (max-width: 1279.98px) {
  body .header-wrap-menu { display: none !important; }
  body .header-wrap-iconav { display: block !important; }
}

/* header call-to-action + cart badge use the brand accent, always */
:root {
  --header-btn_bg: var(--rx-accent);
  --header-btn_txt: var(--rx-dark);
  --header-btn_bg_hover: var(--rx-on-dark);
  --bg-cartcount: var(--rx-accent);
  --txt-cartcount: var(--rx-dark);
}

/* ------------------------------------------------------------- page rhythm
   Under the header: a slim breadcrumb strip, then --rx-gap-sm, content, --rx-gap before the footer. */
body .breadcrumb-shop {
  padding: 0;
  margin-bottom: var(--rx-gap-sm);
}
body .breadcrumb-shop .breadcrumb-arrows { padding: 14px 0; }
body .knk_breadcrumb-text-image .knk_breadcrumb-text .breadcrumb-shop { margin-bottom: 0; }

body .layout-collections,
body .layout-blogs,
body .layout-article,
body .layout-pageDetail,
body .layout-pageContact,
body .layout-page-service,
body .layout-searchPage,
body .layout-pageNot,
body .layout-account,
body .layout-productDetail {
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: var(--rx-gap);
}
/* banner (when a page uses the image breadcrumb) sits the same distance above the content */
body .layout-collections .knk_breadcrumb-text-image,
body .layout-pageDetail .knk_breadcrumb-text-image,
body .layout-pageContact .knk_breadcrumb-text-image,
body .layout-page-service .knk_breadcrumb-text-image,
body .layout-productDetail .knk_breadcrumb-text-image,
body .layout-blogs .knk_breadcrumb-text-image,
body .layout-article .knk_breadcrumb-text-image { margin-bottom: var(--rx-gap-sm); }

/* blocks that carried their own top/bottom gaps now follow the shared ones */
body .layout-blogs .wrapper-contentBlogs,
body .layout-article .wrapper-contentArticle { margin-top: 0; margin-bottom: 0; padding-top: 0; }
body .layout-account .wrapbox-content-account { padding-top: 0; padding-bottom: 0; }
body .layout-account .wrapbox-heading-account { padding-top: 0; }
body .mainContent-theme { min-height: 60vh; }

/* product page: the stacked sections (details > related > recently viewed) use one gap */
body .productDetail-related,
body .productDetail-recently-viewed {
  margin-top: var(--rx-gap);
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* --------------------------------------------------------------- page titles */
body .heading-page h1,
body .heading-pageDetail h1,
body .heading-article h1,
body .collection-heading h1,
body .customers-header h1,
body .layout-account .header-page h1,
body .layout-pageNot h1,
body .knk_breadcrumb-text-image .knk_breadcrumb-text h1 {
  margin: 0 0 var(--rx-gap-xs);
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.01em;
}
body .productRelated-title h2,
body .productViewed-title h2 {
  margin: 0 0 var(--rx-gap-xs);
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.2;
  font-weight: 700;
}
body .knk_breadcrumb-text-image .knk_breadcrumb-text h1 { margin-bottom: 8px; }

/* ----------------------------------------------------------- page banner
   One banner height for every page that shows the image header. */
body .knk_breadcrumb-text-image .knk_breadcrumb-image,
body .knk_breadcrumb-text-image .knk_breadcrumb-image-height {
  position: relative;
  display: block;
  height: clamp(170px, 17vw, 260px);
  overflow: hidden;
}
body .knk_breadcrumb-text-image .knk_breadcrumb-image-height:before { content: none; }
body .knk_breadcrumb-text-image .knk_breadcrumb-image picture,
body .knk_breadcrumb-text-image .knk_breadcrumb-image img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
body .knk_breadcrumb-text-image .knk_breadcrumb-image:after { background-color: color-mix(in srgb, var(--rx-dark) 55%, transparent); }

/* the header is pinned on scroll, so sticky blocks and in-page anchors must stop below it */
html { scroll-padding-top: calc(var(--rx-header-h) + 16px); }
body .layout-productDetail .productDetail--gallery,
body .layout-productDetail .productDetail--content { top: calc(var(--rx-header-h) + 24px); }
