/* AMELIAPOS_POS_CATALOG_UX_R16_5R19_6_2
 * HOTFIX VISUAL SOBRE R16.5R19.6
 * ALCANCE: categorías + tarjetas/lista de productos + consulta informativa.
 * PROHIBIDO: ticket, columnas workspace, pagos, KDS, impresión, backend.
 */

@media (min-width:1200px){

  /* ============================================================
     CATEGORÍAS · refinamiento, sin cambiar ancho ni proporciones
     ============================================================ */
  main.workspace > aside.categories{
    padding:11px 9px 14px!important;
    background:#f4f6f8!important;
    border-right:1px solid #e1e7ec!important;
    box-shadow:none!important;
    scrollbar-width:thin;
    scrollbar-color:#b9c4cc transparent;
  }

  main.workspace > aside.categories::-webkit-scrollbar{width:5px}
  main.workspace > aside.categories::-webkit-scrollbar-thumb{
    background:#b9c4cc;
    border-radius:999px;
  }

  main.workspace > aside.categories .category{
    position:relative!important;
    display:grid!important;
    grid-template-columns:34px minmax(0,1fr) auto!important;
    align-items:center!important;
    gap:9px!important;
    width:100%!important;
    min-width:0!important;
    min-height:45px!important;
    margin:0 0 5px!important;
    padding:5px 8px!important;
    border:1px solid transparent!important;
    border-radius:9px!important;
    background:transparent!important;
    box-shadow:none!important;
    color:#172b3c!important;
    text-align:left!important;
    transition:background .13s ease,border-color .13s ease,box-shadow .13s ease,transform .08s ease!important;
  }

  main.workspace > aside.categories .category:hover{
    background:#fff!important;
    border-color:#dde5ea!important;
  }

  main.workspace > aside.categories .category:active{
    transform:translateY(1px)!important;
  }

  main.workspace > aside.categories .category > img,
  main.workspace > aside.categories .category > .category-special-icon{
    grid-column:1!important;
    display:grid!important;
    place-items:center!important;
    width:31px!important;
    height:31px!important;
    min-width:31px!important;
    min-height:31px!important;
    margin:0!important;
    padding:5px!important;
    object-fit:contain!important;
    border:1px solid #dce4e9!important;
    border-radius:8px!important;
    background:#fff!important;
    color:#e86c28!important;
    font-size:15px!important;
    font-weight:800!important;
    line-height:1!important;
  }

  main.workspace > aside.categories .category > .category-name{
    grid-column:2!important;
    min-width:0!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    color:inherit!important;
    font-size:12.5px!important;
    line-height:1.15!important;
    font-weight:750!important;
    letter-spacing:-.01em!important;
  }

  main.workspace > aside.categories .category > small{
    grid-column:3!important;
    justify-self:end!important;
    min-width:23px!important;
    max-width:64px!important;
    padding:3px 6px!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    border-radius:999px!important;
    background:#e9eef2!important;
    color:#667785!important;
    font-size:8.5px!important;
    line-height:1.05!important;
    font-weight:850!important;
    text-align:center!important;
  }

  main.workspace > aside.categories .category.category-special{
    min-height:43px!important;
  }

  main.workspace > aside.categories .category.category-special > small{
    background:transparent!important;
    color:#8a98a4!important;
    padding-left:2px!important;
    padding-right:2px!important;
  }

  main.workspace > aside.categories #bestSellersCategory{
    margin-bottom:11px!important;
  }

  main.workspace > aside.categories #bestSellersCategory::after{
    content:""!important;
    position:absolute!important;
    left:5px!important;
    right:5px!important;
    bottom:-6px!important;
    height:1px!important;
    background:#dfe6eb!important;
  }

  main.workspace > aside.categories .category.active{
    border-color:#10283b!important;
    background:#10283b!important;
    color:#fff!important;
    box-shadow:0 4px 10px rgba(16,40,59,.12)!important;
  }

  main.workspace > aside.categories .category.active::before{
    content:""!important;
    position:absolute!important;
    left:-1px!important;
    top:7px!important;
    bottom:7px!important;
    width:3px!important;
    border-radius:0 3px 3px 0!important;
    background:#f2752b!important;
  }

  main.workspace > aside.categories .category.active > img,
  main.workspace > aside.categories .category.active > .category-special-icon{
    border-color:#536a7b!important;
    background:#fff!important;
    color:#ef7229!important;
  }

  main.workspace > aside.categories .category.active > small{
    background:rgba(255,255,255,.12)!important;
    color:#fff!important;
  }

  /* ============================================================
     TOOLBAR CATALOGO · solo pulido
     ============================================================ */
  main.workspace > .catalog .catalog-toolbar{
    gap:8px!important;
    padding:9px 10px 8px!important;
    border-bottom:1px solid #e4e9ed!important;
    background:#fff!important;
  }

  main.workspace > .catalog .catalog-toolbar .search{
    min-height:40px!important;
    border:1px solid #ccd7df!important;
    border-radius:9px!important;
    background:#fff!important;
    box-shadow:0 1px 2px rgba(20,42,58,.025)!important;
  }

  main.workspace > .catalog .catalog-toolbar .search:focus-within{
    border-color:#8ba6b9!important;
    box-shadow:0 0 0 3px rgba(35,91,130,.07)!important;
  }

  main.workspace > .catalog .view-switch{
    padding:2px!important;
    border:1px solid #d6dfe5!important;
    border-radius:8px!important;
    background:#f7f9fa!important;
  }

  main.workspace > .catalog .view-switch button{
    width:35px!important;
    height:33px!important;
    border-radius:6px!important;
  }

  main.workspace > .catalog .view-switch button.active{
    background:#10283b!important;
    color:#fff!important;
    box-shadow:none!important;
  }

  /* ============================================================
     TARJETAS POS · sin botones permanentes Stock/Ficha
     ============================================================ */
  #products.products.cards{
    display:grid!important;
    grid-template-columns:repeat(auto-fill,minmax(245px,1fr))!important;
    align-content:start!important;
    gap:9px!important;
    padding:9px 10px 12px!important;
  }

  #products.products.cards .product-card{
    position:relative!important;
    display:grid!important;
    grid-template-columns:66px minmax(0,1fr)!important;
    grid-template-rows:minmax(62px,auto) 28px!important;
    column-gap:10px!important;
    row-gap:4px!important;
    min-width:0!important;
    min-height:116px!important;
    padding:10px!important;
    overflow:hidden!important;
    border:1px solid #d9e2e8!important;
    border-radius:10px!important;
    background:#fff!important;
    box-shadow:0 1px 2px rgba(20,42,58,.02)!important;
    text-align:left!important;
    transition:border-color .13s ease,box-shadow .13s ease,transform .08s ease!important;
  }

  #products.products.cards .product-card:hover{
    border-color:#b8c8d3!important;
    box-shadow:0 4px 12px rgba(19,43,60,.065)!important;
  }

  #products.products.cards .product-card:active{
    transform:translateY(1px)!important;
  }

  #products.products.cards .product-card:focus-visible{
    outline:2px solid #f2752b!important;
    outline-offset:1px!important;
  }

  #products.products.cards .product-media{
    grid-column:1!important;
    grid-row:1 / span 2!important;
    align-self:center!important;
    display:grid!important;
    place-items:center!important;
    width:66px!important;
    height:78px!important;
    min-width:66px!important;
    min-height:78px!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
    border:0!important;
    border-radius:8px!important;
    background:transparent!important;
    box-shadow:none!important;
  }

  #products.products.cards .product-media img{
    width:100%!important;
    height:100%!important;
    margin:0!important;
    padding:2px!important;
    object-fit:contain!important;
    border:0!important;
    border-radius:8px!important;
    background:transparent!important;
    box-shadow:none!important;
  }

  #products.products.cards .product-copy{
    grid-column:2!important;
    grid-row:1!important;
    min-width:0!important;
    display:block!important;
    padding:1px 30px 0 0!important;
  }

  #products.products.cards .product-copy .code{
    display:block!important;
    margin:0 0 4px!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    color:#718392!important;
    font-size:9px!important;
    line-height:1.1!important;
    font-weight:700!important;
  }

  #products.products.cards .product-copy strong{
    display:-webkit-box!important;
    -webkit-box-orient:vertical!important;
    -webkit-line-clamp:2!important;
    overflow:hidden!important;
    margin:0 0 5px!important;
    color:#102234!important;
    font-size:14px!important;
    line-height:1.13!important;
    font-weight:820!important;
    letter-spacing:-.012em!important;
  }

  #products.products.cards .product-copy .product-detail{
    display:block!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    color:#6d7f8d!important;
    font-size:9.5px!important;
    line-height:1.15!important;
    font-weight:650!important;
  }

  #products.products.cards .product-badge{
    grid-column:2!important;
    grid-row:2!important;
    justify-self:start!important;
    align-self:end!important;
    position:static!important;
    max-width:108px!important;
    margin:0!important;
    padding:3px 7px!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    border-radius:999px!important;
    font-size:8.3px!important;
    line-height:1.05!important;
    font-weight:850!important;
    letter-spacing:.005em!important;
  }

  #products.products.cards .product-card[data-stock-state="out"] .product-badge{
    background:#fff0ef!important;
    color:#bd352d!important;
  }

  #products.products.cards .product-card[data-stock-state="low"] .product-badge{
    background:#fff5e5!important;
    color:#b96900!important;
  }

  #products.products.cards .product-card[data-stock-state="ok"] .product-badge{
    background:#edf8ef!important;
    color:#28763a!important;
  }

  #products.products.cards .product-card[data-stock-state="recipe"] .product-badge{
    background:#edf8ef!important;
    color:#317342!important;
  }

  #products.products.cards .product-price{
    position:absolute!important;
    right:10px!important;
    bottom:10px!important;
    margin:0!important;
    max-width:105px!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    color:#ef6c24!important;
    font-size:15.5px!important;
    line-height:1!important;
    font-weight:880!important;
    letter-spacing:-.018em!important;
  }

  #products.products.cards .pos-card-menu-button{
    position:absolute!important;
    top:7px!important;
    right:7px!important;
    display:grid!important;
    place-items:center!important;
    width:27px!important;
    height:27px!important;
    padding:0!important;
    border:1px solid transparent!important;
    border-radius:7px!important;
    background:transparent!important;
    color:#63798a!important;
    font-size:18px!important;
    line-height:1!important;
    font-weight:800!important;
    cursor:pointer!important;
  }

  #products.products.cards .pos-card-menu-button:hover,
  #products.products.cards .pos-card-menu-button[aria-expanded="true"]{
    border-color:#d6e0e6!important;
    background:#f5f8fa!important;
    color:#17364c!important;
  }

  /* Anula cualquier acción permanente heredada de R19.6 */
  #products .pos-product-actions{
    display:none!important;
  }

  /* ============================================================
     VISTA LISTA · fila de software, solo menú contextual
     ============================================================ */
  #products.products.list{
    display:flex!important;
    flex-direction:column!important;
    gap:6px!important;
    padding:8px 10px 12px!important;
  }

  #products.products.list .product-card{
    position:relative!important;
    display:grid!important;
    grid-template-columns:52px minmax(0,1fr) 90px 88px 34px!important;
    align-items:center!important;
    gap:9px!important;
    min-height:66px!important;
    padding:6px 8px!important;
    border:1px solid #dce4e9!important;
    border-radius:9px!important;
    background:#fff!important;
    box-shadow:none!important;
    text-align:left!important;
  }

  #products.products.list .product-card:hover{
    border-color:#bccbd5!important;
    background:#fbfcfd!important;
  }

  #products.products.list .product-media{
    width:52px!important;
    height:52px!important;
    min-width:52px!important;
    min-height:52px!important;
    display:grid!important;
    place-items:center!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
    border:0!important;
    border-radius:7px!important;
    background:transparent!important;
  }

  #products.products.list .product-media img{
    width:100%!important;
    height:100%!important;
    padding:2px!important;
    object-fit:contain!important;
    border-radius:7px!important;
  }

  #products.products.list .product-copy{
    min-width:0!important;
  }

  #products.products.list .product-copy .code{
    display:block!important;
    margin-bottom:2px!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    color:#778896!important;
    font-size:8.8px!important;
    line-height:1.1!important;
  }

  #products.products.list .product-copy strong{
    display:block!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    color:#102234!important;
    font-size:13px!important;
    line-height:1.15!important;
    font-weight:820!important;
  }

  #products.products.list .product-copy .product-detail{
    display:block!important;
    margin-top:3px!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    color:#6f808e!important;
    font-size:9px!important;
    line-height:1.1!important;
    font-weight:650!important;
  }

  #products.products.list .product-badge{
    justify-self:start!important;
    position:static!important;
    max-width:90px!important;
    margin:0!important;
    padding:4px 7px!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
    border-radius:999px!important;
    font-size:8.3px!important;
    line-height:1!important;
    font-weight:850!important;
  }

  #products.products.list .product-card[data-stock-state="out"] .product-badge{
    background:#fff0ef!important;color:#bd352d!important;
  }

  #products.products.list .product-card[data-stock-state="low"] .product-badge{
    background:#fff5e5!important;color:#b96900!important;
  }

  #products.products.list .product-card[data-stock-state="ok"] .product-badge{
    background:#edf8ef!important;color:#28763a!important;
  }

  #products.products.list .product-card[data-stock-state="recipe"] .product-badge{
    background:#edf8ef!important;color:#317342!important;
  }

  #products.products.list .product-price{
    justify-self:end!important;
    position:static!important;
    margin:0!important;
    color:#ef6c24!important;
    font-size:15px!important;
    line-height:1!important;
    font-weight:870!important;
  }

  #products.products.list .pos-card-menu-button{
    grid-column:5!important;
    justify-self:end!important;
    display:grid!important;
    place-items:center!important;
    width:29px!important;
    height:29px!important;
    padding:0!important;
    border:1px solid #d9e2e8!important;
    border-radius:7px!important;
    background:#fff!important;
    color:#526b7c!important;
    font-size:17px!important;
    line-height:1!important;
    font-weight:800!important;
    cursor:pointer!important;
  }

  #products.products.list .pos-card-menu-button:hover,
  #products.products.list .pos-card-menu-button[aria-expanded="true"]{
    border-color:#b9c8d2!important;
    background:#f6f9fa!important;
    color:#17364c!important;
  }
}

