body {
  margin:0;
  font-family:Arial;
}

/* ===== TOP BAR ===== */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* LOGO */
.logo {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
}

/* DERECHA */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* BOTÓN SISTEMA */
.btn-sistema {
  padding: 8px 14px;
  font-size: 14px;
  background: #f3f4f6;
  color: #111827;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-sistema:hover {
  background: #e5e7eb;
}

/* BOTÓN CARRITO */
.btn-carrito {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-carrito:hover {
  background: #1d4ed8;
}

/* BADGE CARRITO */
.badge {
  background: #ef4444;
  color: #ffffff;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}

/* RESPONSIVE */
@media (max-width: 600px) {
  .texto {
    display: none;
  }

  .btn-sistema {
    display: none;
  }
}

/* GRID */
#productos{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(210px,1fr));
  gap:18px;
  padding:18px;
}

/* CARD */
.p-card{
  background:#fff;
  border-radius:14px;
  overflow:hidden;
  border:1px solid #e5e7eb;
  transition:.2s;
}


.p-card:hover{
  transform: translateY(-4px);
  box-shadow:0 12px 25px rgba(0,0,0,.08);
}

/* IMAGEN LLENANDO EL CUADRO */
.p-img{
  position: relative;
  width: 100%;
  padding-top: 133.33%; /* 4/3 = 1.3333 -> formato vertical */
  background:#f3f4f6;
  overflow:hidden;
}

.p-img img{
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height:100%;
  object-fit: cover;
  object-position:center;
  display:block;
}

/* BODY */
.p-body{
  padding:10px 12px 12px;
  display:flex;
  flex-direction:column;
  gap:6px; /* 👈 todo bien junto */
}

/* TITULO (2 líneas máximo) */
.p-title{
  font-size:14px;
  font-weight:600;
  color:#111827;
  line-height:1.25;

  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

/* PRECIO */
.p-price{
  font-size:20px;          /* 👈 más grande */
  font-weight:700;
  color:#16a34a;
}

/* BOTÓN */
.p-btn{
  margin-top:4px;
  padding:9px 0;
  font-size:14px;
  font-weight:600;
  background:#2563eb;
  color:#fff;
  border:none;
  border-radius:8px;
  cursor:pointer;
}

.p-btn:hover{
  background:#1d4ed8;
}


/* MODAL CARRITO */
#modalCarrito {
  position: fixed;
  top: 70px;
  right: 20px;
  width: 380px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
  border-radius: 10px;
  display: none;
  z-index: 999;
}


.carrito-box {
  padding:15px;
}
.cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #eee;
  padding: 10px 0;
}
.cart-item img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
}

.cart-item .info {
  flex: 1;
}

.cart-item .qty {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart-item .qty button {
  width: 26px;
  height: 26px;
  border: none;
  background: #333;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
}

.cart-total {
  text-align: right;
  padding-top: 10px;
  font-size: 16px;
}

/* PANEL ENVIO */
#panelEnvio {
  position:fixed;
  top:0;
  right:-450px;
  width:450px;
  height:100%;
  background:#fff;
  box-shadow:-3px 0 10px rgba(0,0,0,.3);
  transition:.3s;
  z-index:900;
}

#panelEnvio iframe {
  width:100%;
  height:100%;
  border:none;
}

/* mensaje del stock*/
#toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #d63031;
  color: #fff;
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
  z-index: 2147483647; /* máximo */
}

#toast.show {
  opacity: 1;
}

/* PANEL DERECHO (DRAWER) */
#drawerEnvio {
  position: fixed;
  top: 0;
  right: -420px;           /* oculto */
  width: 420px;
  max-width: 95%;
  height: 100%;
  background: #fff;
  box-shadow: -4px 0 12px rgba(0,0,0,.2);
  transition: right .3s ease;
  z-index: 1200;

  display: flex;
  flex-direction: column;
}

/* cuando está abierto */
#drawerEnvio.open {
  right: 0;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #ddd;
}

#envioContenido {
  padding: 15px;
  overflow-y: auto;
}

