:root{
  --bg:#0b1020;
  --border:rgba(255,255,255,.12);
  --gold:rgba(255,215,0,.22);
  --aqua:rgba(0,180,255,.16);
  --text:rgba(255,255,255,.92);
  --muted:rgba(255,255,255,.72);
  --shadow: 0 16px 50px rgba(0,0,0,.45);
}
*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial;
  background: radial-gradient(1200px 700px at 20% 0%, rgba(255,215,0,.10), transparent 55%),
              radial-gradient(1000px 600px at 80% 0%, rgba(0,180,255,.10), transparent 55%),
              var(--bg);
  color:var(--text);
}
a{color:inherit; text-decoration:none;}
button{font-family:inherit;}
.container{max-width:980px; margin:0 auto; padding:12px 12px 90px;}
.topbar{
  position:sticky; top:0; z-index:50;
  backdrop-filter: blur(10px);
  background: rgba(11,16,32,.82);
  border-bottom:1px solid rgba(255,255,255,.08);
  padding:10px 12px;
  display:flex; align-items:center; gap:10px;
}
.logo{
  width:42px; height:42px; border-radius:12px; overflow:hidden;
  background: rgba(255,255,255,.06);
  flex:0 0 auto;
  border:1px solid rgba(255,255,255,.10);
}
.brand{line-height:1.1; min-width:0;}
.brand .name{
  font-weight:980;
  font-size:15px;
  line-height:1.05;
  white-space:normal;
  overflow:visible;
}
.brand .name2{
  white-space:nowrap;
  font-size:14px;
}
.brand .sub{
  font-size:12px;
  opacity:.82;
  white-space:nowrap;
}
.actions{margin-left:auto; display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; align-items:center;}
.btn{
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: white;
  padding:8px 10px;
  border-radius:12px;
  font-weight:950;
  font-size:12px;
  cursor:pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn:active{transform:scale(.98);}
.btn.primary{background: var(--gold); border-color:rgba(255,255,255,.18);}
.btn.aqua{background: var(--aqua); border-color:rgba(255,255,255,.18);}
.iconbtn{
  width:36px; height:36px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  display:grid; place-items:center;
  cursor:pointer;
}
.iconbtn svg{width:18px; height:18px; opacity:.92;}
.hero{
  margin-top:12px;
  border-radius:18px;
  border:1px solid var(--border);
  background: linear-gradient(135deg, rgba(255,215,0,.14), rgba(0,180,255,.10));
  box-shadow: var(--shadow);
  padding:12px;
  display:flex; align-items:center; gap:10px;
}
.hero h1{margin:0; font-size:16px; line-height:1.15; font-weight:980;}
.hero p{margin:6px 0 0; font-size:12px; color:var(--muted);}
.hero .right{margin-left:auto; display:flex; gap:8px; align-items:center;}
.pills{
  margin-top:10px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.pillbtn{
  --pill: rgba(255,255,255,.10);
  padding:9px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  font-weight:980; font-size:12px;
  cursor:pointer;
  transition: background .15s ease, transform .15s ease, border-color .15s ease;
  color: rgba(255,255,255,.92);
}
.pillbtn:active{transform:scale(.98);}
.pillbtn.active{
  background: var(--pill);
  border-color: rgba(255,255,255,.22);
}

.pillbtn[data-cat="ofertas"]{
  color:#ff3b30;
}

.pillbtn[data-cat="ofertas"].active{
  color:#ff3b30;
}
.subpills{
  margin-top:10px;
  display:none;
  gap:10px;
  flex-wrap:wrap;
}
.subpills.show{display:flex;}
.grid{
  transition: opacity .22s ease;

  margin-top:12px;
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:12px;
}
@media (min-width:860px){ .grid{
  transition: opacity .22s ease;
grid-template-columns:repeat(3, minmax(0,1fr));} }
.card{
  border-radius:18px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  overflow:hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
  display:flex; flex-direction:column;
  min-height:260px;
}
.thumb{height:160px; background: rgba(0,0,0,.25); position:relative;}
.thumb img{width:100%; height:100%; object-fit:cover; display:block;}
.badgePill{
  position:absolute;
  padding:7px 11px;
  border-radius:999px;
  background: linear-gradient(135deg, rgba(255,255,255,.94), rgba(235,242,255,.88));
  border:1px solid rgba(255,255,255,.45);
  font-size:12px;
  font-weight:980;
  color:#081018;
  text-shadow:none;
  box-shadow: 0 10px 24px rgba(0,0,0,.28);
}
.badgePill.right{right:10px; top:10px;}
.badgePill.left{left:10px; top:10px;}
.stockGlass{
  display:flex;
  align-items:center;
  gap:6px;
  padding:7px 10px;
  border-radius:14px;
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(240,247,255,.90));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border:1px solid rgba(255,255,255,.48);
  box-shadow: 0 10px 24px rgba(0,0,0,.28);
}
.stockGlass.ok{
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(220,255,236,.92));
}
.stockGlass.no{
  background: linear-gradient(135deg, rgba(255,245,245,.97), rgba(255,222,222,.92));
}
.stockGlass .stockLabel{
  font-size:11px;
  font-weight:900;
  opacity:1;
  text-transform:uppercase;
  letter-spacing:.3px;
  color:#081018;
}
.stockGlass .stockValue{
  font-size:13px;
  font-weight:980;
  color:#081018;
}
.stockGlass .stockState{
  font-size:10px;
  font-weight:900;
  opacity:1;
  margin-left:2px;
  color:#7a1010;
}
.card .body{padding:12px; display:flex; flex-direction:column; gap:8px; flex:1;}
.title{font-weight:980; font-size:14px; line-height:1.2;}
.meta{font-size:12px; color:var(--muted); line-height:1.25;}
.card .body .add{margin-top:auto;}
.fab{
  position:fixed; right:14px; bottom:64px; z-index:60;
  border-radius:18px;
  padding:12px 14px;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(15,22,44,.92);
  color:white;
  font-weight:980;
  cursor:pointer;
  box-shadow: var(--shadow);
  display:flex; align-items:center; gap:10px;
}
.badge{
  margin-left:6px;
  padding:4px 10px;
  border-radius:999px;
  background: var(--gold);
  border:1px solid rgba(255,255,255,.14);
  font-size:12px;
}
.modal{
  position:fixed; inset:0; z-index:90;
  background: rgba(0,0,0,.60);
  display:none;
  align-items:center; justify-content:center;
  padding:14px;
}
.modal.open{display:flex;}
.sheet{
  width:min(680px, 100%);
  border-radius:18px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(15,22,44,.96);
  padding:14px;
  box-shadow: var(--shadow);
  max-height: 86vh;
  overflow:auto;
}
.sheet h2{margin:0; font-size:16px; font-weight:980;}
.sheet .row{display:flex; align-items:center; gap:10px;}
.close{margin-left:auto; border:none; background:transparent; color:white; font-size:18px; cursor:pointer;}
.small{font-size:12px; color:var(--muted);}
.form{margin-top:12px; display:grid; gap:10px;}
.input{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.14);
  /* Más contraste para que se lea y se edite cómodo */
  background: rgba(255,255,255,.14);
  color:white;
  outline:none;
  font-size:13px;
}

