/* =========================================================
   FiberPart shared UI additions
   Favorites drawer + drawer swipe gestures + mobile dock fit
   ========================================================= */

.fp-favorite-header,
.fp-favorite-dock {
  position: relative;
}

.fp-favorite-count {
  position: absolute;
  top: -5px;
  left: -3px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--orange, #ff7a3d), var(--red, #ef4444));
  color: #fff;
  border: 2px solid #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.fp-favorite-count[hidden] { display: none !important; }


.fp-favorite-close {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 14px;
  background: #fff3ed;
  color: var(--text, #19232d);
  cursor: pointer;
}

#favoritesDrawer .drawer-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fp-favorite-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 38px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line, #e8ecee);
  border-radius: 14px;
  background: #fff;
}

.fp-favorite-media {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(135deg, #f3f6f7, #e8edef);
  color: #526773;
  font-size: 21px;
}

.fp-favorite-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fp-favorite-copy { min-width: 0; }
.fp-favorite-copy a {
  display: block;
  color: var(--text, #19232d);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.75;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fp-favorite-copy small {
  display: block;
  margin-top: 2px;
  color: var(--muted, #77838b);
  font-size: 12px;
}
.fp-favorite-copy strong {
  display: block;
  margin-top: 5px;
  color: var(--text, #19232d);
  font-size: 12px;
}

.fp-favorite-remove {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: #fff0f0;
  color: #c74242;
  cursor: pointer;
}

.fp-favorites-empty {
  min-height: 230px;
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  color: var(--muted, #77838b);
}
.fp-favorites-empty i { font-size: 31px; color: #c4ccd1; }
.fp-favorites-empty strong { color: var(--text, #19232d); font-size: 13px; }
.fp-favorites-empty span { max-width: 235px; font-size: 12px; line-height: 1.8; }

.fp-favorites-footer-note {
  margin: 0 0 10px;
  color: var(--muted, #77838b);
  font-size: 12px;
  line-height: 1.8;
}

/* Favorite state shared by home/shop/product */
.wishlist-btn.is-active,
.shop-favorite-btn.is-active,
.product-favorite.is-active,
.product-favorite.active {
  color: #e64b63 !important;
}

/* Drawer swipe: right-edge drawers can be pulled outward to close. */
.drawer.fp-swipe-ready {
  touch-action: pan-y !important;
  overscroll-behavior-x: contain;
}
.drawer.fp-swipe-ready .drawer-body {
  touch-action: pan-y;
}
/*
  Bundle CSS opens drawers with transform:translateX(0)!important.
  Swipe therefore moves through a CSS variable, with equal !important priority,
  instead of trying to fight that rule with a normal inline transform.
*/
.drawer.fp-swipe-ready.fp-swiping,
.drawer.fp-swipe-ready.fp-swipe-settle {
  transform: translateX(var(--fp-drawer-drag-x, 0px)) !important;
}
.drawer.fp-swiping {
  transition: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}
.drawer.fp-swipe-settle {
  transition: transform .18s ease !important;
}
@media (max-width: 760px) {
  .drawer.fp-swipe-ready::before {
    content: "";
    position: absolute;
    top: 7px;
    left: 50%;
    z-index: 5;
    width: 34px;
    height: 4px;
    border-radius: 999px;
    background: #d7dde1;
    transform: translateX(-50%);
    pointer-events: none;
  }
}

.fp-drawer-swipe-hint {
  display: none;
}

.fp-ui-toast {
  position: fixed;
  right: 50%;
  bottom: 88px;
  transform: translate(50%, 14px);
  z-index: 120;
  max-width: min(360px, calc(100% - 24px));
  padding: 9px 13px;
  border-radius: 11px;
  background: rgba(25, 35, 45, .94);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  box-shadow: 0 12px 28px rgba(25,35,45,.18);
}
.fp-ui-toast.show { opacity: 1; transform: translate(50%, 0); }

@media (max-width: 760px) {
  .bottom-dock.fp-has-favorites {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    padding-inline: 2px !important;
  }
  .bottom-dock.fp-has-favorites .dock-item {
    min-width: 0;
    font-size: 17px;
    gap: 2px;
  }
  .bottom-dock.fp-has-favorites .dock-item span {
    max-width: 100%;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .bottom-dock.fp-has-favorites .dock-center {
    width: 49px;
    height: 49px;
  }
  .fp-favorite-count {
    top: -3px;
    left: calc(50% - 18px);
    min-width: 17px;
    height: 17px;
    border-width: 1.5px;
    font-size: 12px;
  }
  .fp-drawer-swipe-hint {
    display: block;
    width: 38px;
    height: 4px;
    margin: 6px auto -2px;
    border-radius: 999px;
    background: #d6dde1;
  }
  .fp-ui-toast { bottom: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  .drawer.fp-swipe-settle,
  .fp-ui-toast { transition: none !important; }
}

/* =========================================================
   Shared policy / order-result pages
   ========================================================= */
.fp-simple-shell {
  width: min(980px, calc(100% - 28px));
  margin: 0 auto;
  padding: 26px 0 44px;
}
.fp-result-card,
.fp-policy-card {
  border: 1px solid var(--line, #e5eaed);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(25,35,45,.055);
}
.fp-result-card {
  max-width: 720px;
  margin: 18px auto;
  padding: 28px;
  text-align: center;
}
.fp-result-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: #eaf6f0;
  color: #3f755f;
  font-size: 26px;
}
.fp-result-card h1 { margin: 0 0 7px; font-size: 22px; }
.fp-result-card > p { margin: 0 auto 18px; max-width: 560px; color: var(--muted, #77838b); font-size: 12px; line-height: 1.9; }
.fp-result-meta {
  margin: 18px 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 8px;
}
.fp-result-meta div { padding: 11px; border-radius: 12px; background: #f7f9fa; }
.fp-result-meta span { display: block; color: var(--muted, #77838b); font-size: 12px; }
.fp-result-meta strong { display: block; margin-top: 4px; font-size: 12px; }
.fp-result-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.fp-policy-head { margin-bottom: 14px; }
.fp-policy-head h1 { margin: 0 0 6px; font-size: 22px; }
.fp-policy-head p { margin: 0; color: var(--muted, #77838b); font-size: 12px; line-height: 1.9; }
.fp-policy-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0 12px;
  scrollbar-width: none;
}
.fp-policy-nav::-webkit-scrollbar { display:none; }
.fp-policy-nav a {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--line, #e5eaed);
  border-radius: 10px;
  background: #fff;
  color: var(--text, #19232d);
  font-size: 12px;
  font-weight: 800;
}
.fp-policy-card { padding: 20px; margin-bottom: 10px; scroll-margin-top: 90px; }
.fp-policy-card h2 { margin: 0 0 9px; font-size: 15px; }
.fp-policy-card p,
.fp-policy-card li { color: var(--muted, #66747c); font-size: 14px; line-height: 2; }
.fp-policy-card ul,.fp-policy-card ol { margin: 0 0 12px; padding-right: 22px; }
.fp-policy-card h3{margin:18px 0 8px;font-size:17px}.fp-policy-card h4{margin:15px 0 7px;font-size:15px}.fp-policy-card img{display:block;max-width:100%;height:auto;margin:14px auto;border-radius:11px}.fp-policy-card blockquote{margin:13px 0;padding:10px 13px;border-right:4px solid #bd6234;background:#fff7f0}.fp-policy-card table{display:block;max-width:100%;overflow-x:auto;border-collapse:collapse}.fp-policy-card th,.fp-policy-card td{min-width:110px;padding:8px 10px;border:1px solid #dfe5e8}.fp-policy-card a{color:#315f79;text-decoration:underline}.fp-policy-card pre{overflow:auto;padding:11px;border-radius:9px;background:#f3f5f6;direction:ltr;text-align:left}
.fp-policy-note { margin-top: 10px; padding: 10px 12px; border-radius: 11px; background: #fff5ee; color: #8d5438; font-size: 12px; line-height: 1.9; }
.checkout-consent a { color: var(--orange, #e56d39); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 620px) {
  .fp-simple-shell { width: min(100% - 18px, 980px); padding-top: 16px; }
  .fp-result-card { padding: 20px 14px; border-radius: 15px; }
  .fp-result-meta { grid-template-columns: 1fr; }
  .fp-policy-card { padding: 15px; border-radius: 14px; }
}


/* ===== Final responsive fixes + product utility controls ===== */
.fp-product-tools-links{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:8px}
.fp-product-tools-links a{display:flex;align-items:center;justify-content:center;gap:6px;min-height:36px;border:1px solid #e2e7e9;border-radius:9px;background:#fff;color:#53636d;font-size:12px;font-weight:800;text-decoration:none;position:relative}
.fp-product-tools-links a:hover{border-color:#cdd7dc;color:#263d4d}
.fp-product-tools-links b{position:absolute;top:-5px;left:-3px;display:grid;place-items:center;min-width:17px;height:17px;padding:0 4px;border-radius:999px;background:#bd6234;color:#fff;font-size:12px;border:2px solid #fff}
.fp-card-compare{position:absolute;left:9px;top:48px;z-index:4;width:33px;height:33px;border-radius:10px;border:1px solid rgba(255,255,255,.58);background:rgba(255,255,255,.88);backdrop-filter:blur(7px);color:#51616b;cursor:pointer}
.fp-card-compare.is-active{background:#263d4d;color:#fff;border-color:#263d4d}
.fp-product-head-actions{display:flex;align-items:center;gap:6px;margin-right:auto}
.fp-product-compare{width:40px;height:40px;border:1px solid #dfe4e7;border-radius:12px;background:#f9fafb;color:#66757d;font-size:14px;cursor:pointer}
.fp-product-compare.is-active{background:#eef3f5;border-color:#b9c8d0;color:#263d4d}

@media (max-width:760px){
  /* Article TOC/headline bars must scroll inside themselves, never enlarge the page. */
  .article-page .blog-main,.article-page .container,.article-page .article-layout,.article-page .article-layout>*,.article-page .article-hero-card,.article-page .article-title-block{min-width:0;max-width:100%}
  .article-page .blog-breadcrumb{display:flex;flex-wrap:nowrap;max-width:100%;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  .article-page .blog-breadcrumb::-webkit-scrollbar,.article-page .article-toc nav::-webkit-scrollbar,.article-page .article-tags::-webkit-scrollbar{display:none}
  .article-page .blog-breadcrumb>*{flex:0 0 auto;white-space:nowrap}
  .article-page .article-toc{min-width:0;max-width:100%;overflow:hidden}
  .article-page .article-toc nav{display:flex;flex-wrap:nowrap;max-width:100%;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;scrollbar-width:none;-webkit-overflow-scrolling:touch;padding-bottom:2px}
  .article-page .article-toc nav a{flex:0 0 auto;white-space:nowrap}
  .article-page .article-tags{display:flex;flex-wrap:nowrap;max-width:100%;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;overscroll-behavior-x:contain}
  .article-page .article-tags a{flex:0 0 auto;white-space:nowrap}
  .article-page .article-content img,.article-page .article-content video,.article-page .article-content iframe{max-width:100%;height:auto}
  .article-page .article-content table{display:block;max-width:100%;overflow-x:auto;white-space:nowrap}
  .article-page .article-content pre{max-width:100%;overflow-x:auto}

  .bottom-dock.fp-has-favorites{grid-template-columns:repeat(7,minmax(0,1fr))!important;padding-inline:1px!important}
  .bottom-dock.fp-has-favorites .dock-item{font-size:16px;gap:2px;padding-inline:0}
  .bottom-dock.fp-has-favorites .dock-item span{font-size:12px}
  .bottom-dock.fp-has-favorites .dock-center{width:49px;height:49px}
  .fp-card-compare{left:6px;top:41px;width:29px;height:29px;border-radius:9px;font-size:12px}
}
@media (max-width:370px){
  .bottom-dock.fp-has-favorites .dock-item span{font-size:12px;letter-spacing:-.2px}
  .bottom-dock.fp-has-favorites .dock-item{font-size:15px}
  .bottom-dock.fp-has-favorites .dock-center{width:46px;height:46px}
}


/* =========================================================
   Unified active navigation + quick comparison access
   ========================================================= */
.main-nav a.fp-nav-active,
.main-nav a.fp-nav-active:hover {
  background: linear-gradient(135deg, var(--orange, #ff7a3d), var(--red, #ef5a4d));
  color: #fff;
  box-shadow: 0 8px 18px rgba(230, 104, 56, .20);
}
.header-promo-pill.fp-nav-active {
  background: linear-gradient(135deg, var(--orange, #ff7a3d), var(--red, #ef5a4d));
  color: #fff;
  box-shadow: 0 8px 18px rgba(230, 104, 56, .18);
}
.sticky-cat.fp-nav-active,
.sticky-cat.fp-nav-active:hover {
  background: #fff1e9;
  color: var(--orange, #e56d39);
  box-shadow: inset 0 0 0 1px rgba(229,109,57,.20), 0 7px 16px rgba(64,45,37,.06);
}
.sticky-cat.fp-nav-active .sticky-cat__label { color: var(--orange, #e56d39); font-weight: 900; }

.bottom-dock .dock-item.fp-nav-active {
  color: var(--orange, #e56d39) !important;
  background: #fff1e9;
  border-radius: 13px;
}
.bottom-dock .dock-item.fp-nav-active span { color: inherit; font-weight: 900; }
.bottom-dock .dock-center.fp-nav-active {
  outline: 3px solid rgba(229,109,57,.19);
  outline-offset: 3px;
  box-shadow: 0 16px 30px rgba(255,106,0,.28), 0 0 0 6px rgba(255,255,255,.92);
}

.fp-top-compare-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.fp-top-compare-link i { font-size: 12px; }

.fp-compare-quick {
  position: fixed;
  left: 18px;
  bottom: 24px;
  z-index: 68;
  min-height: 40px;
  padding: 8px 11px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(38,61,77,.12);
  border-radius: 12px;
  background: rgba(255,255,255,.97);
  color: #263d4d;
  box-shadow: 0 12px 28px rgba(25,35,45,.16);
  backdrop-filter: blur(12px);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(9px) scale(.98);
  transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
}
.fp-compare-quick b {
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #263d4d;
  color: #fff;
  font-size: 12px;
}
.fp-compare-quick b[hidden] { display:none !important; }
.fp-compare-quick.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

@media (max-width: 760px) {
  .fp-compare-quick { bottom: 78px; left: 9px; }
  .bottom-dock .dock-item.fp-nav-active { border-radius: 10px; }
  .main-nav a.fp-nav-active { box-shadow:none; }
}
@media (max-width: 370px) {
  .fp-compare-quick { padding: 6px 8px; gap: 4px; }
  .fp-compare-quick span { display:none; }
}
@media (prefers-reduced-motion: reduce) {
  .fp-compare-quick { transition: none; }
}

/* Recovery 5: the shared Layout exclusively owns the public mega-menu state. */
.site-header { overflow: visible !important; }
.site-header .mega-menu.open {
  max-height: 620px !important;
  max-height: min(72vh, 620px) !important;
  visibility: visible !important;
  pointer-events: auto !important;
  overflow-y: auto;
  overscroll-behavior: contain;
}
@media (max-width: 760px) {
  .site-header .mega-menu.open {
    max-height: calc(100vh - 112px) !important;
    max-height: calc(100dvh - 112px) !important;
  }
}
