/* ==== GENERAL ==== */
body {
  background-color: #080808;
  color: white;
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
}

/* ==== MARQUEE ==== */
.shop-marquee {
  width: 100%;
  overflow: hidden;
  border-bottom: 1px solid #cfcfcf;
  background: #f2f2f2;
}

.shop-marquee .track {
  display: flex;
  gap: 36px;
  padding: 10px 18px;
  white-space: nowrap;
  animation: marquee-scroll 18s linear infinite;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.9rem;
  color: #000;
}

.shop-marquee .item {
  color: #000;
}

.marquee-editor {
  display: none;
  gap: 10px;
  align-items: center;
  padding: 10px 18px;
  border-bottom: 1px solid #1a1a1a;
  background: #0b0b0b;
}

.marquee-editor label {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #cfcfcf;
}

.marquee-editor input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #2d2d2d;
  background: #0f0f0f;
  color: #fff;
}

.marquee-editor button {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #ffffff;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 0.2s ease, color 0.2s ease;
}

.marquee-editor button:hover {
  background: #ffffff;
  color: #050505;
}

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ==== SHOP SECTION ==== */
.shop {
  padding: 20px 26px 80px;
  background-color: #080808;
  min-height: 100vh;
}

.shop-navbar-wrapper {
  width: 100%;
  max-width: 1250px;
  margin: 12px auto 6px;
  padding: 0 14px;
  box-sizing: border-box;
}

.shop-header {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
  margin: 12px 0 10px;
}

.admin-btn {
  background-color: #ff6b6b;
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s;
}

.admin-btn:hover {
  background-color: #ff5252;
}

/* ==== PRODUCT GRID ==== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
  margin-top: 12px;
}

.product-card {
  background-color: #0f0f0f;
  border: 1px solid #0a0a0a;
  padding: 12px;
  color: white;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: #ffffff;
}

.img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(180deg, #0d0d0d, #040404);
}

.img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.img-wrap img.front {
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.img-wrap img.back {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.product-card:hover .img-wrap img.front {
  opacity: 0;
  transform: scale(1.02);
}

.product-card:hover .img-wrap img.back {
  opacity: 1;
  transform: scale(1.02);
}

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.product-meta .info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.product-meta .title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.product-meta .price {
  margin: 0;
  font-size: 0.83rem;
  color: #f5f5f5;
  letter-spacing: 0.02em;
}

/* Descuentos */
.price-old { text-decoration: line-through; opacity: 0.55; margin-right: 4px; }
.price-new { font-weight: 600; color: #ffffff; }
.discount-badge {
  display:inline-block;
  background:#ff2e2e;
  color:#050505;
  font-size:0.65rem;
  font-weight:700;
  letter-spacing:0.08em;
  padding:4px 8px;
  border-radius:6px;
  margin-left:6px;
}
.discount-dates { display:block; font-size:0.55rem; letter-spacing:0.08em; color:#bbb; margin-top:4px; }

.cart-btn {
  width: 28px;
  height: 24px;
  border: none;
  border-radius: 0;
  background: transparent url('../imagenes/carro.png') center/24px no-repeat;
  display: inline-block;
  cursor: pointer;
  filter: brightness(0) invert(1);
  transition: transform 0.2s ease, filter 0.2s ease, background-image 0.2s ease;
}

.cart-btn:hover {
  transform: translateY(-2px);
  background-image: url('../imagenes/carroRojo.png');
  filter: none;
}

.edit-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0,0,0,0.8);
  border: 1px solid #ffffff;
  color: #ffffff;
  font-size: 0.9rem;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, border 0.2s ease;
}

.edit-btn:hover {
  background: #ffffff;
  color: #050505;
  border-color: #ffffff;
  transform: translateY(-1px);
}

.add-product-btn, .admin-btn {
  margin: 20px auto 0;
  display: none;
  padding: 14px 24px;
  border-radius: 10px;
  border: 1px solid #ffffff;
  background: transparent;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.add-product-btn:hover, .admin-btn:hover {
  background: #ffffff;
  color: #050505;
  transform: translateY(-2px);
}

.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  min-width: 150px;
}

/* ==== MODALS ADMIN ==== */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.65);
  z-index: 10000;
}

.modal-content {
  background: #0f0f0f;
  border: 1px solid #2a2a2a;
  border-radius: 14px;
  padding: 22px;
  width: min(520px, 92vw);
  color: #fff;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  box-sizing: border-box;
}

.modal-content h2 {
  margin-top: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.modal .close {
  position: absolute;
  right: 14px;
  top: 10px;
  font-size: 22px;
  cursor: pointer;
}

.form-group {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-size: 0.9rem;
  color: #e6e6e6;
  letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 12px;
  border-radius: 10px;
  border: 1px solid #2f2f2f;
  background: #0b0b0b;
  color: #fff;
  box-sizing: border-box;
}

.stock-input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 10px;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.btn-save, .btn-delete, .btn-cancel {
  flex: 1 1 120px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #2f2f2f;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.08em;
}

@media (max-width: 600px) {
  .modal-content {
    padding: 18px 16px;
    width: min(520px, 95vw);
  }

  .form-group {
    gap: 10px;
  }
}

.btn-save { background: #ffffff; color: #050505; }
.btn-delete { background: #ff4c4c; color: #050505; }
.btn-cancel { background: transparent; color: #ffffff; }

.message {
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  font-size: 0.9rem;
}
.message.success { background: #124d21; border: 1px solid #1c8734; }
.message.error { background: #4d1a1a; border: 1px solid #a33; }

@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .shop {
    padding: 16px 14px 60px;
  }

  .shop-marquee .track {
    gap: 24px;
    font-size: 0.82rem;
    animation-duration: 22s;
  }
}
