/* CR Vista Cuadricula y Lista 1.8.0 - estilos del catalogo (antes inline en templates/shop-popup-content.php) */
  :root{--blue:var(--cr-marca, #15489e);--blue-d:var(--cr-marca-osc, #0e3578);--orange:#f39200;--ink:#1f2a37;--muted:#6b7280;--line:#e9edf3;--bg:#f4f6f9}
  .cr *{box-sizing:border-box}
  /* Blindaje anti-tema (Astra): fija la base para que el tema no la herede/cambie */
  .cr,.cr *{box-sizing:border-box !important}
  .cr{font-family:'Mulish',system-ui,sans-serif !important;color:var(--ink) !important;line-height:1.5 !important;font-size:15px !important;letter-spacing:normal !important;text-transform:none !important}
  .cr h1,.cr h2,.cr h3,.cr h4{font-family:'Poppins',sans-serif !important;letter-spacing:normal !important;text-transform:none !important}
  .cr button,.cr input,.cr select,.cr a{font-family:inherit !important;letter-spacing:normal !important}
  .cr a{box-shadow:none !important}
  .cr{font-family:'Mulish',system-ui,sans-serif;color:var(--ink)}
  .cr a{text-decoration:none;color:inherit}
  .cr ul{list-style:none;margin:0;padding:0}
  .cr h1,.cr h2,.cr h3{font-family:'Poppins',sans-serif;margin:0}
  .cr .wrap{max-width:none;margin:0 auto;padding-inline:clamp(16px,3vw,48px)}

  /* Breadcrumb + título */
  .cr .crumbs{font-size:12.5px;color:var(--muted);padding:18px 0 0}
  .cr .crumbs a:hover{color:var(--orange)}
  .cr .crumbs span{color:var(--ink);font-weight:600}
  .cr .pgtitle{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;flex-wrap:wrap;margin:10px 0 22px}
  .cr .pgtitle h1{font-size:clamp(1.7rem,1.2rem + 1.6vw,2.3rem);color:var(--blue-d)}
  .cr .pgtitle p{margin:6px 0 0;color:var(--muted);font-size:14px}

  /* Layout */
  .cr .shop{padding-bottom:60px}

  /* Sidebar: siempre flotante encima de la grilla, para que abrirla no la achique */
  .cr .side{display:none;position:fixed;inset:0;z-index:95;background:rgba(var(--cr-marca-osc-rgb, 14,53,120), .45);padding:0}
  .cr .side.open{display:block}
  .cr .side .inner{position:absolute;left:0;top:0;height:100%;width:min(310px,86%);background:#fff;overflow:auto;padding:18px;display:flex;flex-direction:column;gap:18px}
  .cr .sideclose{display:flex;align-items:center;justify-content:space-between;font-family:'Poppins',sans-serif;font-weight:700;color:var(--blue-d)}
  .cr .sideclose button{background:none;border:0;font-size:24px;cursor:pointer;color:var(--ink)}
  .cr .fbox{background:#fff;border:1px solid var(--line);border-radius:12px;padding:18px 18px 20px}
  .cr .fbox h3{font-family:'Poppins',sans-serif;font-size:14px;font-weight:700;color:var(--blue-d);margin:0 0 14px;text-transform:uppercase;letter-spacing:.03em}
  .cr .flist li{margin-bottom:3px}
  .cr .flist button{width:100%;display:flex;align-items:center;justify-content:space-between;gap:8px;background:none;border:0;cursor:pointer;font-family:inherit;font-size:13.5px;color:#48566b;padding:8px 10px;border-radius:8px;text-align:left}
  .cr .flist button:hover{background:#f4f6f9}
  .cr .flist button.on{background:var(--cr-marca-suave, #eaf0fb);color:var(--blue-d);font-weight:700}
  .cr .flist .ct{font-size:11.5px;color:#9aa6b6;font-weight:600}
  .cr .flist button.on .ct{color:var(--blue-d)}
  .cr .chk{display:flex;align-items:center;gap:10px;font-size:13.5px;color:#48566b;padding:7px 0;cursor:pointer}
  .cr .chk input{width:17px;height:17px;accent-color:var(--blue-d);cursor:pointer}
  .cr .prange{display:flex;align-items:center;gap:8px;margin-top:4px}
  .cr .prange input{width:100%;border:1.5px solid #e3e8f0;border-radius:8px;padding:9px 10px;font-family:inherit;font-size:13px}
  .cr .prange span{color:#9aa6b6}
  .cr .applybtn{margin-top:12px;width:100%;border:0;background:var(--blue-d);color:#fff;font-family:'Poppins',sans-serif;font-weight:700;font-size:12.5px;padding:11px;border-radius:8px;cursor:pointer}
  .cr .clearf{margin-top:8px;width:100%;border:1.5px solid #e3e8f0;background:#fff;color:#5a6678;font-weight:700;font-size:12.5px;padding:10px;border-radius:8px;cursor:pointer}

  /* Toolbar */
  .cr .toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;background:#fff;border:1px solid var(--line);border-radius:12px;padding:13px 16px;margin-bottom:18px;position:relative;z-index:5}
  .cr .toolbar .cnt{font-size:13.5px;color:var(--muted)}
  .cr .toolbar .cnt b{color:var(--ink)}
  .cr .sortwrap{display:flex;align-items:center;gap:9px}
  .cr .sortwrap label{font-size:12.5px;color:var(--muted)}
  .cr .modetoggle{display:inline-flex;border:1.5px solid #e3e8f0;border-radius:999px;overflow:hidden;background:#fff}
  .cr .modetoggle button{border:0;background:transparent;padding:7px 12px;cursor:pointer;font-size:14px;color:#5a6678;line-height:1;font-family:inherit}
  .cr .modetoggle button:hover{background:#f4f6f9}
  .cr .modetoggle button.on{background:var(--blue-d);color:#fff}
  .cr .pager{display:flex;justify-content:center;flex-wrap:wrap;gap:8px;margin-top:26px}
  .cr .pager button{min-width:40px;height:40px;border:1.5px solid #e3e8f0;background:#fff;color:#48566b;font-family:'Poppins',sans-serif;font-weight:700;font-size:13.5px;border-radius:9px;cursor:pointer;padding:0 12px}
  .cr .pager button:hover{border-color:var(--blue-d);color:var(--blue-d)}
  .cr .pager button.on{background:var(--blue-d);border-color:var(--blue-d);color:#fff}
  .cr .pager button:disabled{opacity:.45;cursor:default}
  .cr .sortwrap select{border:1.5px solid #e3e8f0;border-radius:8px;padding:9px 12px;font-family:inherit;font-size:13px;color:var(--ink);background:#fff;cursor:pointer}
  .cr .sidetoggle{display:none;align-items:center;gap:6px;border:1.5px solid #e3e8f0;background:#fff;color:var(--blue-d);font-weight:700;font-size:12.5px;padding:8px 13px;border-radius:8px;cursor:pointer;font-family:inherit}
  .cr .sidetoggle:hover{border-color:var(--blue-d)}
  @media(min-width:881px){.cr .sidetoggle{display:inline-flex}}
  .cr .backbtn{display:inline-flex;align-items:center;gap:8px;border:0;background:var(--blue-d);color:#fff;font-weight:700;font-size:13.5px;padding:10px 18px;border-radius:8px;cursor:pointer;font-family:'Poppins',sans-serif;margin-bottom:10px;box-shadow:0 2px 6px rgba(var(--cr-marca-osc-rgb, 14,53,120), .25)}
  .cr .backbtn:hover{background:var(--cr-marca-mas-osc, #0a285c)}
  .cr .backbtn svg{width:16px;height:16px}
  .cr .zoomctl{display:inline-flex;align-items:center;border:1.5px solid #e3e8f0;border-radius:8px;overflow:hidden}
  .cr .zoomctl button{border:0;background:#fff;color:var(--blue-d);font-weight:700;font-size:17px;width:34px;height:36px;cursor:pointer;font-family:inherit;line-height:1}
  .cr .zoomctl button:hover{background:#f4f6f9}
  .cr .zoomctl button:first-child{border-right:1px solid #e3e8f0}
  .cr .toolright{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
  .cr .viewtoggle{display:inline-flex;border:1.5px solid #e3e8f0;border-radius:999px;overflow:hidden;background:#fff}
  .cr .viewtoggle button{border:0;background:transparent;padding:7px 13px;cursor:pointer;font-size:14px;color:#5a6678;line-height:1;font-family:inherit}
  .cr .viewtoggle button:hover{background:#f4f6f9}
  .cr .viewtoggle button.on{background:var(--blue-d);color:#fff}
  .cr .pgrid.cr-view-compact{grid-template-columns:repeat(auto-fill,minmax(190px,1fr)) !important;gap:14px}
  .cr .pgrid.cr-view-grid{grid-template-columns:repeat(6,1fr) !important;gap:16px}
  /* Vista grande: 4 por fila con imágenes más grandes */
  .cr .pgrid.cr-view-big{grid-template-columns:repeat(4,1fr) !important;gap:20px}
  @media(max-width:1040px){.cr .pgrid.cr-view-big{grid-template-columns:repeat(3,1fr) !important}}
  @media(max-width:760px){.cr .pgrid.cr-view-big{grid-template-columns:repeat(2,1fr) !important}}
  @media(max-width:480px){.cr .pgrid.cr-view-big{grid-template-columns:1fr !important}}
  #grid.cr-view-big .pc .img{height:300px !important}
  .cr-view-big .pc .nm{font-size:15px;min-height:40px}
  @media(max-width:1280px){.cr .pgrid.cr-view-grid{grid-template-columns:repeat(5,1fr) !important}}
  @media(max-width:1040px){.cr .pgrid.cr-view-grid{grid-template-columns:repeat(4,1fr) !important}}
  @media(max-width:820px){.cr .pgrid.cr-view-grid{grid-template-columns:repeat(3,1fr) !important}}
  @media(max-width:560px){.cr .pgrid.cr-view-grid{grid-template-columns:repeat(2,1fr) !important}}
  .cr .pgrid.cr-view-list{grid-template-columns:1fr !important;gap:14px}
  .cr-view-compact .pc .img{height:150px}
  .cr-view-compact .pc .nm{font-size:13px;min-height:0;margin-bottom:6px}
  .cr-view-compact .pc .tier{padding:7px 11px;font-size:12px}

  .cr .pc .listcode{display:none}
  .cr .pc .listquote{display:none}
  #grid.cr-view-list .pc .listcode{display:block !important}
  #grid.cr-view-list .pc .listquote{display:inline-flex !important}

  /* ===== VISTA LISTA: fila horizontal ordenada =====
     Orden: foto(delgada) · ícono cotización · nombre+código · precios · cantidad+añadir */
  #grid.cr-view-list .pc{flex-direction:row !important;align-items:center !important;padding:12px 18px !important;gap:18px !important}

  /* 1) Foto más delgada */
  #grid.cr-view-list .pc .img{
    width:88px !important;min-width:88px !important;height:88px !important;min-height:0 !important;
    flex:0 0 88px !important;border:0 !important;border-radius:8px !important;background:#fff !important;order:1;
  }
  #grid.cr-view-list .pc .img img{padding:4px !important}
  #grid.cr-view-list .pc .img .code,
  #grid.cr-view-list .pc .img .cat,
  #grid.cr-view-list .pc .img .cotbtn{display:none !important}

  /* 2) Ícono de cotización (descargar) */
  #grid.cr-view-list .pc .listquote{
    order:2;flex:0 0 auto;width:38px;height:38px;align-items:center;justify-content:center;
    border:1px solid #e3e8f0;border-radius:8px;color:var(--cr-marca-osc, #0e3578);background:#fff;text-decoration:none;
  }
  #grid.cr-view-list .pc .listquote:hover{background:var(--cr-marca-suave, #eaf0fb);border-color:var(--cr-marca-osc, #0e3578)}

  /* 3) El body: nombre+código | precios | compra */
  #grid.cr-view-list .pc .body{
    order:3;flex:1 1 auto !important;min-width:0 !important;
    display:grid !important;
    grid-template-columns: 1.5fr 220px 280px !important;
    align-items:center !important;
    gap:22px !important;padding:0 !important;
  }
  /* 3a) Nombre + código juntos en la 1ª columna */
  #grid.cr-view-list .pc .nm{
    grid-column:1 !important;grid-row:1 !important;
    color:var(--blue-d) !important;font-weight:700 !important;font-size:15px !important;
    min-height:0 !important;line-height:1.3 !important;text-transform:uppercase;letter-spacing:.01em;margin:0 0 4px !important;
  }
  #grid.cr-view-list .pc .listcode{
    grid-column:1 !important;grid-row:2 !important;
    font-family:'Poppins',sans-serif;font-weight:700;font-size:13px;color:var(--ink);text-align:left;
  }
  #grid.cr-view-list .pc .listcode small{display:inline;margin-left:8px;color:#9aa6b6;font-weight:600;font-size:12px;text-transform:none}
  /* 3b) Cajas de precios en la 2ª columna */
  #grid.cr-view-list .pc .tiers{
    grid-column:2 !important;grid-row:1 / span 2 !important;margin:0 !important;gap:0 !important;
    border:1px solid #e3e8f0;border-radius:8px;overflow:hidden;
  }
  #grid.cr-view-list .pc .tier{border:0 !important;border-radius:0 !important;border-bottom:1px solid #eef1f6 !important;padding:6px 12px !important}
  #grid.cr-view-list .pc .tier:last-child{border-bottom:0 !important}
  #grid.cr-view-list .pc .tier.on{background:var(--cr-marca-suave, #eaf0fb) !important}
  /* 3c) Cantidad + Añadir en la 3ª columna */
  #grid.cr-view-list .pc .buy{
    grid-column:3 !important;grid-row:1 / span 2 !important;margin:0 !important;gap:8px !important;
    flex-direction:column !important;align-items:stretch !important;
  }
  #grid.cr-view-list .pc .buy .stepper{align-self:center}
  #grid.cr-view-list .pc .add{width:100% !important;border-radius:999px !important}
  #grid.cr-view-list .pc .swatches,
  #grid.cr-view-list .pc .varlabel{grid-column:3 !important}

  @media(max-width:900px){
    #grid.cr-view-list .pc .body{grid-template-columns:1fr !important;gap:12px !important}
    #grid.cr-view-list .pc .nm,#grid.cr-view-list .pc .listcode,#grid.cr-view-list .pc .tiers,#grid.cr-view-list .pc .buy{grid-column:1 !important;grid-row:auto !important}
  }
  @media(max-width:600px){
    #grid.cr-view-list .pc{flex-wrap:wrap !important}
    #grid.cr-view-list .pc .img{width:72px !important;min-width:72px !important;height:72px !important;flex:0 0 72px !important}
  }

  /* Grid + cards */
  .cr .pgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(196px,1fr));gap:16px}
  @media(max-width:620px){.cr .pgrid{grid-template-columns:repeat(2,1fr)}}
  @media(max-width:620px){.cr .pc .buy{flex-direction:column;align-items:stretch;gap:8px}.cr .pc .stepper{width:100%;justify-content:space-between}.cr .pc .stepper span{flex:1}.cr .pc .add{width:100%}}
  .cr .pc{background:#fff !important;border:1px solid var(--line) !important;border-radius:12px !important;overflow:hidden !important;display:flex !important;flex-direction:column !important;transition:.18s}
  .cr .pc:hover{box-shadow:0 14px 30px rgba(var(--cr-marca-osc-rgb, 14,53,120), .13);transform:translateY(-3px);border-color:#d4def0}
  .cr .pc .img{position:relative !important;display:block !important;height:188px !important;width:100% !important;background:#fff !important;flex:none !important}
  .cr .pc .img .em{position:absolute;inset:0;display:grid;place-items:center;font-size:58px;opacity:.5}
  .cr .pc .img img{position:absolute !important;inset:0 !important;width:100% !important;height:100% !important;max-width:100% !important;object-fit:contain !important;padding:10px !important;margin:0 !important}
  .cr .pc .img .code{position:absolute;left:10px;bottom:10px;background:#fff;border:1px solid #e3e8f0;color:#5a6678;font-family:'Poppins',sans-serif;font-size:10.5px;font-weight:600;padding:3px 8px;border-radius:6px}
  .cr .pc .img .cat{position:absolute;left:10px;top:10px;background:var(--orange);color:#fff;font-family:'Poppins',sans-serif;font-size:10px;font-weight:700;padding:3px 8px;border-radius:6px;text-transform:uppercase;letter-spacing:.03em}
  .cr .pc .body{padding:15px 16px 17px;display:flex;flex-direction:column;flex:1}
  .cr .pc .nm{color:var(--ink);font-weight:700;font-size:14px;line-height:1.3;min-height:37px}
  .cr .pc .tiers{display:flex;flex-direction:column;gap:7px;margin:6px 0 15px}
  .cr .tier{cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;text-align:left;font-size:13px;padding:10px 13px;border-radius:9px;border:1.5px solid #e3e8f0;background:#fff;color:#5a6678}
  .cr .tier b{font-weight:700;font-size:13.5px;font-family:'Poppins',sans-serif}
  .cr .tier .tp{font-family:'Poppins',sans-serif;font-weight:700;font-size:16px;color:var(--blue-d)}
  .cr .tier.on{border-color:var(--blue-d);background:var(--cr-marca-suave, #eaf0fb);color:var(--blue-d)}
  .cr .pc .buy{margin-top:auto;display:flex;flex-direction:column;gap:8px}
  .cr .pc .buy .stepper{align-self:center}
  .cr .pc .buy .stepper input{flex:none;width:84px}
  .cr .pc .buy .add{flex:none;width:100%}
  .cr .pc .img .cotbtn{position:absolute;left:96px;bottom:10px;width:30px;height:24px;display:inline-flex;align-items:center;justify-content:center;background:#fff;border:1px solid #e3e8f0;border-radius:6px;color:var(--cr-marca-osc, #0e3578);text-decoration:none;z-index:2}
  .cr .pc .img .cotbtn:hover{background:var(--cr-marca-suave, #eaf0fb);border-color:var(--cr-marca-osc, #0e3578)}
  .cr .stepper{display:inline-flex;align-items:center;border:1px solid #e3e8f0;border-radius:8px;overflow:hidden;flex:none}
  .cr .stepper button{width:30px;height:38px;border:0;background:var(--bg);cursor:pointer;font-size:16px;color:var(--blue-d)}
  .cr .stepper span{width:40px;text-align:center;font-size:14px;font-weight:700}
  .cr .stepper input{width:68px;text-align:center;font-size:14px;font-weight:700;border:0;border-left:1px solid #e3e8f0;border-right:1px solid #e3e8f0;background:#fff;font-family:inherit;height:38px;-moz-appearance:textfield;outline:none}
  .cr .stepper input::-webkit-outer-spin-button,.cr .stepper input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
  .cr .add{flex:1;height:38px;border:0;background:var(--blue-d);color:#fff;font-family:'Poppins',sans-serif;font-weight:700;font-size:12.5px;border-radius:8px;cursor:pointer}
  .cr .add:hover{background:var(--cr-marca-mas-osc, #0a285c)}
  .cr .add.disabled{background:#9aa6b6;cursor:not-allowed}
  .cr .add.disabled:hover{background:#9aa6b6}
  .cr .swatches{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin:0 0 8px}
  .cr .varlabel{text-align:center;font-size:12.5px;color:#5a6678;margin:0 0 12px}
  .cr .varlabel b{color:var(--cr-marca-osc, #0e3578)}
  .cr .sw{width:26px;height:26px;border-radius:50%;cursor:pointer;border:2px solid #fff;box-shadow:0 0 0 1.5px #e3e8f0;padding:0;transition:transform .12s,box-shadow .12s}
  .cr .sw:hover{transform:scale(1.12)}
  .cr .sw.on{box-shadow:0 0 0 2px var(--blue-d)}

  .cr .empty2{text-align:center;padding:70px 20px;color:#8a93a3;background:#fff;border:1px solid var(--line);border-radius:12px}
  .cr .empty2 .big{font-size:46px}

  /* Paginación */
  .cr .pager{display:flex;justify-content:center;gap:8px;margin-top:30px}
  .cr .pager button{min-width:40px;height:40px;border:1.5px solid #e3e8f0;background:#fff;color:#48566b;font-family:'Poppins',sans-serif;font-weight:700;font-size:13.5px;border-radius:9px;cursor:pointer;padding:0 12px}
  .cr .pager button:hover{border-color:var(--blue-d);color:var(--blue-d)}
  .cr .pager button.on{background:var(--blue-d);border-color:var(--blue-d);color:#fff}
  .cr .pager button:disabled{opacity:.45;cursor:default}

  /* Botón filtros móvil */
  .cr .mobfilter{display:none;align-items:center;gap:8px;border:1.5px solid var(--blue-d);background:#fff;color:var(--blue-d);font-weight:700;font-size:13px;padding:10px 14px;border-radius:9px;cursor:pointer;font-family:inherit;margin-bottom:14px}

  @media(max-width:880px){
    .cr .mobfilter{display:inline-flex}
  }

  /* Refuerzo contra temas que deforman las tarjetas */
  #grid.pgrid{display:grid;gap:16px}
  #grid .pc{background:#fff !important;border:1px solid #e9edf3 !important;border-radius:12px !important;overflow:hidden !important;display:flex !important;flex-direction:column !important;box-sizing:border-box}
  #grid .pc .img{position:relative !important;display:block !important;height:188px !important;width:100% !important;background:#fff !important;flex:0 0 auto !important}
  #grid .pc .img img{position:absolute !important;inset:0 !important;width:100% !important;height:100% !important;max-width:100% !important;max-height:100% !important;min-height:0 !important;object-fit:contain !important;padding:10px !important;margin:0 !important;display:block !important}
  #grid .pc .body{padding:15px 16px 17px !important;display:flex !important;flex-direction:column !important;flex:1 1 auto !important}
  #grid .pc .img a{display:block !important;width:100% !important;height:100% !important}
