/* HAOLUN Site UI Overlay - Assistant Entry Layout */

/* === Hide old elements immediately === */
.home-actions .primary-actions {
  display: none !important;
}

[data-sample-series-link] {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

#haolun-fabric-assistant {
  display: none !important;
}

.hs-mobile-actions [data-hs-basket] {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* === New AI Entry (mobile home-actions position) === */
.hs-ai-entry-cta {
  display: block;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  text-decoration: none;
  color: #f8f6f3;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 0 16px 12px;
}

.hs-ai-entry-cta:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border-color: rgba(212, 175, 55, 0.25);
  transform: translateY(-1px);
}

.hs-ai-entry-main {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.hs-ai-entry-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(212, 175, 55, 0.1);
  border-radius: 50%;
  flex-shrink: 0;
}

.hs-ai-entry-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #d4af37;
  stroke-width: 1.5;
}

.hs-ai-entry-text {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.hs-ai-entry-arrow {
  width: 18px;
  height: 18px;
  opacity: 0.5;
  transition: transform 0.25s ease;
}

.hs-ai-entry-cta:hover .hs-ai-entry-arrow {
  transform: translateX(2px);
  opacity: 0.8;
}

.hs-ai-entry-desc {
  font-size: 12px;
  color: rgba(248, 246, 243, 0.55);
  line-height: 1.4;
  padding-left: 38px;
}

/* === Basket repositioning to header === */
[data-hs-basket].hs-in-header {
  opacity: 1 !important;
  pointer-events: auto !important;
  position: fixed !important;
  top: var(--hs-basket-top) !important;
  left: var(--hs-basket-left) !important;
  right: auto !important;
  bottom: auto !important;
  transform: none !important;
  width: 44px !important;
  height: 44px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 8px !important;
}

[data-hs-basket].hs-in-header [data-hs-basket-title] {
  display: none !important;
}

[data-hs-basket].hs-in-header [data-hs-count] {
  position: absolute !important;
  top: -4px !important;
  right: -4px !important;
  background: #d4af37 !important;
  color: #1a1a1a !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  min-width: 18px !important;
  height: 18px !important;
  border-radius: 9px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 4px !important;
}

[data-hs-basket].hs-in-header svg {
  width: 20px !important;
  height: 20px !important;
}

/* === Language menu adjustments === */
.site-header .language-menu > summary,
body:has(.site-header) .site-language {
  font-size: 13px;
  padding: 8px 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.brand-header .hs-lang-compact {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #f8f6f3;
  font-size: 13px;
  min-height: 44px;
}

.brand-header .hs-lang-compact:hover {
  background: rgba(255, 255, 255, 0.04);
}

.hs-lang-compact summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hs-lang-compact summary::-webkit-details-marker {
  display: none;
}

.hs-lang-compact[open] summary {
  margin-bottom: 8px;
}

.hs-lang-compact a {
  display: block;
  padding: 8px 10px;
  color: #f8f6f3;
  text-decoration: none;
  border-radius: 6px;
  font-size: 13px;
}

.hs-lang-compact a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.brand-header .motion-toggle {
  margin-left: auto;
}

/* === Header AI Entry Icon === */
.hs-menu-ai-entry {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #f8f6f3;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.site-header .hs-menu-ai-entry {
  border-color: rgba(0, 0, 0, 0.12);
  color: #35352f;
}

.hs-menu-ai-entry:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(212, 175, 55, 0.3);
}

.site-header .hs-menu-ai-entry:hover {
  background: rgba(212, 175, 55, 0.05);
  border-color: rgba(212, 175, 55, 0.4);
}

.hs-menu-ai-entry:focus-visible {
  outline: 2px solid #89774e;
  outline-offset: 2px;
}

.hs-menu-ai-entry svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.app-header .hs-menu-ai-entry {
  border-color: rgba(0, 0, 0, 0.12);
  color: #35352f;
}

@media (max-width: 390px) {
  .brand-header .hs-menu-ai-entry {
    margin-left: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hs-menu-ai-entry {
    transition: none !important;
  }
}

/* === Menu additions === */
#home-directory .hs-dir-overview,
.mobile-nav .hs-dir-overview,
[data-mobile-nav] .hs-dir-overview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: inherit;
  text-decoration: none;
  font-size: 15px;
}

#nav-menu-panel .hs-chat-menu-item {
  display: block;
  padding: 14px 20px;
  color: #1a1a1a;
  text-decoration: none;
  font-size: 15px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

#nav-menu-panel .hs-chat-menu-item:hover {
  background: rgba(212, 175, 55, 0.05);
}