/* ================================================================
   MENÚ CONTEXTUAL DE PRODUCTO
   ================================================================ */
.pos-card-menu{
  position:fixed;
  z-index:5450;
  width:210px;
  padding:5px;
  overflow:hidden;
  border:1px solid #d3dde4;
  border-radius:10px;
  background:#fff;
  box-shadow:0 13px 34px rgba(13,34,50,.18);
  color:#173045;
}

.pos-card-menu[hidden]{display:none!important}

.pos-card-menu button{
  display:grid;
  grid-template-columns:26px minmax(0,1fr);
  align-items:center;
  width:100%;
  min-height:36px;
  padding:5px 8px;
  border:0;
  border-radius:7px;
  background:transparent;
  color:#294559;
  text-align:left;
  font-size:10px;
  line-height:1.15;
  font-weight:750;
  cursor:pointer;
}

.pos-card-menu button:hover{
  background:#f2f6f8;
  color:#102b3e;
}

.pos-card-menu button > span:first-child{
  display:grid;
  place-items:center;
  width:24px;
  height:24px;
  color:#e76f2a;
  font-size:12px;
  font-weight:850;
}

.pos-card-menu hr{
  height:1px;
  margin:4px 5px;
  border:0;
  background:#e9eef1;
}

/* ================================================================
   DRAWER INFORMATIVO · no cambia columnas del POS
   ================================================================ */