/* File input (Comprobante de pago) */
.filewrap{ display:block; }
.filebtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.07);
  color:#fff;
  font-weight:950;
  cursor:pointer;
  user-select:none;
}
.filebtn:active{ transform: translateY(1px); }
.two{display:grid; grid-template-columns:1fr 1fr; gap:10px;}
.cartlist{margin-top:10px; display:grid; gap:10px;}
.item{
  display:flex; gap:10px; align-items:center;
  padding:10px; border-radius:16px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
}
.item img{width:56px; height:56px; border-radius:14px; object-fit:cover;}
.qtybtn{width:32px; height:32px; border-radius:10px; border:1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06); color:white; font-weight:980; cursor:pointer;}
.trash{border:none; background:transparent; color:rgba(255,255,255,.75); cursor:pointer;}
.panel{
  margin-top:12px;
  padding:12px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.12);
  /* Menos "cristal" / más sólido */
  background: rgba(15,22,44,.88);
}
.hr{height:1px; background: rgba(255,255,255,.10); margin:10px 0;}
.toast{
  position:fixed; left:12px; right:12px; bottom:86px; z-index:75;
  padding:12px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(15,22,44,.96);
  box-shadow: var(--shadow);
  display:none;
}
.toast.show{display:block; animation: fadein .25s ease;}
.toast .row{display:flex; gap:10px; align-items:center;}
.toast .hint{font-size:12px; color:var(--muted); margin-top:6px; line-height:1.35;}