/* === Chat header layout === */
.app-header .header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.app-header .header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-header #new-conversation-btn {
  order: 0;
}

@media (max-width: 320px) {
  .app-header .header-actions {
    gap: 8px;
  }

  [data-hs-basket].hs-in-header {
    width: 40px !important;
    height: 40px !important;
  }
}

/* === Responsive === */
@media (min-width: 390px) {
  .hs-ai-entry-cta {
    padding: 18px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hs-ai-entry-cta,
  [data-hs-basket].hs-in-header {
    transition: none !important;
  }

  .hs-ai-entry-arrow {
    transform: none !important;
  }
}

/* === Desktop AI entry === */
@media (min-width: 1024px) {
  .hero-actions .hs-desktop-ai-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #f8f6f3;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.25s ease;
  }

  .hero-actions .hs-desktop-ai-link:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
    border-color: rgba(212, 175, 55, 0.3);
  }

  .hero-actions .hs-desktop-ai-link svg {
    width: 18px;
    height: 18px;
    stroke: #d4af37;
    stroke-width: 1.5;
    fill: none;
  }
}

/* Preserve native controls while fitting the actual retained header and fixed action row. */
html[data-entry-surface] .home-actions .overview-action,html[data-entry-surface] .home-actions .primary-actions{display:none!important;}
html[data-entry-surface] .home-actions{display:flex!important;flex-direction:column!important;justify-content:center!important;gap:0!important;padding:4px 24px 8px!important;}
html[data-entry-surface] .home-actions .hs-ai-entry-cta{width:100%;height:78px;box-sizing:border-box;margin:0!important;padding:10px 16px!important;border-radius:18px;flex:none;}
html[data-entry-surface] .hs-ai-entry-main{margin-bottom:4px;min-height:26px;}
html[data-entry-surface] .hs-ai-entry-desc{font-size:12px;line-height:16px;}
html[data-entry-surface] .brand-header{position:relative;display:grid;grid-template-columns:96px minmax(0,1fr) 96px;align-items:center;padding-left:16px;padding-right:16px;}
html[data-entry-surface] .brand-header>button[aria-controls=home-directory]{grid-column:1;justify-self:start;width:44px;height:44px;}
html[data-entry-surface] .brand-header .wordmark{grid-column:2;justify-self:center;margin:0;white-space:nowrap;font-size:26px;letter-spacing:3px;}
html[data-entry-surface] .brand-header .motion-toggle{position:absolute;right:20px;top:78px;width:28px;height:28px;opacity:.6;}
html[data-entry-surface] .brand-header .hs-lang-compact,html[data-entry-surface] .site-header .language-menu,html[data-entry-surface] .site-header .site-language{position:absolute!important;top:50%!important;right:64px!important;left:auto!important;bottom:auto!important;transform:translateY(-50%)!important;margin:0!important;z-index:100;}
html[data-entry-surface] .hs-lang-compact{display:block;padding:0!important;border:0;background:transparent;position:relative;width:54px;min-height:44px;flex:none;color:inherit;}
html[data-entry-surface] .hs-lang-compact>summary{box-sizing:border-box;display:flex;align-items:center;justify-content:center;width:54px;height:44px;padding:0!important;margin:0!important;font:12px/1.2 system-ui;white-space:nowrap;color:inherit;border-radius:10px;list-style:none;}
html[data-entry-surface] .hs-lang-options{position:absolute;right:0;top:calc(100% + 8px);width:126px;padding:6px;border:1px solid #ddd9d0;border-radius:14px;background:#faf9f6;color:#292925;box-shadow:0 12px 32px #0002;z-index:240;}
html[data-entry-surface] .hs-lang-options a{display:block;color:#292925;padding:12px;border-radius:9px;font:14px/20px system-ui;text-decoration:none;}
html[data-entry-surface] .hs-lang-options a[aria-current=true]{background:#eeeae1;}
html[data-entry-surface] [data-hs-basket].hs-in-header{border:0!important;border-radius:10px!important;touch-action:manipulation!important;color:var(--hs-basket-color,#35352f)!important;z-index:2147483100!important;}
html[data-entry-surface] body:has(.circular-home) [data-hs-basket].hs-in-header{color:#f8f6f3!important;}
html[data-entry-surface] [data-hs-basket].hs-in-header [data-hs-count][hidden]{display:none!important;}
html[data-entry-surface] [data-hs-basket].hs-in-header [data-hs-count]{pointer-events:none;}
html[data-entry-surface] .site-header{padding-right:124px!important;}
html[data-entry-surface=chat] .app-header{height:64px;min-height:64px;padding:8px 16px;display:flex;align-items:center;justify-content:space-between;}
html[data-entry-surface=chat] .app-header .header-left{position:static;transform:none;left:auto;right:auto;display:flex;width:44px;gap:0;flex:none;}
html[data-entry-surface=chat] .app-header .brand-name{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);font-size:17px;letter-spacing:.5px;margin:0;pointer-events:auto;}
html[data-entry-surface=chat] .app-header .header-actions{position:static;transform:none;right:auto;left:auto;display:flex;gap:2px;align-items:center;margin-left:auto;}
html[data-entry-surface=chat] .app-header .header-btn{width:44px;height:44px;flex:none;}
html[data-entry-surface] .hs-lang-compact summary:focus-visible{outline:2px solid #89774e;outline-offset:2px;}
html[data-entry-surface] .site-header .language-menu>summary,html[data-entry-surface] .site-header .site-language>summary{min-height:44px;padding:0 8px;font-size:12px;box-sizing:border-box;display:flex;align-items:center;}
@media(max-width:360px){html[data-entry-surface] .brand-header .wordmark{font-size:19px;letter-spacing:1px;}html[data-entry-surface] .home-actions{padding-left:20px!important;padding-right:20px!important;}html[data-entry-surface=chat] .app-header .brand-name{font-size:15px;}}

html[data-entry-surface] .hs-mobile-actions [data-hs-basket].hs-in-header{height:44px!important;background:transparent!important;box-shadow:none!important;border:0!important;}

/* The retained mobile header uses a real native select, not details. */
html[data-entry-surface] .site-header .site-language{box-sizing:border-box!important;width:54px!important;min-width:0!important;height:44px!important;padding:0!important;border:0!important;background:transparent!important;color:#30302b!important;}
html[data-entry-surface] .site-header .site-language .sr-language{position:absolute!important;inset:0!important;clip:auto!important;clip-path:none!important;width:54px!important;height:44px!important;margin:0!important;overflow:visible!important;white-space:nowrap!important;display:flex!important;align-items:center!important;justify-content:center!important;font:12px/1 system-ui!important;pointer-events:none!important;}
html[data-entry-surface] .site-header .site-language select{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;opacity:0!important;cursor:pointer!important;}
html[data-entry-surface] .site-header .site-language:focus-within{outline:2px solid #89774e;outline-offset:2px;border-radius:10px;}

html[data-entry-surface] .hs-contact-title-row{display:flex;align-items:center;justify-content:space-between;gap:12px;}
html[data-entry-surface] .hs-consult-ai-link{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 14px;border:1px solid #d8d3c8;border-radius:12px;font:13px/1.3 system-ui;color:#3b3b35;background:#f5f2eb;text-decoration:none;white-space:nowrap;}
@media(max-width:360px){html[data-entry-surface] .brand-header .wordmark,html[data-entry-surface] .site-header .brand-wordmark{font-size:18px!important;letter-spacing:.7px!important;}}

/* Anchor alongside the real navigation control without moving the header grid. */
html[data-entry-surface] header[data-hs-ai-position=relative]{position:relative;}
html[data-entry-surface] header>.hs-menu-ai-entry{box-sizing:border-box;margin:0;border:0;color:var(--hs-menu-ai-color,currentColor);z-index:110;min-width:44px;min-height:44px;}
html[data-entry-surface] header>.hs-menu-ai-entry[data-ai-placement=floating]{position:absolute;left:var(--hs-menu-ai-x);top:var(--hs-menu-ai-y);transform:none;}
html[data-entry-surface] header>.hs-menu-ai-entry[data-ai-placement=inline]{position:static;display:inline-flex;margin-left:6px;}
html[data-entry-surface] header>.hs-menu-ai-entry[hidden]{display:none!important;}
html[data-entry-surface] header>.hs-menu-ai-entry svg{width:22px;height:22px;}
html[data-entry-surface=chat] .app-header .header-left{width:88px;}

html[data-entry-surface] header>.hs-menu-ai-entry{flex-direction:column;gap:0;line-height:1;}
html[data-entry-surface] .hs-menu-ai-label{font:600 8px/10px system-ui;letter-spacing:.7px;pointer-events:none;}
/* Match the eventual dark contact control before its delayed stylesheet arrives. */
html[data-entry-surface] body:has(.circular-home) [data-hs-consult]{background:rgba(38,37,33,.93)!important;color:#eee9df!important;border-color:rgba(238,233,223,.22)!important;}