.pos-product-drawer{
  position:fixed;
  z-index:5500;
  top:70px;
  right:12px;
  bottom:12px;
  width:min(430px,calc(100vw - 24px));
  display:grid;
  grid-template-rows:auto auto minmax(0,1fr);
  overflow:hidden;
  border:1px solid #cfdae2;
  border-radius:13px;
  background:#fff;
  box-shadow:0 20px 48px rgba(12,32,47,.22);
  color:#173045;
  transform:translateX(calc(100% + 32px));
  opacity:0;
  pointer-events:none;
  transition:transform .17s ease,opacity .17s ease;
}

.pos-product-drawer.open{
  transform:translateX(0);
  opacity:1;
  pointer-events:auto;
}

.pos-product-drawer-head{
  display:grid;
  grid-template-columns:66px minmax(0,1fr) 34px;
  gap:11px;
  align-items:center;
  padding:12px;
  border-bottom:1px solid #e3e9ed;
}

.pos-product-drawer-media{
  width:66px;
  height:66px;
  display:grid;
  place-items:center;
  overflow:hidden;
  border:0;
  border-radius:9px;
  background:transparent;
}

.pos-product-drawer-media img{
  width:100%;
  height:100%;
  padding:2px;
  object-fit:contain;
  border-radius:9px;
}

