/* CART TOGGLE */
.cart-toggle {
  position: relative;
  background: var(--primary);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  font-weight: 700;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.3s;
}

.cart-toggle:hover {
  background: var(--primary-dark);
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ff4444;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

/* CART SIDEBAR */
.cart-sidebar {
  position: fixed;
  right: -450px;
  top: 0;
  width: 450px;
  height: 100vh;
  background: white;
  box-shadow: -5px 0 20px rgba(0,0,0,0.2);
  z-index: 2000;
  transition: right 0.3s;
  display: flex;
  flex-direction: column;
}

.cart-sidebar.active {
  right: 0;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px 30px;
  border-bottom: 2px solid #f0f0f0;
}

.cart-header h3 {
  font-size: 24px;
  margin: 0;
}

.cart-close {
  background: none;
  border: none;
  font-size: 32px;
  cursor: pointer;
  color: #999;
  transition: color 0.3s;
}

.cart-close:hover {
  color: var(--text);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 20px 30px;
}

.cart-empty {
  text-align: center;
  color: #999;
  padding: 60px 20px;
  font-size: 16px;
}

.cart-item {
  display: flex;
  gap: 15px;
  padding: 20px 0;
  border-bottom: 1px solid #f0f0f0;
}

.cart-item-img {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #f0e6ff, #fff);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
}

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

.cart-item-name {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 8px;
  color: var(--text);
}

.cart-item-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}

.cart-item-remove {
  background: none;
  border: none;
  color: #ff4444;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
  padding: 0;
}

.cart-item-remove:hover {
  text-decoration: underline;
}

.cart-footer {
  padding: 25px 30px;
  border-top: 2px solid #f0f0f0;
  background: #f9f9f9;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-size: 18px;
}

.cart-total strong {
  font-size: 28px;
  color: var(--primary);
  font-weight: 900;
}

.btn-checkout {
  width: 100%;
  padding: 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  margin-bottom: 12px;
  transition: background 0.3s;
}

.btn-checkout:hover {
  background: var(--primary-dark);
}

.btn-continue-shopping {
  width: 100%;
  padding: 14px;
  background: transparent;
  color: var(--text);
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-continue-shopping:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1999;
  display: none;
}

.cart-overlay.active {
  display: block;
}

/* TIENDA MAIN */
.tienda-main {
  padding: 140px 0 80px;
  background: linear-gradient(180deg, #f0e6ff 0%, #fff 20%);
  min-height: 100vh;
}

.tienda-header {
  text-align: center;
  margin-bottom: 50px;
}

.tienda-header h1 {
  font-size: 48px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 15px;
}

.tienda-header p {
  font-size: 18px;
  color: var(--text-light);
}

/* FILTROS */
.filtros-section {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 50px;
  flex-wrap: wrap;
}

.filtro-btn {
  padding: 12px 30px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.filtro-btn:hover,
.filtro-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* PRODUCTOS */
.productos-tienda {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 35px;
}

.producto-tienda {
  background: white;
  border-radius: 25px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0,0,0,0.08);
  transition: transform 0.3s;
}

.producto-tienda:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.producto-img {
  position: relative;
  height: 220px;
}

.img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f0e6ff 0%, #fff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
}

.tipo-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  padding: 6px 15px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tipo-badge.digital {
  background: #2196F3;
  color: white;
}

.tipo-badge.fisico {
  background: #FF5722;
  color: white;
}

.tipo-badge.cursos {
  background: #4CAF50;
  color: white;
}

.badge-popular {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #FFD700;
  color: #333;
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 11px;
  font-weight: 700;
}

.producto-info {
  padding: 25px;
}

.producto-info h3 {
  font-size: 20px;
  margin-bottom: 12px;
  color: var(--text);
}

.producto-desc {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 15px;
}

.producto-detalles {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.producto-detalles span {
  background: var(--bg-light);
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 12px;
  color: var(--text-light);
}

.producto-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid #f0f0f0;
}

.precio {
  font-size: 26px;
  font-weight: 900;
  color: var(--primary);
}

.btn-add-cart {
  padding: 12px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-add-cart:hover {
  background: var(--primary-dark);
}

@media (max-width: 1024px) {
  .productos-tienda {
    grid-template-columns: repeat(2, 1fr);
  }

  .cart-sidebar {
    width: 380px;
    right: -380px;
  }
}

@media (max-width: 768px) {
  .productos-tienda {
    grid-template-columns: 1fr;
  }

  .cart-sidebar {
    width: 100%;
    right: -100%;
  }
}
