/* Mobile preview: compact floating icons */
@media (max-width: 767px) {

  /* Hide WhatsApp text, keep its icon */
  #tree-whatsapp-label {
    display: none !important;
  }

  /* Smaller AI Assistant button */
  #ttc-launcher {
    width: 65px !important;
    height: 65px !important;
    min-width: 65px !important;
    min-height: 65px !important;
  }

  /* Adjust AI position */
  #ttc-root {
    right: 12px !important;
    bottom: 16px !important;
  }
}

/* Three floating buttons in one bottom row */
@media (max-width:767px) {

  #tree-whatsapp-wrap {
    position:fixed !important;
    left:calc(50% - 112px) !important;
    right:auto !important;
    bottom:20px !important;
    transform:translateX(-50%) !important;
  }

  #tree-float-entry {
    position:fixed !important;
    left:50% !important;
    right:auto !important;
    bottom:20px !important;
    transform:translateX(-50%) !important;
    z-index:2147483001 !important;
  }

  #ttc-root {
    position:fixed !important;
    left:calc(50% + 112px) !important;
    right:auto !important;
    bottom:20px !important;
    transform:translateX(-50%) !important;
  }

}

/* FINAL: Three floating buttons */
@media (max-width:767px) {

  /* WhatsApp - left */
  #tree-whatsapp-wrap {
    left:calc(50% - 90px) !important;
    right:auto !important;
    bottom:calc(16px + env(safe-area-inset-bottom)) !important;
    transform:translateX(-50%) !important;
  }

  /* Products - center */
  #tree-float-entry,
  .tree-floating-trigger {
    position:fixed !important;
    left:50% !important;
    right:auto !important;
    bottom:calc(16px + env(safe-area-inset-bottom)) !important;
    transform:translateX(-50%) !important;
  }

  #tree-float-entry {
    align-items:center !important;
    z-index:2147482000 !important;
  }

  #tree-float-entry .tree-float-label {
    position:absolute !important;
    bottom:70px !important;
    white-space:nowrap !important;
  }

  /* AI Assistant - right */
  #ttc-root {
    left:calc(50% + 90px) !important;
    right:auto !important;
    bottom:calc(16px + env(safe-area-inset-bottom)) !important;
    transform:translateX(-50%) !important;
  }

  #ttc-launcher {
    width:60px !important;
    height:60px !important;
  }

}

/* 3TREE FINAL MOBILE FLOATING BUTTONS */
@media screen and (max-width:767px) {

  /* WhatsApp */
  #tree-whatsapp-wrap {
    position:fixed !important;
    left:calc(50% - 88px) !important;
    right:auto !important;
    bottom:calc(20px + env(safe-area-inset-bottom)) !important;
    transform:translateX(-50%) !important;
    z-index:2147482000 !important;
  }

  #tree-whatsapp-label {
    display:none !important;
  }

  #tree-whatsapp-float {
    width:58px !important;
    height:58px !important;
    min-width:58px !important;
  }

  /* Products */
  #tree-float-entry {
    position:fixed !important;
    left:50% !important;
    right:auto !important;
    bottom:calc(20px + env(safe-area-inset-bottom)) !important;
    transform:translateX(-50%) !important;
    align-items:center !important;
    z-index:2147482000 !important;
  }

  #tree-float-entry button {
    width:58px !important;
    height:58px !important;
  }

  #tree-float-entry .tree-float-label {
    position:absolute !important;
    bottom:68px !important;
    white-space:nowrap !important;
  }

  /* AI Assistant */
  #ttc-root {
    position:fixed !important;
    left:calc(50% + 88px) !important;
    right:auto !important;
    bottom:calc(20px + env(safe-area-inset-bottom)) !important;
    transform:translateX(-50%) !important;
    z-index:2147482000 !important;
  }

  #ttc-launcher {
    width:58px !important;
    height:58px !important;
    min-width:58px !important;
    min-height:58px !important;
  }

}

@media (max-width:767px) {
  #ttc-launcher {
    width:58px !important;
    height:58px !important;
    min-width:58px !important;
    min-height:58px !important;
    box-sizing:border-box !important;
    overflow:hidden !important;
  }

  #ttc-launcher::before {
    inset:3px !important;
  }

  #ttc-launcher svg {
    width:23px !important;
    height:23px !important;
  }

  #ttc-launcher {
    font-size:9px !important;
    gap:1px !important;
  }
}

/* AI Assistant: icon only */
@media (max-width:767px) {

  #ttc-launcher .ttc-launch-label {
    display:none !important;
  }

  #ttc-launcher .ttc-person {
    width:30px !important;
    height:30px !important;
    flex-shrink:0 !important;
  }

  #ttc-launcher {
    align-items:center !important;
    justify-content:center !important;
    padding:0 !important;
    gap:0 !important;
  }

}

/* FIX AI CHAT PANEL ONLY - MOBILE */
@media screen and (max-width:767px) {

  #ttc-root:has(#ttc-panel[style*="block"]) {
    left:50% !important;
    right:auto !important;
    bottom:12px !important;
    transform:translateX(-50%) !important;
  }

  #ttc-root:has(#ttc-panel[style*="block"]) #ttc-panel {
    width:calc(100vw - 24px) !important;
    max-width:390px !important;
    height:min(610px, calc(100dvh - 24px)) !important;
    box-sizing:border-box !important;
  }

}

/* AI CLOSE BUTTON - MOBILE ONLY */
@media (max-width:767px) {

  #ttc-close {
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;

    width:38px !important;
    height:38px !important;

    background:#211915 !important;
    color:#ffffff !important;

    border:2px solid #dcb85f !important;
    border-radius:50% !important;

    font-size:26px !important;
    line-height:1 !important;

    position:relative !important;
    z-index:100 !important;
    cursor:pointer !important;
    flex-shrink:0 !important;
  }

}
