
  :root{
    --bg: #०;
    --bg0: #0a0a0b;
    --bg1: #131314;
    --bg2: #1b1b1d;
    --bg3: #232326;
    --line: #2c2c30;
    --red: #d81f1f;
    --red-dim: #7a1414;
    --red-glow: rgba(216,31,31,.38);
    --silver: #c9c9cd;
    --silver-lt: #eee;
    --text: #ececec;
    --text-mut: #8d8d94;
    --ok: #3ecf7a;
    --radius: 10px;
    --shadow: 0 10px 30px rgba(0,0,0,.55);
  }
  *{box-sizing:border-box;}
  html,body{margin:0;padding:0;}
  body{
    background: radial-gradient(1200px 700px at 50% -10%, #141415 0%, var(--bg0) 55%) fixed, var(--bg0);
    color: var(--text);
    font-family:'Inter', sans-serif;
    min-height:100vh;
    -webkit-font-smoothing:antialiased;
  }
  h1,h2,h3, .display{ font-family:'Oswald', sans-serif; letter-spacing:.02em; }
  .mono-cta{ font-family:'Rajdhani', sans-serif; font-weight:700; letter-spacing:.08em; text-transform:uppercase; }
  a{color:inherit;}
  ::selection{ background: var(--red-dim); color:#fff; }
  ::-webkit-scrollbar{width:10px; height:10px;}
  ::-webkit-scrollbar-track{background:var(--bg1);}
  ::-webkit-scrollbar-thumb{background:var(--bg3); border-radius:8px;}
  ::-webkit-scrollbar-thumb:hover{background:var(--red-dim);}

  /* ===== Speed stripe signature ===== */
  .stripe{
    height:4px; width:100%;
    background: linear-gradient(90deg, transparent 0%, var(--red) 18%, var(--red) 45%, var(--silver) 46%, var(--silver) 50%, transparent 78%);
    opacity:.9;
  }

  /* ===== Header ===== */
  header{
    position:sticky; top:0; z-index:40;
    background: #000000;
    border-bottom:1px solid var(--line);
  }
  .header-inner{
    max-width:1400px; margin:0 auto; padding:10px 20px;
    display:flex; align-items:center; gap:20px; flex-wrap:wrap;
  }
  .logo-box{ display:flex; align-items:center; gap:10px; flex-shrink:0; background:#000; }
  .logo-box img{ height:88px; width:auto; display:block; }
  .brand-tag{
    display:none;
  }
  .search-wrap{
    flex:1 1 340px; min-width:220px; position:relative;
  }
  .search-wrap input{
    width:100%; padding:12px 44px 12px 16px;
    background: var(--bg2); border:1px solid var(--line);
    border-radius: 999px; color:var(--text); font-size:16px;
    outline:none; transition: border-color .15s, box-shadow .15s;
  }
  .search-wrap input:focus{ border-color: var(--red); box-shadow: 0 0 0 3px var(--red-glow); }
  .search-wrap svg{ position:absolute; right:16px; top:50%; transform:translateY(-50%); width:18px; height:18px; stroke:var(--text-mut); pointer-events:none; }
  .search-hint{ font-size:12.5px; color:var(--text-mut); margin-top:5px; padding-left:6px; }

  .settings-btn{
    position:relative; display:flex; align-items:center; gap:6px;
    background: var(--bg2); color: var(--silver); border:1px solid var(--line);
    width:44px; height:44px; border-radius:50%; cursor:pointer; flex-shrink:0;
    justify-content:center; transition: all .15s ease;
  }
  .settings-btn:hover{ border-color: var(--red-dim); color:#fff; transform: rotate(35deg); }
  .settings-tag{
    position:absolute; bottom:-6px; right:-6px; background:var(--red); color:#fff;
    font-size:10px; font-weight:700; border-radius:999px; padding:1px 6px; border:2px solid #000;
  }
  .settings-modal .modal{ max-width:420px; }
  .settings-body{ padding:22px; }
  .settings-body p{ color:var(--text-mut); font-size:14px; margin:0 0 18px; line-height:1.5; }
  .settings-field{ display:flex; align-items:center; justify-content:space-between; gap:14px; background:var(--bg1); border:1px solid var(--line); border-radius:10px; padding:14px 16px; margin-bottom:16px; }
  .settings-field label{ font-size:14.5px; color:var(--text); }
  .settings-field .disc-input-wrap{ display:flex; align-items:center; gap:8px; }
  .settings-field input{ width:70px; background:var(--bg3); border:1px solid var(--line); border-radius:7px; color:#fff; padding:9px 10px; text-align:right; font-size:16.5px; font-weight:600; }
  .settings-quick{ display:flex; gap:8px; margin-bottom:18px; flex-wrap:wrap; }
  .settings-apply{
    width:100%; padding:13px; border:none; border-radius:10px; cursor:pointer;
    background: linear-gradient(180deg,#e42323,#b81414); color:#fff; font-weight:700; font-size:14.5px;
  }
  .settings-apply:hover{ filter:brightness(1.08); }

  .cart-btn{
    position:relative; display:flex; align-items:center; gap:10px;
    background: linear-gradient(180deg, #e42323, #b81414);
    color:#fff; border:none; padding:12px 20px; border-radius:999px;
    cursor:pointer; font-size:14px; box-shadow: var(--shadow);
    transition: transform .12s ease, filter .12s ease;
    flex-shrink:0;
  }
  .cart-btn:hover{ filter:brightness(1.08); transform:translateY(-1px); }
  .cart-btn .badge{
    position:absolute; top:-7px; right:-7px;
    background:var(--silver-lt); color:#111; font-weight:800;
    min-width:22px; height:22px; border-radius:50%;
    display:flex; align-items:center; justify-content:center; font-size:12px;
    border:2px solid var(--bg0);
  }

  /* ===== Filter bar ===== */
  .filterbar{
    max-width:1400px; margin:0 auto; padding:14px 20px 6px;
    display:flex; flex-direction:column; gap:12px;
  }
  .filter-row{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
  .filter-label{ font-size:12px; text-transform:uppercase; letter-spacing:.12em; color:var(--text-mut); margin-right:4px; white-space:nowrap; }
  .chip{
    padding:7px 15px; border-radius:999px; border:1px solid var(--line);
    background: var(--bg2); color:var(--text-mut); font-size:14.5px; cursor:pointer;
    transition: all .15s ease; white-space:nowrap;
  }
  .chip:hover{ border-color:#4a4a50; color:var(--text); }
  .chip.active{
    background: linear-gradient(180deg, var(--red), #a81616);
    border-color: var(--red); color:#fff; font-weight:600;
    box-shadow: 0 4px 14px var(--red-glow);
  }
  .chip.silver.active{
    background: linear-gradient(180deg, var(--silver-lt), var(--silver));
    color:#111; border-color: var(--silver); box-shadow:none;
  }
  .results-count{ color:var(--text-mut); font-size:13.5px; margin-left:auto; padding-right:4px; }

  /* ===== Grid ===== */
  main{ max-width:1400px; margin:0 auto; padding:18px 20px 100px; }
  .grid{
    display:grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap:16px;
  }
  .card{
    background: linear-gradient(180deg, var(--bg2), var(--bg1));
    border:1px solid var(--line); border-radius: var(--radius);
    overflow:hidden; cursor:pointer; position:relative;
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
    display:flex; flex-direction:column;
  }
  .card:hover{ border-color: var(--red-dim); transform:translateY(-3px); box-shadow: 0 14px 30px rgba(0,0,0,.5); }
  .card-media{
    aspect-ratio: 4/3; background:
      repeating-linear-gradient(135deg, #101011 0 10px, #141415 10px 20px);
    display:flex; align-items:center; justify-content:center; position:relative;
    border-bottom:1px solid var(--line);
  }
  .card-media img{ width:100%; height:100%; object-fit:contain; }
  .card-media.has-image{ background:#ffffff; }
  .placeholder-code{
    font-family:'Rajdhani', sans-serif; font-weight:700; font-size:15px;
    color: var(--text-mut); letter-spacing:.06em; text-align:center; padding:10px;
    display:flex; flex-direction:column; align-items:center; gap:8px;
  }
  .placeholder-code svg{ width:34px; height:34px; stroke:var(--red-dim); opacity:.8;}
  .marca-badge{
    position:absolute; top:8px; left:8px;
    background:rgba(0,0,0,.65); border:1px solid var(--line);
    color:var(--silver); font-size:11px; letter-spacing:.08em;
    padding:3px 9px; border-radius:999px; text-transform:uppercase;
  }
  .cat-badge{
    position:absolute; top:8px; right:8px;
    font-size:11px; letter-spacing:.06em; padding:3px 9px; border-radius:999px;
    text-transform:uppercase; font-weight:600;
  }
  .cat-badge.Rotula{ background:rgba(216,31,31,.18); color:#ff6b6b; border:1px solid rgba(216,31,31,.4); }
  .cat-badge.Extremo{ background:rgba(201,201,205,.14); color:var(--silver); border:1px solid rgba(201,201,205,.3); }
  .card-body{ padding:12px 14px 14px; display:flex; flex-direction:column; gap:6px; flex:1; }
  .card-codigo{ font-family:'Rajdhani',sans-serif; font-weight:700; font-size:19.5px; color:#fff; letter-spacing:.03em; }
  .card-desc{ font-size:14px; color:var(--text); line-height:1.45; min-height:20px; }
  .card-meta{ display:flex; gap:10px; font-size:12.5px; color:var(--text-mut); flex-wrap:wrap; min-height:15px; }
  .card-meta span b{ color:var(--silver); font-weight:600; }
  .card-eq-hint{ font-size:12px; color:var(--text-mut); display:flex; align-items:center; gap:5px; margin-top:2px; min-height:14px;}
  .card-eq-hint.invisible{ visibility:hidden; }
  .card-eq-hint svg{width:12px;height:12px; stroke:var(--text-mut);}
  .card-footer{
    margin-top:auto; padding-top:10px; border-top:1px dashed var(--line);
    display:flex; align-items:center; justify-content:space-between; gap:8px;
  }
  .price-block{ display:flex; flex-direction:column; }
  .price-list{ font-size:12px; color:var(--text-mut); text-decoration:line-through; }
  .price-final{ font-size:19px; font-weight:700; color:#fff; font-family:'Rajdhani',sans-serif; }
  .qty-add{ display:flex; align-items:center; gap:6px; }
  .qty-stepper{ display:flex; align-items:center; border:1px solid var(--line); border-radius:8px; overflow:hidden; }
  .qty-stepper button{
    background:var(--bg3); border:none; color:var(--text); width:26px; height:28px; cursor:pointer; font-size:15.5px;
  }
  .qty-stepper button:hover{ background: var(--red-dim); color:#fff; }
  .qty-stepper input{
    width:32px; text-align:center; background:var(--bg1); border:none; color:var(--text); font-size:14.5px; height:28px;
  }
  .add-btn{
    background: linear-gradient(180deg,#e42323,#b81414); border:none; color:#fff;
    width:32px; height:32px; border-radius:8px; cursor:pointer; display:flex; align-items:center; justify-content:center;
    transition: transform .12s;
  }
  .add-btn:hover{ transform: scale(1.08); }
  .add-btn svg{ width:16px; height:16px; stroke:#fff; fill:none; stroke-width:2.4;}
  .empty-state{ text-align:center; padding:60px 20px; color:var(--text-mut); }
  .empty-state svg{ width:52px; height:52px; stroke:var(--red-dim); margin-bottom:14px; }

  /* ===== Modal (equivalencias) ===== */
  .overlay{
    position:fixed; inset:0; background:rgba(0,0,0,.72); backdrop-filter: blur(3px);
    display:none; align-items:center; justify-content:center; z-index:100; padding:20px;
  }
  .overlay.open{ display:flex; }
  .modal{
    background: linear-gradient(180deg, var(--bg2), var(--bg1)); border:1px solid var(--line);
    border-radius: 14px; max-width:640px; width:100%; max-height:85vh; overflow:hidden;
    box-shadow: var(--shadow); display:flex; flex-direction:column;
  }
  .modal-head{
    padding:18px 22px; border-bottom:1px solid var(--line); display:flex; justify-content:space-between; align-items:flex-start; gap:12px;
    background: linear-gradient(90deg, rgba(216,31,31,.12), transparent 60%);
  }
  .modal-head h3{ margin:0 0 4px; font-size:22px; color:#fff; }
  .modal-head p{ margin:0; font-size:13.5px; color:var(--text-mut); }
  .modal-close{ background:none; border:none; cursor:pointer; color:var(--text-mut); font-size:20px; line-height:1; }
  .modal-close:hover{ color:var(--red); }
  .modal-body{ padding:18px 22px; overflow-y:auto; }
  .modal-body .own-code{
    display:inline-flex; align-items:center; gap:8px; background:var(--bg3); border:1px solid var(--line);
    padding:8px 14px; border-radius:8px; margin-bottom:16px; font-family:'Rajdhani',sans-serif; font-weight:700;
  }
  .modal-body .own-code .dot{ width:8px; height:8px; border-radius:50%; background:var(--red); }
  .eq-grid{ display:grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap:10px; }
  .eq-item{ background:var(--bg1); border:1px solid var(--line); border-radius:8px; padding:9px 12px; }
  .eq-item .eq-brand{ font-size:11px; text-transform:uppercase; letter-spacing:.08em; color:var(--red); font-weight:700; margin-bottom:3px; }
  .eq-item .eq-codes{ font-size:14.5px; color:var(--silver); line-height:1.4; word-break:break-word; }
  .no-eq{ color:var(--text-mut); font-size:14px; padding:10px 0; }

  /* ===== Cart drawer ===== */
  .cart-overlay{
    position:fixed; inset:0; background:rgba(0,0,0,.6); display:none; z-index:90;
  }
  .cart-overlay.open{ display:block; }
  .cart-drawer{
    position:fixed; top:0; right:-420px; width:min(420px,100vw); height:100vh; z-index:95;
    background: var(--bg1); border-left:1px solid var(--line); box-shadow: -20px 0 40px rgba(0,0,0,.5);
    display:flex; flex-direction:column; transition: right .25s ease;
  }
  .cart-drawer.open{ right:0; }
  .cart-head{ padding:18px 20px; border-bottom:1px solid var(--line); display:flex; justify-content:space-between; align-items:center; }
  .cart-head h3{ margin:0; font-size:21px; }
  .cart-items{ flex:1; overflow-y:auto; padding:12px 16px; display:flex; flex-direction:column; gap:10px; }
  .cart-item{ background:var(--bg2); border:1px solid var(--line); border-radius:10px; padding:10px 12px; display:flex; gap:10px; align-items:center; }
  .cart-item .ci-info{ flex:1; min-width:0; }
  .cart-item .ci-code{ font-family:'Rajdhani',sans-serif; font-weight:700; font-size:16px; }
  .cart-item .ci-desc{ font-size:12.5px; color:var(--text-mut); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .cart-item .ci-price{ font-size:13px; color:var(--silver); margin-top:2px; }
  .cart-item .ci-remove{ background:none; border:none; color:var(--text-mut); cursor:pointer; font-size:16px; padding:4px; }
  .cart-item .ci-remove:hover{ color:var(--red); }
  .cart-empty{ text-align:center; color:var(--text-mut); padding:50px 20px; font-size:15px; }
  .cart-empty svg{ width:44px;height:44px; stroke:var(--red-dim); margin-bottom:12px;}

  .cart-footer{ border-top:1px solid var(--line); padding:16px 20px 20px; background:var(--bg2); }
  .discount-row{
    display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px;
    background:var(--bg1); border:1px solid var(--line); border-radius:9px; padding:9px 12px;
  }
  .discount-row label{ font-size:14px; color:var(--text-mut); }
  .discount-row .disc-input-wrap{ display:flex; align-items:center; gap:6px; }
  .discount-row input{
    width:56px; background:var(--bg3); border:1px solid var(--line); border-radius:6px; color:var(--text);
    padding:6px 8px; text-align:right; font-size:15px;
  }
  .totals{ display:flex; flex-direction:column; gap:6px; margin-bottom:14px; font-size:15px; }
  .totals .trow{ display:flex; justify-content:space-between; color:var(--text-mut); }
  .totals .trow.final{ color:#fff; font-size:22px; font-weight:700; font-family:'Rajdhani',sans-serif; padding-top:8px; border-top:1px dashed var(--line); }
  .totals .trow.final span:last-child{ color:#fff; }
  .totals .trow .desc-amt{ color:var(--red); }
  .whatsapp-btn{
    width:100%; padding:14px; border:none; border-radius:10px; cursor:pointer;
    background: linear-gradient(180deg,#2fd66a,#1fa652); color:#fff; font-weight:700; font-size:15px;
    display:flex; align-items:center; justify-content:center; gap:10px;
    box-shadow: 0 10px 24px rgba(31,166,82,.3);
    transition: transform .12s, filter .12s;
  }
  .whatsapp-btn:hover{ transform:translateY(-1px); filter:brightness(1.05); }
  .whatsapp-btn:disabled{ opacity:.4; cursor:not-allowed; transform:none; }
  .whatsapp-btn svg{ width:20px; height:20px; fill:#fff; }
  .clear-cart{ width:100%; text-align:center; background:none; border:none; color:var(--text-mut); font-size:12.5px; margin-top:10px; cursor:pointer; }
  .clear-cart:hover{ color:var(--red); }

  .close-x{ background:none;border:none;color:var(--text-mut);font-size:22px;cursor:pointer;}
  .close-x:hover{ color:var(--red); }

  footer{ text-align:center; padding:26px 20px 40px; color:var(--text-mut); font-size:13px; border-top:1px solid var(--line); display:flex; flex-direction:column; align-items:center; gap:12px; }
  footer b{ color:var(--silver); }
  .powered-by{ display:flex; align-items:center; gap:10px; font-size:12px; text-transform:uppercase; letter-spacing:.1em; color:var(--text-mut); }
  .powered-by-chip{ background:#ffffff; border-radius:8px; padding:6px 14px; display:flex; align-items:center; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
  .powered-by-chip img{ height:22px; width:auto; display:block; }

  @media (max-width:640px){
    .header-inner{ gap:10px; }
    .search-wrap{ order:3; flex-basis:100%; }
    .cart-drawer{ width:100vw; right:-100vw; }
  }

/* ================= Login (cliente y admin) ================= */
.login-body{
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  background: radial-gradient(1200px 700px at 50% -10%, #141415 0%, var(--bg0) 55%) fixed, var(--bg0);
  font-family:'Inter', sans-serif; padding:20px;
}
.login-card{
  background: linear-gradient(180deg, var(--bg2), var(--bg1));
  border:1px solid var(--line); border-radius:16px; padding:36px 32px;
  max-width:400px; width:100%; text-align:center; box-shadow: var(--shadow);
}
.login-logo{ height:70px; margin-bottom:18px; }
.login-card h1{ font-family:'Oswald',sans-serif; font-size:20px; color:#fff; margin:0 0 6px; }
.login-sub{ color:var(--text-mut); font-size:13px; margin:0 0 22px; line-height:1.5; }
.login-form{ display:flex; flex-direction:column; gap:12px; text-align:left; }
.login-form label{ font-size:12.5px; color:var(--text-mut); margin-bottom:-6px; }
.login-form input{
  background:var(--bg3); border:1px solid var(--line); border-radius:9px; color:#fff;
  padding:12px 14px; font-size:15px; outline:none;
}
.login-form input:focus{ border-color: var(--red); box-shadow: 0 0 0 3px var(--red-glow); }
.login-form button{
  margin-top:8px; padding:13px; border:none; border-radius:10px; cursor:pointer;
  background: linear-gradient(180deg,#e42323,#b81414); color:#fff; font-weight:700; font-size:15px;
}
.login-form button:hover{ filter:brightness(1.08); }
.error-box{
  background: rgba(216,31,31,.14); border:1px solid rgba(216,31,31,.4); color:#ff9d9d;
  padding:10px 14px; border-radius:9px; font-size:13px; margin-bottom:16px; text-align:left;
}

/* ================= Header: usuario logueado ================= */
.user-box{ display:flex; align-items:center; gap:10px; flex-shrink:0; }
.user-greeting{ font-size:13px; color:var(--text-mut); white-space:nowrap; }
.logout-link{
  display:flex; align-items:center; justify-content:center; width:38px; height:38px;
  border-radius:50%; background:var(--bg2); border:1px solid var(--line); color:var(--text-mut);
  transition: all .15s ease;
}
.logout-link:hover{ color:#fff; border-color:var(--red-dim); }

/* ================= Panel de administración ================= */
.admin-header{ background:#000; border-bottom:1px solid var(--line); }
.admin-header-inner{
  max-width:1100px; margin:0 auto; padding:14px 20px; display:flex; align-items:center; gap:16px;
}
.admin-logo{ height:44px; }
.admin-header-inner h1{ font-family:'Oswald',sans-serif; font-size:19px; color:#fff; margin:0; flex:1; }
.admin-main{ max-width:1100px; margin:0 auto; padding:28px 20px 60px; display:flex; flex-direction:column; gap:26px; }
.admin-panel{
  background: linear-gradient(180deg, var(--bg2), var(--bg1)); border:1px solid var(--line);
  border-radius:14px; padding:22px 24px;
}
.admin-panel h2{ font-family:'Oswald',sans-serif; font-size:17px; color:#fff; margin:0 0 18px; }
.admin-form .field-row{ display:flex; gap:14px; flex-wrap:wrap; margin-bottom:14px; }
.admin-form .field{ flex:1; min-width:180px; display:flex; flex-direction:column; gap:6px; }
.admin-form label{ font-size:12px; color:var(--text-mut); }
.admin-form input{
  background:var(--bg3); border:1px solid var(--line); border-radius:8px; color:#fff;
  padding:10px 12px; font-size:14px; outline:none;
}
.admin-form input:focus{ border-color: var(--red); }
.form-actions{ display:flex; gap:10px; align-items:center; margin-top:6px; }
.form-actions button{
  padding:11px 20px; border:none; border-radius:9px; cursor:pointer; font-size:14px; font-weight:600;
}
#submitBtn{ background: linear-gradient(180deg,#e42323,#b81414); color:#fff; }
#submitBtn:hover{ filter:brightness(1.08); }
.btn-secondary{ background:var(--bg3); color:var(--text-mut); }
.btn-secondary:hover{ color:#fff; }
.form-msg{ margin-top:12px; font-size:13px; }
.form-msg.error{ color:#ff6b6b; }
.form-msg.success{ color:var(--ok); }

.clients-table{ width:100%; border-collapse:collapse; font-size:13.5px; }
.clients-table th{
  text-align:left; color:var(--text-mut); font-size:11.5px; text-transform:uppercase; letter-spacing:.06em;
  padding:8px 10px; border-bottom:1px solid var(--line);
}
.clients-table td{ padding:10px 10px; border-bottom:1px solid var(--line); color:var(--text); }
.clients-table .empty-row{ text-align:center; color:var(--text-mut); padding:26px 0; }
.row-actions{ display:flex; gap:8px; }
.btn-small{
  padding:6px 12px; border:1px solid var(--line); border-radius:7px; background:var(--bg3);
  color:var(--text); font-size:12px; cursor:pointer;
}
.btn-small:hover{ border-color:var(--red-dim); color:#fff; }
.btn-danger:hover{ border-color:var(--red); background:rgba(216,31,31,.15); color:#ff9d9d; }
