
:root{
  --dt-radius-sm:12px;
  --dt-radius-md:16px;
  --dt-radius-lg:22px;
  --dt-btn-h:42px;
  --dt-btn-h-sm:36px;
  --dt-btn-h-lg:46px;
  --dt-panel-gap:18px;
  --dt-card-border:rgba(91,105,138,.32);
  --dt-card-bg:linear-gradient(180deg,rgba(10,17,31,.96),rgba(5,10,21,.98));
  --dt-soft-red:#ff3358;
  --dt-soft-red-2:#ff4b67;
  --dt-text:#f6f8ff;
  --dt-muted:#97a4bd;
  --dt-glow:0 14px 40px rgba(4,8,18,.38);
  --dt-glow-soft:0 0 0 1px rgba(255,255,255,.02), 0 18px 38px rgba(0,0,0,.24);
}
html,body{max-width:100%;overflow-x:hidden;}
body{font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;}
.page-header h1,.section-head h2,.c4-product-info h2,.messenger-toolbar h1,.admin-top-brand h1,.new-chat-panel h2{font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif!important;letter-spacing:-.02em;}
.btn,
button,
input[type=submit],
input[type=button],
select,
.icon-btn{border-radius:14px;}
.btn{
  min-height:var(--dt-btn-h);
  padding:.78rem 1.15rem;
  line-height:1.05;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.55rem;
  width:auto;
  white-space:nowrap;
}
.btn.btn-sm{min-height:var(--dt-btn-h-sm);padding:.55rem .85rem;border-radius:12px;}
.icon-btn{width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;flex:0 0 40px;}
.btn-block{width:100%;}
.filters>.btn,
.support-status-control .btn,
.messenger-filters button,
.messenger-panel .btn,
.pro-chat-sidebar>.btn,
.new-chat-panel .btn,
.form-stack .btn-block,
.product-actions form .btn{width:100%;}
.filters{display:grid;grid-template-columns:minmax(220px,2fr) minmax(180px,1fr) minmax(180px,1fr) auto;gap:14px;align-items:end;}
.filters .field{min-width:0;}
.filters .btn{min-width:156px;}
.products-grid{gap:18px;align-items:stretch;}
.product-card{display:flex;flex-direction:column;overflow:hidden;border-radius:20px;box-shadow:var(--dt-glow-soft);background:var(--dt-card-bg);}
.product-media{display:block;position:relative;aspect-ratio:16/9;overflow:hidden;background:radial-gradient(circle at 50% 30%,rgba(22,31,54,.95),rgba(6,10,18,.99));}
.product-media img{width:100%;height:100%;display:block;object-fit:cover;object-position:center center;transform:translateZ(0);}
.product-body{display:flex;flex-direction:column;flex:1;padding:16px 16px 16px;gap:12px;}
.product-title{line-height:1.18;min-height:2.4em;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.product-price-line{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;}
.product-details{display:flex;gap:8px;flex-wrap:wrap;margin-top:auto;}
.micro-pill{font-size:.78rem;padding:.42rem .55rem;border-radius:999px;}
.product-actions{display:grid;grid-template-columns:minmax(0,1fr) 44px;gap:10px;align-items:center;}
.product-actions .btn,.product-actions .fav{height:44px;}
.product-actions .fav{display:inline-flex;align-items:center;justify-content:center;width:44px;padding:0;}
.c4-product-detail{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(320px,.9fr);gap:22px;align-items:start;}
.c4-product-visual{min-height:430px;border-radius:26px;padding:20px;background:linear-gradient(180deg,rgba(8,13,25,.96),rgba(4,8,18,.99));display:flex;align-items:center;justify-content:center;overflow:hidden;box-shadow:var(--dt-glow-soft);}
.c4-product-visual img{width:100%;height:100%;max-height:540px;object-fit:contain;object-position:center center;display:block;}
.c4-product-info{min-width:0;display:flex;flex-direction:column;gap:18px;}
.c4-product-info h2{font-size:clamp(2rem,2.3vw,2.9rem);line-height:1.02;margin:0;}
.c4-product-info .muted{font-size:1rem;line-height:1.65;color:#b7c4d8;}
.c4-product-info form .btn{height:50px;font-size:1.05rem;}
.stat-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;}
.stat-card{min-height:120px;display:flex;flex-direction:column;justify-content:space-between;}
.c4-product-assurance{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;}
.c4-product-assurance>div{min-width:0;display:flex;align-items:center;gap:12px;padding:18px 16px;}
.c4-product-assurance small{display:block;letter-spacing:.03em;}
.c4-product-assurance b,.footer-trust-row b{letter-spacing:.01em;word-spacing:.06em;}
.footer-trust-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;}
.footer-trust-row>div{padding:18px 20px;min-width:0;}
.footer-trust-row span,.c4-product-assurance span{display:flex;flex-direction:column;gap:3px;}
.footer-brand-column .footer-logo img{max-width:240px;height:auto;}
.messenger-toolbar,.support-hero{margin-bottom:18px;}
.messenger-kpis{margin-bottom:16px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;}
.messenger-kpis>a{min-height:88px;}
.messenger-shell{display:grid;grid-template-columns:minmax(300px,340px) minmax(0,1fr) minmax(300px,360px);gap:18px;align-items:start;}
.messenger-inbox,.messenger-chat,.messenger-context,.pro-chat-sidebar,.pro-chat-main,.new-chat-panel{border-radius:22px;box-shadow:var(--dt-glow-soft);background:var(--dt-card-bg);}
.messenger-inbox,.messenger-chat,.messenger-context{min-height:calc(100vh - 220px);}
.messenger-inbox,.messenger-chat,.messenger-context{overflow:hidden;}
.messenger-inbox-head{padding:14px;display:flex;flex-direction:column;gap:14px;}
.messenger-thread-list{max-height:calc(100vh - 420px);overflow:auto;}
.messenger-thread{padding:14px 12px;gap:12px;align-items:flex-start;}
.messenger-thread-copy{min-width:0;}
.messenger-thread strong{display:block;line-height:1.2;margin-top:3px;}
.messenger-chat{display:grid;grid-template-rows:auto minmax(0,1fr) auto;}
.messenger-chat-head{padding:14px 16px;gap:12px;}
.messenger-messages{min-height:420px;max-height:calc(100vh - 400px);padding:18px;overflow:auto;scroll-padding-bottom:24px;}
.messenger-message-row{display:flex;gap:12px;margin-bottom:16px;align-items:flex-end;}
.messenger-message-row.mine{justify-content:flex-end;}
.messenger-message-avatar{flex:0 0 34px;width:34px;height:34px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;}
.messenger-bubble{max-width:min(78%,720px);padding:14px 16px;border-radius:18px;line-height:1.55;}
.messenger-bubble footer{display:flex;gap:10px;justify-content:space-between;align-items:center;margin-top:10px;font-size:.76rem;opacity:.82;}
.messenger-compose-wrap{padding:14px 16px 16px;border-top:1px solid rgba(99,116,150,.18);background:rgba(6,10,20,.82);backdrop-filter:blur(10px);position:sticky;bottom:0;}
.quick-replies{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px;}
.quick-replies button{border-radius:999px;padding:.5rem .75rem;font-size:.78rem;}
.messenger-compose{display:grid;grid-template-columns:44px minmax(0,1fr) 46px;gap:10px;align-items:end;}
.messenger-compose textarea{min-height:46px;max-height:130px;border-radius:16px;padding:12px 14px;line-height:1.45;resize:none;}
.messenger-send,.messenger-attach{height:44px;width:44px;display:inline-flex;align-items:center;justify-content:center;border-radius:14px;}
.messenger-context{position:sticky;top:18px;padding:16px;display:flex;flex-direction:column;gap:14px;max-height:calc(100vh - 130px);overflow:auto;}
.messenger-profile{padding:16px;border-radius:20px;background:linear-gradient(180deg,rgba(13,22,40,.88),rgba(7,12,24,.94));border:1px solid var(--dt-card-border);}
.messenger-profile h3{margin:8px 0 2px;font-size:1.35rem;}
.messenger-profile p{margin:0;color:var(--dt-muted);overflow-wrap:anywhere;}
.profile-balance{margin-top:14px;padding:12px 14px;border-radius:16px;display:inline-flex;flex-direction:column;gap:4px;min-width:120px;background:linear-gradient(180deg,rgba(4,55,41,.32),rgba(4,31,26,.52));border:1px solid rgba(27,192,113,.25);}
.profile-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
.context-list{display:grid;grid-template-columns:1fr;gap:8px;margin:0;}
.context-list>div{padding:10px 12px;border-radius:14px;background:rgba(10,16,28,.74);border:1px solid rgba(97,113,143,.16);}
.context-list dt{font-size:.72rem;text-transform:uppercase;letter-spacing:.08em;color:#88a0c0;margin-bottom:4px;}
.context-list dd{margin:0;font-size:.95rem;}
.messenger-panel{padding:14px;border-radius:18px;background:rgba(10,16,28,.74);border:1px solid rgba(97,113,143,.16);display:flex;flex-direction:column;gap:12px;}
.messenger-panel h4{margin:0;font-size:.92rem;letter-spacing:.05em;text-transform:uppercase;color:#c8d3e7;}
.recent-order-link{display:flex;justify-content:space-between;align-items:center;padding:10px 0;border-bottom:1px solid rgba(97,113,143,.16);gap:10px;}
.recent-order-link:last-child{border-bottom:0;}
.pro-chat-layout{display:grid;grid-template-columns:minmax(280px,320px) minmax(0,1fr);gap:18px;align-items:start;}
.pro-chat-sidebar{padding:16px;display:flex;flex-direction:column;gap:14px;position:sticky;top:18px;max-height:calc(100vh - 130px);overflow:auto;}
.pro-chat-main{display:grid;grid-template-rows:auto minmax(0,1fr) auto;min-height:calc(100vh - 220px);overflow:hidden;}
.pro-chat-head{padding:14px 16px;gap:12px;}
.pro-chat-messages{min-height:420px;max-height:calc(100vh - 410px);padding:20px 18px;overflow:auto;}
.chat-bubble-row{display:flex;align-items:flex-end;gap:12px;margin-bottom:16px;}
.chat-bubble-row.mine{justify-content:flex-end;}
.bubble-avatar{flex:0 0 34px;width:34px;height:34px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;overflow:hidden;}
.bubble-avatar img{width:100%;height:100%;object-fit:cover;}
.chat-bubble{max-width:min(80%,720px);padding:14px 16px;border-radius:18px;line-height:1.55;}
.chat-bubble footer{display:flex;justify-content:space-between;gap:12px;margin-top:10px;font-size:.76rem;opacity:.82;}
.pro-chat-compose{padding:14px 16px;border-top:1px solid rgba(99,116,150,.18);display:grid;grid-template-columns:44px minmax(0,1fr) 48px;gap:10px;align-items:end;position:sticky;bottom:0;background:rgba(6,10,20,.84);backdrop-filter:blur(10px);}
.attachment-button,.send-button{height:44px;width:44px;border-radius:14px;display:inline-flex;align-items:center;justify-content:center;}
.compose-field textarea{min-height:46px;max-height:130px;border-radius:16px;padding:12px 14px;line-height:1.45;resize:none;}
.compose-field small{display:block;margin-top:6px;color:#8ea0bd;}
.new-chat-panel{padding:24px;max-width:none;display:flex;flex-direction:column;gap:16px;}
.new-chat-logo{width:68px;height:68px;border-radius:18px;object-fit:cover;}
.topic-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;}
.topic-grid label span{min-height:92px;border-radius:18px;padding:14px 12px;display:flex;flex-direction:column;justify-content:center;gap:6px;}
.file-drop{display:flex;gap:14px;align-items:center;padding:18px;border:1.5px dashed rgba(255,255,255,.14);border-radius:18px;cursor:pointer;background:rgba(8,13,25,.74);transition:.18s ease;}
.file-drop:hover{border-color:rgba(255,90,120,.4);background:rgba(10,16,30,.88);}
.dt-file-preview{display:none;align-items:center;gap:12px;padding:12px;border-radius:14px;background:rgba(7,13,24,.92);border:1px solid rgba(99,116,150,.18);margin-top:10px;}
.dt-file-preview.is-visible{display:flex;}
.dt-file-preview img{width:68px;height:68px;border-radius:12px;object-fit:cover;background:#0a1020;}
.dt-file-preview .dt-file-meta{min-width:0;display:flex;flex-direction:column;gap:4px;}
.dt-file-preview .dt-file-meta b{font-size:.92rem;overflow-wrap:anywhere;}
.dt-file-preview .dt-file-meta small{color:var(--dt-muted);}
.dt-floating-stack{position:fixed;right:18px;bottom:18px;display:flex;flex-direction:column;gap:10px;z-index:70;max-width:min(340px,calc(100vw - 24px));}
.dt-floating-card{display:flex;gap:12px;align-items:center;padding:14px 14px;border-radius:18px;background:linear-gradient(180deg,rgba(8,14,26,.98),rgba(6,10,20,.98));border:1px solid rgba(94,112,145,.2);box-shadow:var(--dt-glow);}
.dt-floating-card .dt-floating-copy{min-width:0;display:flex;flex-direction:column;gap:3px;}
.dt-floating-card b{font-size:.93rem;line-height:1.2;}
.dt-floating-card small{color:var(--dt-muted);line-height:1.35;}
.dt-floating-card .dt-actions{display:flex;gap:8px;margin-left:auto;}
.dt-floating-card .btn{min-height:36px;padding:.58rem .8rem;font-size:.84rem;}
.dt-floating-card .icon-btn{background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.08);}
.messenger-thread-list,.messenger-messages,.messenger-context,.conversation-list,.pro-chat-messages{-webkit-overflow-scrolling:touch;scrollbar-width:thin;}
body.dt-hide-overwide .btn.btn-block:not(.send-button):not(.messenger-send){max-width:100%;}
@media (max-width: 1366px){
  .store-content-inner,.admin-content{padding-inline:18px;}
  .messenger-shell{grid-template-columns:minmax(280px,320px) minmax(0,1fr) minmax(280px,320px);}
  .c4-product-detail{grid-template-columns:minmax(0,1.15fr) minmax(300px,1fr);}
}
@media (max-width: 1180px){
  .messenger-shell{grid-template-columns:minmax(280px,320px) minmax(0,1fr);}
  .messenger-context{grid-column:1 / -1;position:static;max-height:none;}
  .pro-chat-layout{grid-template-columns:1fr;}
  .pro-chat-sidebar{position:static;max-height:none;}
  .filters{grid-template-columns:repeat(2,minmax(0,1fr));}
  .filters>.btn{grid-column:1 / -1;}
  .c4-product-detail{grid-template-columns:1fr;}
  .c4-product-visual{min-height:360px;}
  .footer-trust-row,.c4-product-assurance{grid-template-columns:repeat(2,minmax(0,1fr));}
  .topic-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width: 920px){
  .products-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .messenger-shell{grid-template-columns:1fr;}
  .messenger-inbox,.messenger-chat,.messenger-context,.pro-chat-main{min-height:auto;}
  .messenger-thread-list,.messenger-messages,.pro-chat-messages{max-height:none;}
  .messenger-context{position:static;}
}
@media (max-width: 720px){
  .filters{grid-template-columns:1fr;}
  .products-grid{grid-template-columns:1fr;}
  .footer-trust-row,.c4-product-assurance,.topic-grid,.stat-grid,.messenger-kpis,.profile-actions{grid-template-columns:1fr;}
  .c4-header-main{gap:10px;}
  .c4-search{min-width:0;}
  .c4-actions{gap:8px;}
  .c4-balance{min-width:auto;padding-inline:12px;}
  .product-actions{grid-template-columns:minmax(0,1fr) 42px;}
  .c4-product-visual{min-height:280px;padding:14px;}
  .messenger-compose,.pro-chat-compose{grid-template-columns:42px minmax(0,1fr) 44px;}
  .chat-bubble,.messenger-bubble{max-width:92%;}
  .dt-floating-stack{left:12px;right:12px;bottom:12px;max-width:none;}
}


/* Digitiendita v1.0.26.3 — Chat Flow + Navegación + R2 unificado */
@media (prefers-reduced-motion:no-preference){
  .admin-nav>a,.c4-nav>a,.pro-chat-sidebar a,.messenger-thread,.btn,.icon-btn,.product-card,.topic-grid label span{transition:transform .16s ease,border-color .16s ease,background-color .16s ease,box-shadow .16s ease,color .16s ease,opacity .16s ease;}
  .admin-nav>a:hover,.c4-nav>a:hover{transform:translateX(2px)}
  .product-card:hover{transform:translateY(-3px);box-shadow:0 18px 44px rgba(0,0,0,.30)}
  .dt-page-enter{animation:dtPageEnter .18s ease both}
  @keyframes dtPageEnter{from{opacity:.55;transform:translateY(3px)}to{opacity:1;transform:none}}
}
.admin-nav{display:flex!important;flex-direction:column!important;gap:4px!important}
.admin-nav>a{min-height:44px!important;padding:10px 13px!important;border-radius:12px!important;position:relative}
.admin-nav>a.active{background:linear-gradient(90deg,rgba(20,31,53,.96),rgba(17,20,28,.96))!important;box-shadow:inset 3px 0 #e11d48,0 0 0 1px rgba(74,93,129,.35)!important}
.admin-nav .dt-nav-section{margin:14px 12px 5px;color:#697991;font-size:9px;font-weight:900;letter-spacing:.14em;text-transform:uppercase;pointer-events:none}
.admin-nav .dt-nav-system{margin-top:18px}
.admin-nav a[data-dt-r2-unified]{color:#c8d4e7}
.admin-nav a[data-dt-r2-unified] .ui-icon{color:#ff4969}
.dt-mobile-chat-back{display:none;align-items:center;gap:7px;min-height:36px;padding:0 10px;border:1px solid rgba(95,112,144,.32);border-radius:11px;background:#0d121c;color:#dce5f5;text-decoration:none;font-size:12px;font-weight:800;flex:0 0 auto}
.dt-chat-live{display:inline-flex;align-items:center;gap:6px;font-size:10px;font-weight:800;color:#70e4b4}
.dt-chat-live::before{content:'';width:7px;height:7px;border-radius:50%;background:#2ee6a6;box-shadow:0 0 0 4px rgba(46,230,166,.08)}
.dt-chat-live.syncing::before{animation:dtPulse 1s ease infinite}
@keyframes dtPulse{50%{opacity:.35;transform:scale(.78)}}
.dt-chat-notice{position:sticky;top:0;z-index:5;display:none;align-items:center;justify-content:center;padding:7px 10px;font-size:11px;background:rgba(12,22,38,.94);color:#bcd0ea;border-bottom:1px solid rgba(88,108,145,.2);backdrop-filter:blur(8px)}
.dt-chat-notice.show{display:flex}
.pro-chat-main,.messenger-chat{isolation:isolate}
.pro-chat-messages,.messenger-messages{overscroll-behavior:contain;scrollbar-gutter:stable}
.pro-chat-compose,.messenger-compose-wrap{z-index:6}
.pro-chat-compose textarea:focus,.messenger-compose textarea:focus{border-color:rgba(225,29,72,.6)!important;box-shadow:0 0 0 3px rgba(225,29,72,.09)!important}
.dt-notification-toast{position:fixed;top:18px;right:18px;z-index:9999;width:min(380px,calc(100vw - 24px));padding:14px 15px;border-radius:18px;background:linear-gradient(180deg,#101722,#090e17);border:1px solid rgba(100,119,151,.28);box-shadow:0 24px 70px rgba(0,0,0,.46);display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:start}
.dt-notification-toast strong{display:block;margin-bottom:4px;font-size:14px;color:#fff}.dt-notification-toast p{margin:0;color:#aebbd0;font-size:12px;line-height:1.45}.dt-notification-toast button{width:34px;height:34px;border-radius:10px;border:1px solid rgba(255,255,255,.09);background:rgba(255,255,255,.03);color:#fff}.dt-notification-toast a{display:inline-flex;margin-top:9px;color:#ff6a85;font-weight:800;font-size:12px;text-decoration:none}
.r2-unified-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.r2-unified-grid .stat-card{min-height:104px}.r2-actions{display:flex;gap:9px;flex-wrap:wrap}.r2-actions form{margin:0}.r2-secret-state{display:inline-flex;padding:4px 8px;border-radius:999px;font-size:10px;font-weight:850;background:#102c22;color:#76e1b4;border:1px solid rgba(51,206,144,.25)}
@media(max-width:1180px){.r2-unified-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){
  body.dt-client-ticket .support-hero{display:none!important}
  body.dt-client-ticket .pro-chat-layout{display:block!important;margin-top:0!important}
  body.dt-client-ticket .pro-chat-sidebar{display:none!important}
  body.dt-client-ticket .pro-chat-main{min-height:calc(100dvh - 126px)!important;border-radius:16px!important;box-shadow:none!important}
  body.dt-client-ticket .pro-chat-head{position:sticky;top:0;z-index:9;background:rgba(8,12,21,.97);backdrop-filter:blur(10px)}
  body.dt-client-ticket .dt-mobile-chat-back{display:inline-flex}
  body.dt-client-ticket .pro-chat-messages{min-height:0!important;max-height:none!important;height:calc(100dvh - 292px)!important;padding:14px 10px!important}
  body.dt-client-ticket .pro-chat-compose{position:sticky!important;bottom:0!important;padding:10px!important;background:rgba(7,11,20,.98)!important}
  body.dt-client-ticket .chat-bubble{max-width:90%!important}
  body.dt-client-list .support-hero{display:none!important}
  body.dt-client-list .pro-chat-main{display:none!important}
  body.dt-client-list .pro-chat-layout{display:block!important}
  body.dt-client-list .pro-chat-sidebar{display:flex!important;position:static!important;max-height:none!important;min-height:calc(100dvh - 160px)!important}
  .dt-notification-toast{top:10px;left:10px;right:10px;width:auto}
  .r2-unified-grid{grid-template-columns:1fr}
}
