/* InfoBadajoz · capa común de pulido (tienda, panel y TPV).
   Solo añade transiciones, foco, estados de carga y ajustes responsive; no cambia la lógica. */
:root{--pl-ease:cubic-bezier(.22,.8,.3,1);--pl-g:#22c55e}
html{-webkit-tap-highlight-color:transparent;scroll-behavior:smooth}
@media (prefers-reduced-motion:no-preference){
  /* entrada de página */
  @keyframes pl-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
  @keyframes pl-pop{from{opacity:0;transform:translateY(10px) scale(.97)}to{opacity:1;transform:none}}
  @keyframes pl-fade{from{opacity:0}to{opacity:1}}
  @keyframes pl-slide{from{opacity:0;transform:translateX(18px)}to{opacity:1;transform:none}}
  @keyframes pl-sheet{from{transform:translateY(40px);opacity:0}to{transform:none;opacity:1}}
  @keyframes pl-spin{to{transform:rotate(360deg)}}
  @keyframes pl-shim{to{background-position:-200% 0}}
  .main .content>*,.ppage>*{animation:pl-in .42s var(--pl-ease) both}
  .main .content>*:nth-child(2),.ppage>*:nth-child(2){animation-delay:.05s}
  .main .content>*:nth-child(3),.ppage>*:nth-child(3){animation-delay:.09s}
  .main .content>*:nth-child(4),.ppage>*:nth-child(4){animation-delay:.13s}
  .main .content>*:nth-child(n+5),.ppage>*:nth-child(n+5){animation-delay:.17s}
  .kpis>.kpi,.kpi-row>.kpi{animation:pl-in .45s var(--pl-ease) both}
  .kpis>.kpi:nth-child(2){animation-delay:.05s}.kpis>.kpi:nth-child(3){animation-delay:.1s}.kpis>.kpi:nth-child(4){animation-delay:.15s}
  /* modales, notificaciones, desplegables */
  .overlay{animation:pl-fade .2s ease both}
  .overlay>.modal{animation:pl-pop .28s var(--pl-ease) both}
  .flash,.pflash,.flashes>*{animation:pl-slide .35s var(--pl-ease) both}
  .ui-pop,.ui-menu,.ui-list,[role=listbox]:not([hidden]),.sugg:not([hidden]),.search-pop:not([hidden]){animation:pl-pop .18s var(--pl-ease) both;transform-origin:top center}
  .side.open,.side[data-open]{transition:transform .3s var(--pl-ease)}
  .scrim:not([hidden]){animation:pl-fade .25s ease both}
  /* hover / pulsación */
  .card,.kpi,.pcard,.tile,.prod,.pc{transition:box-shadow .22s var(--pl-ease),transform .22s var(--pl-ease),border-color .2s}
  .kpi:hover,a.card:hover,.card.lift:hover{transform:translateY(-2px);box-shadow:0 10px 28px -12px rgba(15,23,42,.28)}
  .btn,.pbtn,button.pk,.tabbar a,.tabbar button{transition:transform .15s var(--pl-ease),box-shadow .2s,background-color .18s,border-color .18s,color .18s}
  .btn:hover .ic,.nav:hover .ic{transform:scale(1.1)}
  .btn .ic,.nav .ic{transition:transform .2s var(--pl-ease),color .15s}
  .btn:active,.pbtn:active,.tabbar a:active{transform:scale(.96)}
  table tbody tr{transition:background-color .15s}
  .side a.nav{transition:background-color .15s,color .15s,padding-left .2s var(--pl-ease)}
  .side a.nav:hover{padding-left:16px}
  .tabbar .on .ic{animation:pl-pop .3s var(--pl-ease) both}
  /* estados de carga */
  .btn.is-loading,.pbtn.is-loading,button.is-loading{position:relative;pointer-events:none;color:transparent!important}
  .btn.is-loading>*,button.is-loading>*{opacity:0}
  .btn.is-loading::after,button.is-loading::after{content:"";position:absolute;inset:0;margin:auto;width:18px;height:18px;border-radius:50%;border:2.5px solid rgba(255,255,255,.45);border-top-color:#fff;animation:pl-spin .7s linear infinite}
  .btn:not(.btn-p).is-loading::after{border-color:rgba(15,23,42,.2);border-top-color:#0f172a}
  .skeleton,.sk{background:linear-gradient(90deg,#eef1f4 25%,#f8fafc 40%,#eef1f4 60%);background-size:200% 100%;animation:pl-shim 1.3s linear infinite;border-radius:10px;color:transparent!important}
  img[data-pl]{opacity:0;transition:opacity .35s ease}img[data-pl].ok{opacity:1}
}
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}
  .btn.is-loading::after,button.is-loading::after{animation:none;content:"…";color:inherit}
}
/* foco accesible y coherente */
:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:3px solid rgba(34,197,94,.55);outline-offset:2px;border-radius:8px}
input:focus-visible,select:focus-visible,textarea:focus-visible{outline-offset:0}
::selection{background:rgba(34,197,94,.25)}

/* flashes con icono automático (el icono lo pone polish.js) */
.flash,.pflash{display:flex;gap:10px;align-items:flex-start}
.flash>.pl-ic,.pflash>.pl-ic{flex:none;width:20px;height:20px;margin-top:1px}
.flash-ok>.pl-ic,.pflash-ok>.pl-ic{color:#16a34a}.flash-error>.pl-ic,.pflash-error>.pl-ic{color:#dc2626}
.flash-warn>.pl-ic,.flash-info>.pl-ic{color:#d97706}

/* iconos añadidos por polish.js */
.pl-ic{display:inline-block;width:1.1em;height:1.1em;flex:none;vertical-align:-.2em}
.btn>.pl-ic{width:17px;height:17px;margin-right:0}
h1>.pl-ic,.card>h2>.pl-ic,.card>h3>.pl-ic{color:#16a34a;margin-right:8px}
.card>h2,.card>h3{display:flex;align-items:center}

/* jerarquía y espacios del panel */
.main .top h1{letter-spacing:-.01em}
.card>h2,.card>h3{letter-spacing:-.005em}
.empty,.card .empty{display:flex;flex-direction:column;align-items:center;gap:8px;padding:28px 16px;color:var(--muted,#64748b);text-align:center}
table td,table th{vertical-align:middle}
.tablewrap,.table-wrap,.card>table{max-width:100%}

/* responsive común */
img,video,svg{max-width:100%}
.content,.main,.ppage{min-width:0}
.card,.modal,.kpi{overflow-wrap:anywhere}
.card:has(>table),.card:has(>.tbl){overflow-x:auto;-webkit-overflow-scrolling:touch}
@media (min-width:1500px){.main .content{max-width:1560px;margin-inline:auto}}
@media (min-width:1100px) and (max-width:1366px){.main .content{padding-inline:22px}}
@media (min-width:700px) and (max-width:1024px){
  .grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .main .top{flex-wrap:wrap;gap:10px}
}
@media (max-width:700px){
  .btn,.pbtn,button.pk{min-height:44px}
  .btn-sm{min-height:38px}
  input:not([type=checkbox]):not([type=radio]),select,textarea{font-size:16px!important;min-height:44px}
  .main .top .gsearch{order:5;flex:1 1 100%}
  .flash,.pflash{font-size:.95rem}
  .overlay>.modal{animation-name:pl-sheet}
}
@media (hover:none){.kpi:hover,a.card:hover{transform:none;box-shadow:var(--shadow)}.side a.nav:hover{padding-left:inherit}}
@media print{*{animation:none!important}.pl-ic{display:none}}

/* Desplegables largos (menú Repuestos, etc.): scroll propio sin bajar toda la web */
@media (min-width:1001px){
  .mega-in{max-height:calc(100vh - 170px);max-height:calc(100dvh - 170px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#cbd5e1 transparent}
  .mega-in::-webkit-scrollbar{width:8px}.mega-in::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:8px}
  .mega-in .mega-all{position:sticky;bottom:-10px;background:#fff;margin-bottom:-10px;padding-bottom:12px}
}
@media (max-width:1000px){
  .mega-cats{max-height:60vh;max-height:60dvh;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
}
.ui-select-panel{max-height:min(60vh,420px)}
.ui-select-list{max-height:inherit}