.pos-product-drawer-title{min-width:0}

.pos-product-drawer-title strong{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#102234;
  font-size:16px;
  line-height:1.15;
}

.pos-product-drawer-title small{
  display:block;
  margin-top:3px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#748594;
  font-size:9px;
  line-height:1.2;
}

.pos-product-drawer-close{
  width:34px;
  height:34px;
  padding:0;
  border:1px solid #d8e1e7;
  border-radius:8px;
  background:#fff;
  color:#435e70;
  font-size:18px;
  line-height:1;
  cursor:pointer;
}

.pos-product-tabs{
  display:flex;
  gap:1px;
  padding:0 8px;
  overflow:auto;
  border-bottom:1px solid #e5ebef;
}

.pos-product-tab{
  flex:0 0 auto;
  min-height:38px;
  padding:0 9px;
  border:0;
  border-bottom:2px solid transparent;
  background:transparent;
  color:#667a89;
  font-size:9.5px;
  font-weight:820;
  cursor:pointer;
}

.pos-product-tab.active{
  border-bottom-color:#ef7229;
  color:#173045;
}

.pos-product-drawer-body{
  min-height:0;
  overflow:auto;
  padding:12px;
}

.pos-product-panel{display:none}
.pos-product-panel.active{display:block}

.pos-info-kpis{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:7px;
  margin-bottom:10px;
}

