:root {
  --bg: #050606; 
  --card: #090b0b; 
  --orange: #ff5a00; 
  --orange2: #ff8a00;
  --gold: #ffb000; 
  --text: #f4f4f4; 
  --muted: #a8a8a8; 
  --green: #20f39a;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(circle at 50% -10%, rgba(255,90,0,.25), transparent 32%),
              linear-gradient(#070909,#030404 70%);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}
body:before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .13;
  background-image: linear-gradient(120deg, transparent 0 48%, #ff8a00 49%, transparent 50%);
  background-size: 520px 520px;
}
.header { max-width: 1200px; margin: auto; padding: 18px 14px 8px; }
.logo { font-size: 28px; font-weight: 900; letter-spacing: 1px; color: #fff; }
.logo span { color: var(--orange); }

.categories {
  display: flex; gap: 12px; overflow-x: auto; padding: 12px 4px 18px;
  scrollbar-width: thin;
}
.cat {
  flex: 0 0 auto; width: 115px; height: 80px; border-radius: 18px;
  border: 1px solid #ff7300; background: linear-gradient(145deg,#ff2d00,#ff8500);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  box-shadow: 0 4px 15px rgba(255,77,0,.3);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.cat-icon {
  font-size: 26px;
  margin-bottom: 3px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
.cat-text {
  font-weight: 900;
  font-size: 11px;
  color: #fff;
}
.cat:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 8px 25px rgba(255,90,0,.5);
  background: linear-gradient(145deg,#ff421a,#ffa22b);
}
.cat:active {
  transform: scale(0.96);
}

.hero {
  max-width: 1200px; margin: 0 auto 16px; padding: 28px 16px; border-radius: 24px;
  text-align: center; background: linear-gradient(180deg,rgba(255,85,0,.12),rgba(0,0,0,.2));
  box-shadow: 0 0 35px rgba(255,70,0,.14) inset;
}
.hero h1 { margin: 0; color: #ffb06b; font-size: clamp(24px,4vw,42px); }
.hero p { margin: 8px 0; color: #aaa; }
.wrap { max-width: 1200px; margin: auto; padding: 0 12px 100px; }

.products {
  display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px;
}

.card {
  position: relative; 
  background: linear-gradient(180deg,#0b0d0d,#080909);
  border-radius: 12px; 
  padding: 12px;
  min-width: 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  transition: transform 0.3s ease, background 0.3s ease;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.card::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  background: linear-gradient(45deg, #ff5a00, #ffb000, #ff2d00, #ff8a00, #ff5a00);
  background-size: 400% 400%;
  z-index: -1;
  animation: borderGlow 6s ease infinite;
  opacity: 0.85;
}

@keyframes borderGlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.card:hover {
  transform: translateY(-5px);
  background: linear-gradient(180deg, #3d1604, #1c0a01);
}

.badges { height: 32px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; margin-bottom: 6px; }
.badge { padding: 4px 8px; border-radius: 6px; font-weight: 900; font-size: 11px; }
.offer { background: #ff8b00; color: #000; } 
.discount { background: #ae1717; color: #fff; }

.pic {
  width: 100%; aspect-ratio: 1.35/1; object-fit: cover; border-radius: 6px;
  background: #171919; display: block; margin-bottom: 9px;
}
.seller { color: #9b9997; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.name { font-size: 15px; font-weight: 900; line-height: 1.25; min-height: 40px; margin-top: 4px; }
.stars { color: #ffb800; margin-top: 5px; font-size: 16px; } 
.stars span { color: #159de1; font-size: 12px; }
.review { font-size: 12px; color: #aaa; margin: 3px 0 5px; }
.old { color: #777; text-decoration: line-through; font-size: 12px; text-align: right; }
.price { font-size: 17px; font-weight: 900; text-align: right; margin-bottom: 3px; color: #ffb06b; }
.renew { color: var(--green); font-weight: 800; font-size: 12px; }
.renew b { color: #fff; float: right; }

.btn {
  width: 100%; border: 0; border-radius: 9px; background: linear-gradient(135deg, #ff5a00, #ce4a00); color: white;
  padding: 12px 8px; margin-top: 11px; font-weight: 900; cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, border 0.3s ease, transform 0.1s;
}

.card:hover .btn {
  background: #050606;
  color: #ffb06b;
  border: 1px solid #ff5a00;
}

.btn:active { transform: scale(.98); }

.cartbar {
  position: fixed; z-index: 20; right: 18px; bottom: 18px; border: 1px solid #ff6b00;
  background: #0b0c0c; color: #fff; border-radius: 999px; padding: 13px 18px;
  box-shadow: 0 0 22px rgba(255,77,0,.45); font-weight: 900; cursor: pointer;
  transition: transform 0.2s;
}
.cartbar:hover { transform: scale(1.05); }

/* VENTANA FLOTANTE (MODAL) OPTIMIZADA Y COMPACTA */
.modal {
  display: none; position: fixed; z-index: 30; inset: 0; background: rgba(0,0,0,.82);
  padding: 12px; align-items: center; justify-content: center;
}
.modal.show { display: flex; }
.sheet {
  width: min(520px, 100%); max-height: 88vh; overflow-y: auto; background: #0b0d0d;
  border: 1px solid #ff5b00; border-radius: 14px;
  box-shadow: 0 0 35px rgba(255,70,0,.4); padding: 16px;
}
.sheet-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;
}
.sheet-header h2 { margin: 0; font-size: 18px; color: #ffb06b; }
.close-x {
  background: none; border: none; color: #aaa; font-size: 24px; cursor: pointer;
}
.close-x:hover { color: #fff; }

.ticket {
  background: #f6f0e6; color: #171717; border-radius: 8px; padding: 12px;
  font-family: "Courier New", monospace; box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
  max-height: 220px; overflow-y: auto;
}
.ticket h3 { text-align: center; margin: 0 0 4px; font-size: 15px; }
.line { border-top: 1px dashed #777; margin: 8px 0; }
.item { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; padding: 4px 0; font-size: 13px; }
.totalrow { display: flex; justify-content: space-between; padding: 3px 0; font-size: 13px; }
.total { font-size: 17px; font-weight: 900; }
.discountrow { color: #118c52; font-weight: 900; }
.actions { display: grid; grid-template-columns: 1.2fr 0.8fr 2fr; gap: 8px; margin-top: 10px; }
.close { background: #333; font-size: 11px; padding: 10px 4px; } 
.clear-cart { background: #a91f0a; font-size: 11px; padding: 10px 4px; }
.whatsapp { background: #0aa968; font-size: 12px; padding: 10px 6px; }

/* ESTILOS PARA LA CAJA DEL CUPÓN DE DESCUENTO */
.coupon-box {
  display: flex; gap: 8px; margin-top: 10px;
}
.coupon-box input {
  flex: 1; background: #161919; border: 1px dashed #ff7300; border-radius: 6px;
  padding: 8px 12px; color: #fff; font-size: 13px; outline: none;
}
.coupon-box input::placeholder {
  color: #777; font-style: italic;
}
.coupon-box button {
  background: #ff5a00; border: none; border-radius: 6px; color: #fff;
  font-weight: bold; padding: 0 14px; cursor: pointer; font-size: 12px;
  transition: background 0.2s;
}
.coupon-box button:hover { background: #ff7300; }
.coupon-msg {
  font-size: 11px; margin-top: 4px; min-height: 16px; text-align: center; font-weight: bold;
}

.qty {
  display: flex; align-items: center; gap: 6px; justify-content: flex-end;
}
.qty button { border: 0; border-radius: 4px; background: #222; color: white; width: 22px; height: 22px; cursor: pointer; font-size: 12px; }
.empty { text-align: center; color: #aaa; padding: 15px; font-size: 13px; }

@media(max-width:900px) {
  .products { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media(max-width:650px) {
  .header { padding-top: 10px; } 
  .logo { font-size: 23px; }
  .products { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .card { padding: 9px; } 
  .badge { font-size: 10px; padding: 3px 6px; }
  .name { font-size: 14px; min-height: 36px; } 
  .price { font-size: 15px; } 
  .seller { font-size: 11px; }
  .hero { padding: 22px 12px; } 
}
@media(min-width:1000px) {
  .sheet { border-radius: 14px; }
}