.footerbar{
  margin-top:14px;
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  padding:10px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(15,22,44,.70);
  box-shadow: 0 10px 30px rgba(0,0,0,.22);
}
.socialbtn{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 8px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color:white;
  font-weight:950;
  font-size:12px;
  cursor:pointer;
}
.socialbtn:active{transform:scale(.99);}
.sicon{display:grid; place-items:center;}
.sicon svg{width:18px; height:18px; opacity:.92;}

/* Ajuste mobile: dar espacio al nombre para que "Express EC" NO se parta */
@media (max-width: 430px){
  .topbar{
    flex-wrap:wrap;
    row-gap:10px;
    align-items:flex-start;
  }
  .brand{
    flex:1 1 auto;
    min-width: 220px;
  }
  .actions{
    margin-left:0;
    width:100%;
    justify-content:flex-end;
  }
  .brand .name2{
    white-space:nowrap;
  }
}

/* Bancos (acordeón) */
.bankList{display:flex;flex-direction:column;gap:10px}
.bankItem{border:1px solid rgba(255,255,255,.10);border-radius:16px;background:rgba(0,0,0,.16);overflow:hidden}
.bankHead{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;cursor:pointer}
.bankLeft{display:flex;align-items:center;gap:10px}
.bankLogo{width:34px;height:34px;border-radius:12px;display:grid;place-items:center;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.12)}
.bankName{font-weight:950}
.bankChevron{opacity:.8}
.bankBody{display:none;padding:10px 12px 12px;border-top:1px solid rgba(255,255,255,.08)}
.bankBody small{opacity:.9}
.bankBody .row{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}
.pill{padding:6px 10px;border-radius:999px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.10);font-size:12px}


/* Admin (Pedidos) - evita overflow/zoom raro en móvil */
@media (max-width: 520px){
  #panelPedidos .item{
    flex-wrap:wrap;
    gap:12px;
  }
  #panelPedidos .item > div{
    min-width:0;
  }
  #panelPedidos .item > div:last-child{
    width:100%;
    min-width:0 !important;
  }
}


.offerCheck{padding:10px 12px;border-radius:12px;border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.06);font-size:13px;font-weight:900;color:rgba(255,255,255,.92);}
.offerCheck input{accent-color:#f6b300;}


.fab-left{
  right:14px;
  bottom:126px;
}

.contactActions{
  display:grid;
  gap:10px;
  margin-top:14px;
}

.contactSheet .btn{
  justify-content:center;
}


/* ===== Vista de producto (pantalla completa) ===== */
.sheetFull{
  width: min(720px, 100%);
  max-height: 92vh;
}
.pmImageWrap{
  margin-top: 12px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.22);
}
#pmImageView{
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  max-height: 56vh;
}
.pmMeta{
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255,255,255,.78);
  line-height: 1.35;
}
.pmActions{
  margin-top: 12px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
@media (max-width: 520px){
  .sheetFull{
    width: 100%;
    max-height: 94vh;
  }
  #pmImageView{
    max-height: 60vh;
  }
}
