/* =============================================================
   MACHUPICCHU BEST - Chat IA interno
   Convierte la búsqueda IA en un chat limitado a datos de la web.
============================================================= */
.ai-chat-shell{position:relative;font-family:Raleway,system-ui,sans-serif;}
.ai-chat-inline{width:100%;}
.ai-chat-card{background:rgba(255,255,255,.06);border:1px solid rgba(201,168,76,.26);border-radius:18px;box-shadow:0 18px 48px rgba(0,0,0,.22);overflow:hidden;color:var(--text,#F5F0E8)}
.ai-chat-head{display:flex;align-items:center;gap:.65rem;padding:.78rem .9rem;border-bottom:1px solid rgba(201,168,76,.18);background:linear-gradient(135deg,rgba(201,168,76,.16),rgba(255,255,255,.035))}
.ai-chat-avatar{width:34px;height:34px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;background:rgba(201,168,76,.18);color:var(--gold,#C9A84C);flex:0 0 auto}
.ai-chat-title{font-weight:900;font-size:.9rem;color:var(--text,#F5F0E8);line-height:1.15}
.ai-chat-sub{font-size:.72rem;color:var(--text3,#9CA3AF);line-height:1.25;margin-top:.12rem}
.ai-chat-log{display:flex;flex-direction:column;gap:.65rem;max-height:360px;overflow:auto;padding:.85rem;background:rgba(0,0,0,.10);scroll-behavior:smooth}
.ai-chat-msg{max-width:92%;border-radius:16px;padding:.68rem .78rem;line-height:1.48;font-size:.83rem;white-space:normal;word-break:break-word}
.ai-chat-msg.user{align-self:flex-end;background:linear-gradient(135deg,var(--gold-dark,#9A7A2E),var(--gold,#C9A84C));color:#121212;border-bottom-right-radius:6px;font-weight:800}
.ai-chat-msg.bot{align-self:flex-start;background:rgba(255,255,255,.075);border:1px solid rgba(255,255,255,.08);color:var(--text2,#BFB89E);border-bottom-left-radius:6px}
.ai-chat-msg.bot b{color:var(--gold,#C9A84C)}
.ai-chat-msg.bot p{margin:.3rem 0}.ai-chat-msg.bot p:first-child{margin-top:0}.ai-chat-msg.bot p:last-child{margin-bottom:0}
.ai-chat-msg.bot ul{margin:.35rem 0 .2rem;padding-left:1.05rem}.ai-chat-msg.bot li{margin:.18rem 0}
.ai-chat-form{display:flex;gap:.45rem;align-items:center;padding:.68rem;border-top:1px solid rgba(201,168,76,.16);background:rgba(0,0,0,.08)}
.ai-chat-input{flex:1;min-width:0;height:42px;border-radius:999px;border:1px solid rgba(201,168,76,.30);background:rgba(255,255,255,.08);color:var(--text,#F5F0E8);padding:0 .92rem;font:700 .84rem Raleway,system-ui,sans-serif;outline:none}
.ai-chat-input::placeholder{color:var(--text3,#8A8070);opacity:1}
.ai-chat-send{height:42px;border:0;border-radius:999px;background:linear-gradient(135deg,var(--gold-dark,#9A7A2E),var(--gold,#C9A84C));color:#121212;padding:0 .95rem;font:900 .78rem Raleway,system-ui,sans-serif;cursor:pointer;white-space:nowrap}
.ai-chat-chips{display:flex;gap:.38rem;flex-wrap:wrap;padding:.65rem .85rem;border-top:1px solid rgba(255,255,255,.06);background:rgba(255,255,255,.025)}
.ai-chat-chip{border:1px solid rgba(201,168,76,.28);background:rgba(201,168,76,.08);color:var(--text2,#BFB89E);border-radius:999px;padding:.42rem .62rem;font:800 .72rem Raleway,system-ui,sans-serif;cursor:pointer}
.ai-chat-products{display:grid;gap:.55rem;margin-top:.62rem}
.ai-chat-product{display:grid;grid-template-columns:58px 1fr;gap:.58rem;align-items:center;padding:.55rem;border:1px solid rgba(201,168,76,.18);border-radius:14px;background:rgba(255,255,255,.045);cursor:pointer;text-decoration:none;color:inherit}
.ai-chat-product:hover{border-color:rgba(201,168,76,.42);background:rgba(201,168,76,.08)}
.ai-chat-product img{width:58px;height:50px;object-fit:cover;border-radius:10px;background:rgba(0,0,0,.12)}
.ai-chat-product b{display:block;color:var(--text,#F5F0E8);font-size:.8rem;line-height:1.25;margin-bottom:.18rem}
.ai-chat-product span{display:block;color:var(--text3,#8A8070);font-size:.72rem;line-height:1.3}
.ai-chat-actions{display:flex;gap:.45rem;flex-wrap:wrap;margin-top:.55rem}
.ai-chat-action{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;padding:.5rem .7rem;background:rgba(201,168,76,.12);border:1px solid rgba(201,168,76,.28);color:var(--gold,#C9A84C)!important;text-decoration:none!important;font-weight:900;font-size:.72rem;cursor:pointer}
.ai-chat-action.primary{background:linear-gradient(135deg,var(--gold-dark,#9A7A2E),var(--gold,#C9A84C));color:#121212!important;border:0}
.ai-chat-muted{color:var(--text3,#8A8070);font-size:.76rem;margin-top:.45rem}

@media (min-width:900px){
  #mainNav .nav-links{flex:1 1 auto;display:flex!important;justify-content:center;max-width:680px;margin:0 .8rem;min-width:360px;}
  .desktop-ai-search{width:min(680px,56vw);position:relative;display:block!important;overflow:visible;z-index:80;}
  .desktop-ai-search.ai-chat-mounted{overflow:visible;}
  .desktop-ai-search .ai-chat-shell{position:relative;width:100%;}
  .desktop-ai-search .ai-chat-shell > .ai-chat-form{display:flex!important;gap:.45rem;align-items:center;border-radius:999px;border:1px solid rgba(201,168,76,.28);background:rgba(255,255,255,.055);padding:.25rem .28rem;box-shadow:0 8px 26px rgba(0,0,0,.13);}
  .desktop-ai-search .ai-chat-shell > .ai-chat-form .ai-chat-input{height:38px;border:0;background:transparent!important;box-shadow:none;padding:0 .75rem;}
  .desktop-ai-search .ai-chat-shell > .ai-chat-form .ai-chat-send{height:36px;padding:0 .85rem;}
  .desktop-ai-search .ai-chat-card{position:absolute;top:calc(100% + 10px);left:0;right:0;z-index:9999;display:none;border-radius:18px;}
  .desktop-ai-search.open .ai-chat-card{display:block;}
  .desktop-ai-search .ai-chat-log{max-height:330px;min-height:120px;}
  .desktop-ai-search .ai-chat-head{display:flex;}
  .desktop-ai-search .ai-chat-chips{padding:.52rem .7rem;}
  .desktop-ai-search .ai-chat-card .ai-chat-form{border-radius:0;border-left:0;border-right:0;border-bottom:0;border-top:1px solid rgba(201,168,76,.16);background:rgba(0,0,0,.08);padding:.62rem;}
  .desktop-ai-search .desktop-ai-box,.desktop-ai-search .desktop-ai-btn,.desktop-ai-search .desktop-ai-results{display:none!important;}
}
@media (max-width:899px){
  #mobileTourSearch.mobile-tour-search{display:block!important;margin:0 0 1rem;}
  #mobileTourSearch .ai-chat-card{border-radius:18px;}
  #mobileTourSearch .ai-chat-log{max-height:320px;}
  #mobileTourSearch .ai-chat-form{position:relative;}
  #mobileSearchResults{display:none!important;}
  body.mb-search-active #tourFilters,body.mb-search-active #toursGrid,body.mb-search-active #packages-grid{display:block!important;}
}

html[data-theme="light"] .ai-chat-card,html.theme-light .ai-chat-card,body.theme-light .ai-chat-card{background:#FFFFFF!important;color:#1B2430!important;border-color:rgba(154,122,46,.28)!important;box-shadow:0 18px 48px rgba(27,36,48,.16)!important}
html[data-theme="light"] .ai-chat-head,html.theme-light .ai-chat-head,body.theme-light .ai-chat-head{background:#F8F3E8!important;border-bottom-color:rgba(154,122,46,.22)!important}
html[data-theme="light"] .ai-chat-title,html.theme-light .ai-chat-title,body.theme-light .ai-chat-title{color:#1B2430!important}
html[data-theme="light"] .ai-chat-sub,html.theme-light .ai-chat-sub,body.theme-light .ai-chat-sub,html[data-theme="light"] .ai-chat-muted,html.theme-light .ai-chat-muted,body.theme-light .ai-chat-muted{color:#6B7280!important}
html[data-theme="light"] .ai-chat-log,html.theme-light .ai-chat-log,body.theme-light .ai-chat-log{background:#FCFAF6!important}
html[data-theme="light"] .ai-chat-msg.bot,html.theme-light .ai-chat-msg.bot,body.theme-light .ai-chat-msg.bot{background:#F7F2E8!important;color:#4B5563!important;border-color:rgba(154,122,46,.18)!important}
html[data-theme="light"] .ai-chat-input,html.theme-light .ai-chat-input,body.theme-light .ai-chat-input{background:#FFFFFF!important;color:#1B2430!important;-webkit-text-fill-color:#1B2430!important;border-color:rgba(154,122,46,.35)!important}
html[data-theme="light"] .ai-chat-input::placeholder,html.theme-light .ai-chat-input::placeholder,body.theme-light .ai-chat-input::placeholder{color:#6B7280!important}
html[data-theme="light"] .ai-chat-form,html.theme-light .ai-chat-form,body.theme-light .ai-chat-form{background:#F8F3E8!important;border-top-color:rgba(154,122,46,.20)!important}
html[data-theme="light"] .desktop-ai-search .ai-chat-form,html.theme-light .desktop-ai-search .ai-chat-form,body.theme-light .desktop-ai-search .ai-chat-form{background:#FFFFFF!important;border-color:rgba(154,122,46,.32)!important}
html[data-theme="light"] .desktop-ai-search .ai-chat-card .ai-chat-form,html.theme-light .desktop-ai-search .ai-chat-card .ai-chat-form,body.theme-light .desktop-ai-search .ai-chat-card .ai-chat-form{background:#F8F3E8!important;border-top-color:rgba(154,122,46,.20)!important}
html[data-theme="light"] .ai-chat-chip,html.theme-light .ai-chat-chip,body.theme-light .ai-chat-chip{background:#F4EBD8!important;color:#1B2430!important;border-color:rgba(154,122,46,.30)!important}
html[data-theme="light"] .ai-chat-product,html.theme-light .ai-chat-product,body.theme-light .ai-chat-product{background:#FFFFFF!important;border-color:rgba(154,122,46,.18)!important}
html[data-theme="light"] .ai-chat-product b,html.theme-light .ai-chat-product b,body.theme-light .ai-chat-product b{color:#1B2430!important}
html[data-theme="light"] .ai-chat-product span,html.theme-light .ai-chat-product span,body.theme-light .ai-chat-product span{color:#6B7280!important}

@media (min-width:900px){
  html[data-theme="light"] .desktop-ai-search .ai-chat-shell > .ai-chat-form,
  html.theme-light .desktop-ai-search .ai-chat-shell > .ai-chat-form,
  body.theme-light .desktop-ai-search .ai-chat-shell > .ai-chat-form{background:#FFFFFF!important;border-color:rgba(154,122,46,.32)!important;}
  html[data-theme="dark"] .desktop-ai-search .ai-chat-shell > .ai-chat-form,
  html.theme-dark .desktop-ai-search .ai-chat-shell > .ai-chat-form,
  body.theme-dark .desktop-ai-search .ai-chat-shell > .ai-chat-form{background:rgba(255,255,255,.055)!important;border-color:rgba(201,168,76,.28)!important;}
}