.pos-info-kpi{
  min-width:0;
  padding:9px;
  border:1px solid #e0e7eb;
  border-radius:9px;
  background:#f8fafb;
}

.pos-info-kpi span{
  display:block;
  margin-bottom:4px;
  color:#778794;
  font-size:8px;
  font-weight:780;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.pos-info-kpi strong{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#173045;
  font-size:13px;
}

.pos-info-section{
  margin-bottom:9px;
  padding:10px;
  border:1px solid #e0e7eb;
  border-radius:9px;
  background:#fff;
}

.pos-info-section > strong{
  display:block;
  margin-bottom:7px;
  color:#183248;
  font-size:10px;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.pos-info-section p{
  margin:0;
  color:#5d7180;
  font-size:10px;
  line-height:1.5;
}

.pos-info-grid{
  display:grid;
  grid-template-columns:130px minmax(0,1fr);
  gap:0;
}

.pos-info-grid > span,
.pos-info-grid > b{
  min-width:0;
  padding:7px 0;
  border-bottom:1px solid #edf1f3;
  font-size:9.5px;
  line-height:1.25;
}

.pos-info-grid > span{color:#748594}

.pos-info-grid > b{
  overflow-wrap:anywhere;
  color:#213b4e;
  font-weight:760;
}

.pos-info-grid > :nth-last-child(-n+2){border-bottom:0}

.pos-stock-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  min-height:38px;
  border-bottom:1px solid #edf1f3;
}

.pos-stock-row:last-child{border-bottom:0}

.pos-stock-row span{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#445d70;
  font-size:10px;
  font-weight:720;
}

.pos-stock-row b{
  font-size:11px;
  color:#173045;
}

.pos-stock-row b.out{color:#bf382e}
.pos-stock-row b.low{color:#c27600}
.pos-stock-row b.ok{color:#28763a}

.pos-stock-note{
  display:block;
  margin-top:8px;
  padding:8px 9px;
  border:1px solid #e6ecef;
  border-radius:8px;
  background:#f8fafb;
  color:#768693;
  font-size:9px;
  line-height:1.4;
}

.pos-empty-note{
  padding:12px;
  border:1px dashed #d3dde4;
  border-radius:9px;
  background:#f8fafb;
  color:#738491;
  font-size:9.5px;
  line-height:1.4;
}

@media (max-width:1199px){
  .pos-product-drawer{
    top:10px;
    right:10px;
    bottom:10px;
    width:min(420px,calc(100vw - 20px));
  }
}

